J2me debugging

I am trying to debug some source that I have. I am manipulating a PNG file within the code and then trying to Image.CreateImage(data,offset,length). I keep getting errors like "invalid data chunk". The problem is that I can not step into the source for Image.CreateImage etc.. Where are the sources for the WTK2.1?

<Are you updating the chunk CRC
Yes, as a matter of fact, Im pretty sure its right. If I just look at the CRC already stored in the file and compare it to the CRC I calculate with my method, the numbers are the same. When I change a byte, calculate the CRC again ,store it etc.. I get the errors. If I calculate the CRC without changing a byte and then just re-write what was already stored, I don't get an error so I am pretty sure I am writing it to the right place as well. Thanks for the link. Thanks for your help. I have a similar question posted on three other web pages, included the midp/cldc one here, and you are the first person even attempting to answer.

Similar Messages

  • J2ME Debugging & localhost

    I am wondering what the problem is using localhost as the "Host Name" in the J2ME config? This is a problem on my home machine since I am not connected to a network. At work I am able to use my machine name and everything works just fine.
    Is there a solution to this problem or will there be a fix in the J2ME extension.
    Thanks,
    Karl

    Actually it looks like the problem is with the Sun emulator.exe. I have been digging into the extension code and associated bat files. Ultimately emulator.exe is called with the appropriate parameters. Everything looks fine according to the Sun documentation, but when I actually make the call (in a cmd window) it fails:
    Command:
    D:\java\J2mewtk\bin\emulator -Xverbose:gc -Xdebug -Xrunjdwp:transport=dt_socket,address=localhost:5000,server=y -Xdescriptor:D:\PhoneProjects\BestSuite\src\TheBestSuite.jad -Xdevice:DefaultColorPhone
    Response:
    You can only specify the local host for debugging
    I have also tried removing the localhost parameter since the documentation says it defaults to localhost, however, the same error occurs.
    I have also checked my hosts file and localhost has the correct ip address.
    Sun must be doing some ip indirection internally within the emulator. I have been searching the discusion forums but have not found anything yet.
    Hopefully we are narrowing down the problem.
    Karl

  • Building J2ME midlet for Motorola A925

    Hi,
    In my build of a test app using Netbeans and the C:\Symbian\A925SDK\epoc32\tools\j2me\j2me-debug.jar library, I get the following error during the Preverifying process:
    ERROR: native methods should not appear
    Error preverifying class com.motorola.game.GameScreen
    How do I use the com.motorola java classes in my app and and get past the preverifying process?
    Thanks
    Peter

    Hi,
    Has this problem been solved yet? I've the same problem when using the location packages inside the j2me.
    I've learnt u can't get around the preverification process so what can i do?
    Many thanks for your helps
    Sean

  • Nokia Series 60 MIDP SDK Beta 0.1 with JBuilder6

    Hi,
    I installed Nokia Series 60 MIDP SDK Beta 0.1 and configured the JDK of JBuilder6.
    When I run the midlet, The EPOC emulator was pop up, but then there was a runtime error:
    Emulator command: C:\Nokia_Series_60_MIDP_SDK_Beta_0_1\bin\Epoc32\release\wins\udeb\kmidp_debug.exe -parent_port 2810 -classpath C:\Nokia_Series_60_MIDP_SDK_Beta_0_1\lib\j2me-debug.zip; C:\projects\test\classes;C:\Nokia_Series_60_MIDP_SDK_Beta_0_1\lib\j2me-debug.zip -descriptor c:\tmp\midp\Test.jad Test
    java.lang.RuntimeException: Class not found in runMIDlet: java.lang.ClassNotFoundException: test.Test
    at com.symbian.midp.compatibility.runtime.MIDletExecutor.runMIDlet(+143)
    at com.symbian.midp.compatibility.runtime.MIDletMain.runFirstMIDlet(+77)
    at com.symbian.midp.compatibility.runtime.MIDletMain.run(+346)
    at com.sun.midp.midlet.Main.main(+56)
    I changed the path to that MIDP SDK, but still failed. This test program can be run with Default J2MEwtk, motorola or Sony emulator.
    What's wrong with my settings? or the software has bugs because I found that there are many developers who posted in the Nokia's support forum were unable to run it properly .
    Regards
    gogo

    Nokia emulator can execute only packaged MIDP. So, make .jar and jad files by WirelessToolkit and then run it under WirelessToolkit, by choosing Nokia device, of course.

  • How to set up on device debuging with J2ME SDK 3.0 and window mobile 6.5?

    I got some infomation about setting up on device debuging in J2ME SDK 3.0 with real device(e.g samsung windown mobile B7330). When I start debuging on device, I got exception when open RMS
    javax.microedition.rms.RecordStoreException: error opening record store fileHere my code:
    public void saveProfile() {
            byte[] data = toByteArray();
            try {
                rs = RecordStore.openRecordStore("kunkunProfile", true);
                for (RecordEnumeration e = rs.enumerateRecords(null, null, false); e.hasNextElement();) {
                    int id = e.nextRecordId();
                    rs.deleteRecord(id);
                rs.addRecord(data, 0, data.length);
                rs.closeRecordStore();
            } catch (Exception ex) {
                System.out.println("Exception in OpenRecordStore..." + ex.getMessage());
                try {
                    rs.addRecord(data, 0, data.length);
                    rs.closeRecordStore();
                } catch (Exception e) {
                ex.printStackTrace();
        }Anybody help me? I am stuck here.

    Hi dominikg,
    At first, You can try to restart the device-manager from system tray.
    If it doesn't help, then try the following:
    - stop the device manager
    - Remove c:\Docement and Settings\<your User>\javame-sdk folder.
    - Ran the device manager from <SDK>/bin directory
    - try to debug again.
    Did you tried to change port 51307 to another.
    Early access build had some problems with device manager, I hope that final release will be better :)
    BR,
    Igor

  • Error while trying to debug on windows mobile 6.1  with j2me SDK 3.0 ea

    Hi,
    I tried to debug a simple application today. It works fine with the emulator but debug fails to connect to the device.
    I followed the steps described in the userguide of 3.0.
    host operating system: windows xp sp3
    device: htc touch pro
    device operatiing system: windows mobile 6.1 professional
    The device is listed in the device selector of the SDK as Touch_Pro
    The device is connected and active sync is running (i can explore the phone using windows explorer)
    sun-java-cldc-emu.cab has been installed on the device and is running
    When i try to debug the application from the SDK or netbeans 6.5(added 3.0ea as a platform) i get the following error:
    Starting emulator with port number 51307
    Cannot create device connection: Failed to connect to device 9!
    Result: 1
    I tried setting the loglevel to DEBUG in log4j config of the SDK, but thats it.
    Are there any other settings i can change to get more detailed output?
    Where do you report bugs/feedback for j2me SDK 3.0 ea?
    regards,
    dominikg
    Edited by: dominikg on Dec 11, 2008 8:36 AM
    -- changed topic title to 'error' instead of 'howto'
    -- added more specific questions

    Hi dominikg,
    At first, You can try to restart the device-manager from system tray.
    If it doesn't help, then try the following:
    - stop the device manager
    - Remove c:\Docement and Settings\<your User>\javame-sdk folder.
    - Ran the device manager from <SDK>/bin directory
    - try to debug again.
    Did you tried to change port 51307 to another.
    Early access build had some problems with device manager, I hope that final release will be better :)
    BR,
    Igor

  • How to debug with EJB+Servlet+J2ME at the same time?

    I am setting up an environment to compile Sun's Smart Ticket J2ME application. However, it run with application exception in the servlet or EJB. I tried to debug. But if I debug the servlet with Embedded AS in JDeveloper, I cannot debug the EJB since the EJB cannot deployed to the embedded AS. (EJB and Servlet must be co-existed in the same AS, at least using same JNDI)
    So is there any good approach to debug?
    email: [email protected]

    Hi Marvin,
    If the EJB cannot be deployed to the embedded AS, then you should probably use remote debugging to debug the servlet and EJB in the stand-alone AS.
    Look in the Help for topics about remote debugging the OC4J application server. (I'd give you the exact topic title, but I'm at home for the holidays and I don't have the latest JDev on this machine.)
    The Help topic describes it in more details, but the basic steps are as follows:
    1. Launch the AS in debug mode by inserting some debugging options on the command line used to start up the AS.
    If you are using OJVM, then the debugging options are
    -XXdebug,port4000,detached
    If you are using another JVM (for example HotSpot), then the debugging options are
    -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=4000,suspend=n
    2. Set your project for remote debugging by checking the Remote Debugging checkbox on the Debugging - Remote panel of the Project Settings dialog. Also you should select the "Attach to OJVM" radio button if you are using OJVM or the "Attach to JPDA" radio button if you are using another JVM (for example HotSpot).
    3. Click the debug button in JDev and enter the host and port where the AS is running (leave host blank if the AS is on the same machine as J[i]Long postings are being truncated to ~1 kB at this time.

  • J2ME toolkit (midlet suit debugging problem)

    Hi,
    I installed the SUN's J2ME wireless toolkit and made all the necessary configurations. I can run my midlet suit using any emulator. I can deploy my project into a jad file.
    However, I cannot debug my project.
    When I try to debug using any emulator I get:
    "KVM not ready" message and I'm stuck.
    Did anybody experience this issue before?
    Thanks

    It probably comes from the sequence you use to start debugger and debuggee. A MIDlet Suite will necessary be remote debugged. Please see the viewlets at http://otn.oracle.com/products/jdev/htdocs/partners/addins/exchange/j2me/content.html, scroll at the bottom of the page, and click "Dbug the MIDlet Suite".
    Please feel free to ping me directly at [email protected] if you need more info.

  • Debugging j2me applications

    I am wondering what people are using to debug j2me apps. I am using the wireless toolkit to build and run apps right now. I tried to use the ktoolbar debug feature, but it looks like that sets up for a remote debug session with who knows what. Also the default port 5000 was in use, but that should be easy to change.
    I would like to use netbeans, but am not sure how to integrate the wireless tookit into it.
    Can someone suggest some good options for debugging, as well as for j2me ide's etc.
    Thanks
    Justin

    I just recently started playing around with J2ME so I may not be the best person to answer this question, however, I'll throw in my 2 cents.
    If you grab the new 4.0 beta version of netbeans along with the mobility package, you should have an easy time running and debugging your J2ME apps. Follow the instructions on the site on how to set up the mobility package.

  • Send email from j2me through servlet

    Hi people,
    i hope you can help me because i am new in network programming.
    I am trying to send email from j2me to googlemail account I have 2 classes EmailMidlet (which has been tested with wireless Toolkit 2.5.2 and it works) and the second class is the servlet-class named EmailServlet:
    when i call the EmailServlet, i get on the console:
    Server: 220 mx.google.com ESMTP g28sm19313024fkg.21
    Server: 250 mx.google.com at your service
    this is the code of my EmailServlet
    import java.io.*;
    import java.net.Socket;
    import java.net.UnknownHostException;
    import java.text.*;
    import java.util.Date;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class EmailServlet extends HttpServlet {
       public void doPost(HttpServletRequest request, HttpServletResponse response)
             throws IOException, ServletException {
          System.out.println("____emailservlet.doPost");
          response.setContentType("text/plain");
          PrintWriter out = response.getWriter();
          System.out.println("______________________________");
          out.println();
          String to = request.getParameter("to");
          System.out.println("____________________________to" + to);
          String subject = request.getParameter("subject");
          String msg = request.getParameter("msg");
          // construct an instance of EmailSender
          System.out.println("servlet_to" + to);
          send("[email protected]", to, subject, msg);
          out.println("mail sent....");
       public void send(String from, String to, String subject, String msg) {
          Socket smtpSocket = null;
          DataOutputStream os = null;
          DataInputStream is = null;
          try {
             smtpSocket = new Socket("smtp.googlemail.com", 25);
             os = new DataOutputStream(smtpSocket.getOutputStream());
             is = new DataInputStream(smtpSocket.getInputStream());
          } catch (UnknownHostException e) {
             System.err.println("Don't know about host: hostname");
          } catch (IOException e) {
             System.err
                   .println("Couldn't get I/O for the connection to: hostname");
          if (smtpSocket != null && os != null && is != null) {
             try {
                os.writeBytes("HELO there" + "\r\n");
                os.writeBytes("MAIL FROM: " + from + "\r\n");
                os.writeBytes("RCPT TO: " + to + "\r\n");
                os.writeBytes("DATA\r\n");
                os.writeBytes("Date: " + new Date() + "\r\n"); // stamp the msg
                                                    // with date
                os.writeBytes("From: " + from + "\r\n");
                os.writeBytes("To: " + to + "\r\n");
                os.writeBytes("Subject: " + subject + "\r\n");
                os.writeBytes(msg + "\r\n"); // message body
                os.writeBytes(".\r\n");
                os.writeBytes("QUIT\r\n");
                // debugging
                String responseLine;
                while ((responseLine = is.readLine()) != null) {
                   System.out.println("Server: " + responseLine);
                   if (responseLine.indexOf("delivery") != -1) {
                      break;
                os.close();
                is.close();
                smtpSocket.close();
             } catch (UnknownHostException e) {
                System.err.println("Trying to connect to unknown host: " + e);
             } catch (IOException e) {
                System.err.println("IOException: " + e);
       } 1.when i print "to" in EmailServlet also:
      String to = request.getParameter("to");
          System.out.println("____________________________to" + to);  it show null on the console :confused:
    2. ist this right in case of googlemail.com?
      smtpSocket = new Socket("smtp.googlemail.com", 25);  I would be very grateful if somebody can help me.

    jackofall
    Please don't post in old threads that are long dead. When you have a question, please start a topic of your own. Feel free to provide a link to an old thread if relevant.
    I'm locking this thread now.
    db

  • How to connect the EJB webservices using kxmlrpc in J2ME

    Hi all,
    I am trying to develope a program in J2ME using kxmlrpc. I am having the EJB web serivce as server and its working fine , the webservice coding is as follows and i am using Sun application sever for web services
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.util.ArrayList;
    import javax.ejb.EJBException;
    import javax.ejb.Stateless;
    import javax.jws.WebService;
    import javax.jws.WebMethod;
    import javax.jws.WebParam;
    import javax.sql.*;
    @Stateless()
    @WebService()
    public class test1 {
    /* Sample Web Service Operation */
    @WebMethod(operationName="sample_operation")
    public String operation(@WebParam(name="param_name") String param) {
    // implement the web service operation here
    System.out.println("test the xml rpc");
    param="helloworld";
    return param;
    Any body please help me how to call this web sevices method in J2ME client using kxmlrpc, i tried but it shows execption. And i want to know which url i want ot give inthe XmlRpcclient() and what are all the parameters to be given in xmlrpcclient.execute(). Anybody please help me on this and my kxml coding is as follows:
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.io.*;
    import java.io.*;
    import java.util.*;
    import org.kxmlrpc.*;
    public class kxmlrpc_demo extends MIDlet implements CommandListener {
    private List list;
    private Command exitCommand;
    private String[] menuItems;
    private Display display;
    private Alert response;
    private XmlRpcClient xmlrpc;
    private Vector params, xmlArray;
    public kxmlrpc_demo() {
    //Initialize the User Interface
    menuItems = new String[] {"Timestamp", "Randomizer", "AddressBook"};
    list = new List( "Select a service", List.IMPLICIT, menuItems, null );
    exitCommand = new Command( "Exit", Command.EXIT, 1 );
    response = new Alert("Service Return", null, null, AlertType.INFO);
    response.setTimeout( Alert.FOREVER );
    //Add commands
    list.addCommand( exitCommand );
    list.setCommandListener( this );
    //obtain a reference to the device's UI
    display = Display.getDisplay( this );
    }//end MyMidlet()
    public void startApp() {
    display.setCurrent( list );
    }//end startApp()
    public void pauseApp() {
    }//end pauseApp()
    public void destroyApp( boolean unconditional ) {
    //clean up
    list = null;
    exitCommand = null;
    display = null;
    }//end destroyApp
    public void commandAction( Command com, Displayable dis ) {
    if ( dis == list && com == List.SELECT_COMMAND ) {
    switch( list.getSelectedIndex() )
    case 0:
    try
    xmlrpc = new XmlRpcClient( "http://localhost:4116/test1Service/test1?Tester" );
    params = new Vector();
    String serverTime = (String) xmlrpc.execute( "sysTime.getSystemTime", params );
    response.setString( serverTime.toString() );
    display.setCurrent( response );
    catch ( Exception ex )
    response.setString( ex.toString() );
    ex.printStackTrace(); // DEBUG
    display.setCurrent( response );
    }//end try/catch
    break;
    case 1:
    try
    xmlrpc = new XmlRpcClient( "http://localhost:4116/test1Service/test1?Tester" );
    System.out.println("url"+xmlrpc.getURL());
    params = new Vector();
    xmlArray = new Vector();
    xmlArray.addElement( "param_name" );
    // xmlArray.addElement( "5" );
    // xmlArray.addElement( "12" );
    params.addElement( xmlArray );
    String serverTime = (String) xmlrpc.execute( "sample-operation", params);
    System.out.println("servertime: "+serverTime);
    response.setString( serverTime.toString() );
    display.setCurrent( response );
    catch ( Exception ex )
    response.setString( ex.toString() );
    ex.printStackTrace(); // DEBUG
    display.setCurrent( response );
    }//end try/catch
    break;
    case 2:
    response.setString( "Not implemented yet." );
    display.setCurrent( response );
    break;
    }//end switch( list.getSelectedIndex() )
    else if ( com == exitCommand ) {
    destroyApp( true );
    notifyDestroyed();
    }//end if ( dis == list && com == List.SELECT_COMMAND )
    }//end CommandAction( Command, Displayable )
    }//end MyMidlet
    Thanks in advance.
    regards
    Senthil K

    Any body please help me on this. I am really struggling on this

  • Problem while building jsp/servlet  in j2me

    Hi friends,
    I'm building Servlet in j2me.When i run this Servlet on web browser the Servlet running fine.But while in application when i used
    conn = (HttpConnection)Connector.open( url );
    where url = "http://localhost:8080/servlets-examples/hits"
    It hangs ,the debugger stuck at this method .It didn't throw any Exception also.
    Whats the problem?how could i resolve this issue?
    Note:
    I've used the follwing tutorial
    http://developers.sun.com/techtopics/mobility/midp/articles/tutorial2/
    to build servlet in MIDlet.
    Regards,
    Sachin Warang.

    hi friends,
    I debug the code while doing so i realised that it throwing SecurityException .So edit the preferences>
    where in security i've change it to untrusted and restore the settings.
    After clicking on OK .
    The application works fine.
    Regards,
    Sachin Warang.

  • Looking for J2ME MP3 Player Code

    Hello,
    I just started writing a J2ME MP3 player application. The MP3 files are stored in the device's flash memory, not streamed through the air. The user interface would be simple and device-independent. I am searching for source code that I can learn from or modify. Is there a J2ME MP3 player open-source code?
    T.I.

    i've got one but i will never give you the code !!!!
    i can help you with your code (errors, debugging,...) and give you some tips to start:
    1- search on google
    2- start coding
    3- test your app and come here when you will have a problem with the Manager.createPlayer.....
    good luck !

  • J2me with servlet

    hello experts
    Sir i want to call a servlet program in a j2me program i have found a program related to my requirment on
    net. But there is a problem that when i run as it is program according to net i give url="http://www.mycgiserver.com/servlet/corej2me.WebsiteDemo_CallServletGET"on my toolkit it is runing correct,
    but when i give url according to my system for servlet like "http://localhost:8000/servlets/CallServletGET"
    when i click submit button for calling to servlet
    then its it is giving error that "Unable to read data" . my coding is like this
    if (http.getResponseCode() == HttpConnection.HTTP_OK)
    iStrm = http.openInputStream();
    // 2) Get header information - none
    // 3) Get body (data)
    int length = (int) http.getLength();
    if (length > 0)
    byte servletData[] = new byte[length];
    iStrm.read(servletData);
    // Update the string item on the display
    fmMain.append("You passed to the servlet: \n" + new String(servletData));
    else
    fmMain.append("Unable to read data");

    When you post code, please use[code] and [/code] tags as described in Formatting Help on the message entry page. It makes it much easier to read.
    Please post the full error. If this is running on an emulator, please post the stack trace ( throwable.printStackTrace() ).
    Which phone is it running on? (Suns WTK, Nokia, etc?)
    Is the Servlet being called (as some debug lines into the servlet ([url http://java.sun.com/j2se/1.5.0/docs/api/java/util/logging/package-frame.html]java.util.logging ). )

  • Debugging bluetooth applications

    hi,
    im trying to debug the BluetoothDemo (J2ME Wireless Toolkit 2.2, client/server image download) but i dont know how. im using studio mobility 6. the application is running fine but no matter where i set a breakpoint. - the debugger does not stop at all. all my other applications run fine with the debugger...
    any ideas how to debug properly?
    regards,
    c.

    Use NetBeans 4.0 (see http://www.netbeans.org/, you can find a tutorial on the title page).
    It is now RC2 about a week until final release.

Maybe you are looking for

  • Games for MBP 13

    Dear users, Could you tell me wether there are any action games like Prince of Persia for MBP 13''? I have found only GTA. Thanx!

  • Firefox Crashes in less than 5 seconds after opening it, randomly.

    Here's my problem. When I load firefox, 3 to 4 times in a row it will open, and then simply vanish in less than 5 seconds. Then the next time I try to open it - It works. WTF? It won't even give me a Crash screen, It just vanishes. Sometimes even, It

  • Runtime analysis for a Method

    Hi, Need some help on how to find the Runtime Analysis for a method in Class, as i am getting some performance issues with the statements in the method.  Please let me know ASAP about this Runtime Analysis for a method in a class

  • Will there be a software upgrade for old iPhones?

    Hello. Does anyone know if there will be a significant upgrade in the software for the old iPhone? Or should I just buy the new 3G?

  • My iphon 4 screen broken, how to repair in UAE

    I bought iphone4 in Dubai, United Arab Emirates one month ago.  The screen was broken when it fell down the ground. how to find the place to repair?: