×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Registered User
    Join Date
    Apr 2011
    Posts
    3

    Deployment Problem

    Hi,
    This is Rajesh

    When I Deploy My Application in Mobile (NOKIA E71 , NOKIA 3110C) , I am getting following Errors

    1)Error verifying method calendarEg (midlet class) startApp()V

    2)Approximate bytecode offset 0: Inconsistent or missing stackmap at target

    3)ALERT: java/lang/VerifyError: calendarEg


    The code is running fine in my emulator but giving errors in phone, Is this because of using canvas in my application
    Please Help Me How to solve the problem.

    Kind & Regards
    Rajesh
    Last edited by RajeshYadav_Mobi; 2011-05-19 at 06:58.

  2. #2
    Registered User
    Join Date
    Dec 2009
    Posts
    376

    Re: Deployment Problem

    Quote Originally Posted by RajeshYadav_Mobi View Post




    [COLOR="Blue"]1)Error verifying method ZXingMIDlet (midlet class) startApp()V

    2)Approximate bytecode offset 0: Inconsistent or missing stackmap at target


    Kind & Regards
    Rajesh
    Have you tested it on other phones and the errot now seems to be in startApp ,what is that V

  3. #3
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: Deployment Problem

    Rajesh, Welcome to the Forum Nokia Di Bo,


    1)Error verifying method ZXingMIDlet (midlet class) startApp()V

    2)Approximate bytecode offset 0: Inconsistent or missing stackmap at target

    3)ALERT: java/lang/VerifyError: ZXingMIDlet
    1. Tell us more about the app and the API's you are using in it.
    2. Share what exactly you are trying to do in the app?

    Is this because of using canvas in my application
    Nope, no chance for getting these error if you are using the canvas in your app.

    There is anything else which leading you with these issues. Please explain in much more details.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  4. #4
    Registered User
    Join Date
    Apr 2011
    Posts
    3

    Re: Deployment Problem

    Hi,
    Thanks for Reply
    I Developed one small calendar View Application with canvas support in my midlet its running fine in emulator and showing me calendar view but whenever i try to deploy in mobile or deploy in emulator through jad file i am getting the above exceptions. Even when i try to deploy a midlet which is not having canvas support runs fine in both Mobile and emulator through jad file.
    The API are
    All 3 API of Java supported by J2me and javax.microedition.*;
    So please Help me to solve the problem.
    Thanks & Regards
    Rajesh

  5. #5
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,073

    Re: Deployment Problem

    Quote Originally Posted by RajeshYadav_Mobi View Post
    Hi,
    Thanks for Reply
    I Developed one small calendar View Application with canvas support in my midlet its running fine in emulator and showing me calendar view but whenever i try to deploy in mobile or deploy in emulator through jad file i am getting the above exceptions. Even when i try to deploy a midlet which is not having canvas support runs fine in both Mobile and emulator through jad file.
    The API are
    All 3 API of Java supported by J2me and javax.microedition.*;
    So please Help me to solve the problem.
    Thanks & Regards
    Rajesh
    It looks that you are trying load a resource (may be a image file) for your canvas app which is failing in loading on real device - because the file name is case sensitive on real device while its not case sensitive for emulator running on windows system.
    Please check with Try/Catch where your are loading the resources.

    Cut Paste your startApp() method code here...
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  6. #6
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: Deployment Problem

    May be there are some issues with the rendering of the image. Check out the graphics object you are using for rendering the resources. Put the code which is loading the resources, and rendering the resources inside the try-catch.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  7. #7
    Registered User
    Join Date
    Apr 2011
    Posts
    3

    Re: Deployment Problem

    I Removed all The Image obj To display only a calendar view on emulator,
    its running fine when i give midlet name in emulator.but when i chose JAD url
    its again giving the same error

    Thanks & Regards
    K.Rajesh

  8. #8
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: Deployment Problem

    Quote Originally Posted by RajeshYadav_Mobi View Post
    I Removed all The Image obj To display only a calendar view on emulator,
    its running fine when i give midlet name in emulator.but when i chose JAD url
    its again giving the same error

    Thanks & Regards
    K.Rajesh

    Are you able to draw the blank Canvas?
    Try to move steps by steps, like draw the container, then keep on adding the components to it. Put your code inside the try-catch blocks.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  9. #9
    Registered User
    Join Date
    May 2011
    Posts
    8

    Deployment Problem

    I Tried what u said

    Kept all canvas related obj in try & catch block still same problem when i run through JAD file

    Here is the error what iam getting

    Running with storage root /home/pradhama/j2mewtk/2.5.2/appdb/DefaultColorPhone
    Running with locale: en_IN
    Running in the identified_third_party security domain
    Method............: b734e228 'com/sun/midp/midlet/MIDletState.createMIDlet (static)'
    Error verifying method calendarEg <init>()V
    Approximate bytecode offset 4: Inconsistent or missing stackmap at target

    Stack Chunk.......: b492fa40
    Frame Pointer.....: b492fa98
    Current IP........: b75624f7 = b75624da + offset 29
    Previous Frame....: b492fa60
    Previous IP.......: b75f5f95 (offset 22)
    Frame size........: 7 (1 arguments, 6 local variables)
    Argument[0].......: b49302c0
    Local[1]..........: 0
    Local[2]..........: b4aad870
    Local[3]..........: b493fa8c
    Local[4]..........: b4aad884
    Local[5]..........: b738fb04
    Local[6]..........: b4aad850
    Operand[1]........: b4b2e848

    Method............: b73b0938 'com/sun/midp/midlet/Selector.run (virtual)'
    Stack Chunk.......: b492fa40
    Frame Pointer.....: b492fa60
    Current IP........: b75f5f95 = b75f5f7f + offset 22
    Previous Frame....: 0
    Previous IP.......: 1
    Frame size........: 6 (1 arguments, 5 local variables)
    Argument[0].......: b49304c8
    Local[1]..........: b493fb68
    Local[2]..........: b49302c0
    Local[3]..........: 0
    Local[4]..........: 0
    Local[5]..........: 0
    Operand[1]........: b493fb68

    VM status:
    Instruction pointer.: b75624f7 (offset within invoking method: 29)
    Next instruction....: 0x4c
    Frame pointer.......: b492fa98
    Local pointer.......: b492fa7c
    Stack size..........: 128; sp: b492fab0; ranges: b492fa48-b492fc48;
    Contents of the current stack frame:
    b492fa7c: b49302c0 (lp)
    b492fa80: 0
    b492fa84: b4aad870
    b492fa88: b493fa8c
    b492fa8c: b4aad884
    b492fa90: b738fb04
    b492fa94: b4aad850
    ALERT: java/lang/VerifyError: calendarEg.
    b492fa98: b492fa60 (fp)
    b492fa9c: b75f5f95
    b492faa0: b492fa78
    b492faa4: b734e228
    b492faa8: b492fa40
    b492faac: 0 (end of frame)
    b492fab0: b4b2e848 (sp)
    Execution stack contains 108 items:
    b49304c8
    b493fb68
    b49302c0
    0
    0
    0
    0
    1
    b4aad854
    b73b0938
    b492fa40
    0
    b493fb68
    b49302c0
    0
    b4aad870
    b493fa8c
    b4aad884
    b738fb04
    b4aad850
    b492fa60
    b75f5f95
    b492fa78
    b734e228
    b492fa40
    0
    b4b2e848

    Execution completed.
    3430117 bytecodes executed
    480 thread switches
    1667 classes in the system (including system classes)
    17742 dynamic objects allocated (532384 bytes)
    2 garbage collections (461700 bytes collected)
    Execution completed.
    3430117 bytecodes executed
    480 thread switches
    1667 classes in the system (including system classes)
    17742 dynamic objects allocated (532384 bytes)
    2 garbage collections (461700 bytes collected)
    Last edited by RajeshMobi; 2011-05-20 at 14:21.

  10. #10
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: Deployment Problem

    Rajesh, so that share the code here, people here can test the same and verify.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  11. #11
    Registered User
    Join Date
    May 2011
    Posts
    8

    Deployment Problem

    Hi,
    Sorry For Delay
    I Had Developed The Calendar Application
    From This URL http://wiki.forum.nokia.com/index.ph...ar/date_picker
    its runs fine in emulator
    Please run by making as JAD and JAR File
    Waiting for Reply
    Thanks & Regards
    Rajesh

    Here is the code and JAD and Manifest File

    The Main MIDlet Class

    import java.util.Date;
    import javax.microedition.lcdui.Alert;
    import javax.microedition.lcdui.AlertType;
    import javax.microedition.lcdui.Canvas;
    import javax.microedition.lcdui.Display;
    import javax.microedition.lcdui.Font;
    import javax.microedition.lcdui.Graphics;
    import javax.microedition.midlet.MIDlet;


    public class CalendarDemo extends MIDlet
    {
    Canvas calendarcanvas;

    public CalendarDemo()
    {
    calendarcanvas=new CalendarCanvas(this);
    }

    public void pauseApp()
    {

    }

    public void startApp()
    {
    Display disp=Display.getDisplay(this);
    disp.setCurrent(calendarcanvas);
    }

    public void destroyApp(boolean b)
    {

    }

    }
    class CalendarCanvas extends Canvas
    {
    CalendarWidget calendar = null;
    CalendarDemo midlet = null;

    public CalendarCanvas(CalendarDemo m)
    {
    this.midlet = m;

    calendar = new CalendarWidget(new Date());

    calendar.headerFont = Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_LARGE);
    calendar.weekdayFont = Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM);
    calendar.weekdayBgColor = 0xccccff;
    calendar.weekdayColor = 0x0000ff;
    calendar.headerColor = 0xffffff;

    calendar.initialize();
    }
    protected void keyPressed(int key)
    {
    int keyCode = getGameAction(key);

    if(keyCode == FIRE)
    {
    Display.getDisplay(midlet).setCurrent(
    new Alert("Selected date", calendar.getSelectedDate().toString(), null, AlertType.CONFIRMATION)
    );
    }
    else
    {
    calendar.keyPressed(keyCode);

    repaint();
    }
    }

    protected void paint(Graphics g)
    {
    g.setColor(0xffffff);
    g.fillRect(0, 0, getWidth(), getHeight());

    calendar.paint(g);
    }
    }


    The Other Class TO Display The Contents Of Calendar


    import java.util.Calendar;
    import java.util.Date;

    import javax.microedition.lcdui.Canvas;
    import javax.microedition.lcdui.Font;
    import javax.microedition.lcdui.Graphics;

    public class CalendarWidget
    {
    static final String[] MONTH_LABELS = new String[]{
    "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
    };
    static final String[] WEEKDAY_LABELS = new String[]{
    "M", "T", "W", "T", "F", "S", "S"
    };
    /* starting week day: 0 for monday, 6 for sunday */
    public int startWeekday = 0;

    /* elements padding */
    public int padding = 1;

    /* cells border properties */
    public int borderWidth = 4;
    public int borderColor = 0x0000ff;

    /* weekday labels properties */
    public Font weekdayFont = Font.getDefaultFont();
    public int weekdayBgColor = 0x0000ff;
    public int weekdayColor = 0xffffff;

    /* header (month-year label) properties */
    public Font headerFont = Font.getDefaultFont();
    public int headerBgColor = 0x0000ff;
    public int headerColor = 0xffffff;

    /* cells properties */
    public Font font = Font.getDefaultFont();
    public int foreColor = 0x000000;
    public int bgColor = 0x9999ff;
    public int selectedBgColor = 0xffff00;
    public int selectedForeColor = 0xff0000;

    /* internal properties */
    int width = 0;
    int height = 0;
    int headerHeight = 0;
    int weekHeight = 0;
    int cellWidth = 0;
    int cellHeight = 0;

    /* internal time properties */
    long currentTimestamp = 0;
    Calendar calendar = null;
    int weeks = 0;

    public CalendarWidget(Date date)
    {
    calendar = Calendar.getInstance();

    //we'll see these 2 methods later
    setDate(date);

    initialize();
    }
    public Date getSelectedDate()
    {
    return calendar.getTime();
    }
    public void setDate(Date d)
    {
    currentTimestamp = d.getTime();

    calendar.setTime(d);

    //weeks number can change, depending on week starting day and month total days
    this.weeks = (int)Math.ceil(((double)getStartWeekday() + getMonthDays()) / 7);
    }
    public void setDate(long timestamp)
    {
    setDate(new Date(timestamp));
    }
    void initialize()
    {
    //let's initialize calendar size
    this.cellWidth = font.stringWidth("MM") + 2 * padding;
    this.cellHeight = font.getHeight() + 2 * padding;

    this.headerHeight = headerFont.getHeight() + 2 * padding;
    this.weekHeight = weekdayFont.getHeight() + 2 * padding;

    this.width = 7 * (cellWidth + borderWidth) + borderWidth;
    initHeight();
    }
    void initHeight()
    {
    this.height =
    headerHeight + weekHeight +
    this.weeks * (cellHeight + borderWidth) + borderWidth;
    }
    int getMonthDays()
    {
    int month = calendar.get(Calendar.MONTH);

    switch(month)
    {
    case 3:
    case 5:
    case 8:
    case 10:
    return 30;
    case 1:
    return calendar.get(Calendar.YEAR) % 4 == 0 && calendar.get(Calendar.YEAR) % 100 != 0 ? 29 : 28;
    default:
    return 31;
    }
    }
    int getStartWeekday()
    {
    //let's create a new calendar with same month and year, but with day 1
    Calendar c = Calendar.getInstance();

    c.set(Calendar.MONTH, calendar.get(Calendar.MONTH));
    c.set(Calendar.YEAR, calendar.get(Calendar.YEAR));
    c.set(Calendar.DAY_OF_MONTH, 1);

    //we must normalize DAY_OF_WEEK returned value
    return (c.get(Calendar.DAY_OF_WEEK) + 5) % 7;
    }
    public void keyPressed(int key)
    {
    switch(key)
    {
    case Canvas.UP:
    go(-7);
    break;
    case Canvas.DOWN:
    go(7);
    break;
    case Canvas.RIGHT:
    go(1);
    break;
    case Canvas.LEFT:
    go(-1);
    break;
    }
    }
    void go(int delta)
    {
    int prevMonth = calendar.get(Calendar.MONTH);

    setDate(currentTimestamp + 86400000 * delta);

    //we have to check if month has changed
    //if yes, we have to recalculate month height
    //since weeks number could be changed
    if(calendar.get(Calendar.MONTH) != prevMonth)
    {
    initHeight();
    }
    }
    public void paint(Graphics g)
    {
    //painting background
    g.setColor(bgColor);
    g.fillRect(0, 0, width, height);

    //painting header (month-year label)
    g.setFont(headerFont);
    g.setColor(headerColor);
    g.drawString(MONTH_LABELS[calendar.get(Calendar.MONTH)] + " " + calendar.get(Calendar.YEAR), width / 2, padding, Graphics.TOP | Graphics.HCENTER);

    //painting week days labels
    g.translate(0, headerHeight);

    g.setColor(weekdayBgColor);
    g.fillRect(0, 0, width, weekHeight);

    g.setColor(weekdayColor);
    g.setFont(weekdayFont);

    for(int i = 0; i < 7; i++)
    {
    g.drawString(WEEKDAY_LABELS[(i + startWeekday) % 7],
    borderWidth + i * (cellWidth + borderWidth) + cellWidth / 2,
    padding,
    Graphics.TOP | Graphics.HCENTER
    );
    }

    //painting cells borders
    g.translate(0, weekHeight);

    g.setColor(borderColor);

    for(int i = 0; i <= weeks; i++)
    {
    g.fillRect(0, i * (cellHeight + borderWidth), width, borderWidth);
    }
    for(int i = 0; i <= 7; i++)
    {
    g.fillRect(i * (cellWidth + borderWidth), 0, borderWidth, height - headerHeight - weekHeight);
    }

    //painting days
    int days = getMonthDays();
    int dayIndex = (getStartWeekday() - this.startWeekday + 7) % 7;

    g.setColor(foreColor);

    int currentDay = calendar.get(Calendar.DAY_OF_MONTH);

    for(int i = 0; i < days; i++)
    {
    int weekday = (dayIndex + i) % 7;
    int row = (dayIndex + i) / 7;

    int x = borderWidth + weekday * (cellWidth + borderWidth) + cellWidth / 2;
    int y = borderWidth + row * (cellHeight + borderWidth) + padding;

    //if this is the current day, we'll use selected bg and fore colors
    if(i + 1 == currentDay)
    {
    g.setColor(selectedBgColor);
    g.fillRect(
    borderWidth + weekday * (cellWidth + borderWidth),
    borderWidth + row * (cellHeight + borderWidth),
    cellWidth, cellHeight);
    g.setColor(selectedForeColor);
    }

    g.drawString("" + (i + 1), x, y, Graphics.TOP | Graphics.HCENTER);

    //if this is the current day, we must restore standard fore color
    if(i + 1 == currentDay)
    {
    g.setColor(foreColor);
    }
    }
    //let's traslate back!
    g.translate(0, - headerHeight - weekHeight);
    }
    }

    Here is My JAD and Manifest File
    JAD FILE
    MIDlet-Name: TestDeployCalendar test
    MIDlet-1: CalendarDemo,,CalendarDemo
    MIDlet-Jar-URL: TestDeployCalendar.jar
    MIDlet-Vendor: Pradhama
    MIDlet-Jar-Size: 5336
    MIDlet-Version: 1.0.0
    MicroEdition-Configuration: CLDC-1.1
    MicroEdition-Profile: MIDP-2.0


    Manifest File
    Manifest-Version: 1.0
    Created-By: 1.6.0_20 (Sun Microsystems Inc.)
    MIDlet-Name: TestDeployCalendar test
    MIDlet-1: CalendarDemo,,CalendarDemo
    MIDlet-Vendor: Pradhama
    MIDlet-Version: 1.0.0
    MicroEdition-Configuration: CLDC-1.1
    MicroEdition-Profile: MIDP-2.0
    [
    Last edited by RajeshMobi; 2011-05-23 at 14:55.

  12. #12
    Registered User
    Join Date
    May 2011
    Posts
    8

    Re: Deployment Problem

    Hi,
    Please Help Me out Where I am Making Mistakes in (JAD or JAR ) File
    Waiting For Reply

    Thanks and Regards
    Rajesh

  13. #13
    Regular Contributor
    Join Date
    Aug 2010
    Location
    Chennai, India.
    Posts
    176

    Re: Deployment Problem


  14. #14
    Registered User
    Join Date
    May 2011
    Posts
    8

    Re: Deployment Problem

    I used same jad and jar file (options)
    in a midlet containing some string it runs fine on mobile.

  15. #15
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,073

    Re: Deployment Problem

    try MIDlet-Name: test
    i.e. remove blank space in MIDlet-Name attribute and keep it short.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

Page 1 of 2 12 LastLast

Similar Threads

  1. newbie deployment problem
    By _willy_ in forum Mobile Java General
    Replies: 2
    Last Post: 2008-08-02, 11:56
  2. Deployment problem
    By reeco1 in forum Mobile Java General
    Replies: 2
    Last Post: 2006-02-13, 19:39
  3. Deployment problem
    By cheenu78@fastmail.fm in forum Symbian C++
    Replies: 2
    Last Post: 2006-01-23, 15:18
  4. Deployment problem
    By Kulendra in forum Mobile Java Tools & SDKs
    Replies: 4
    Last Post: 2005-05-13, 05:47
  5. Deployment problem
    By olicarspa in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2005-05-11, 14:43

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •