8 Replies Latest reply on May 24, 2010 4:19 PM by 843851

    Problem with emulator

      Hi, i have a problem with the emulator ( on one account of mac os x, other works ok ).
      The Java ME SDK 3.0 yesterday worked, today doesn't.
      When i try to run something the IDE windows looses focus, builds the app ok, but no emulator windows appears.

      when i run on the terminal I get:
      I have this problem trying to run the emulator... from Sun Java ME SDK 3 the emulator windows doesn't even show... the IDE loses focus and nothing else happens...

      This is from executing directly:
      bash-3.2# ./emulator -Xdescriptor:/Users/jorge/WorkStation/BTapp1/dist/BTapp1.jad
      Device name is not set. Using -Xdevice:DefaultCldcPhone1 option.
      Hint: Use -Xquery argument to see all supported devices.

      Installing suite from:

      *** Error ***
      Failed to execute MIDlet suite!
      java.lang.RuntimeException: Communication channel has been closed!

      Again, this works in the other account, but i have all docs, and other stuff here :(
      I've disabled the firewall, i've tried changing the port on the device manager configuration... to no avail.

      any ideas?
      Thanks in advance.
        • 1. This Thread is now moved
          Note: This thread was originally posted in the [Sun Java Wireless Toolkit|http://forums.sun.com/forum.jspa?forumID=82] forum, but moved to this forum for closer topic alignment.
          • 2. Re: Problem with emulator
            No one using Sun ME SDK 3 on OS X that can help?

            It's not the settings in the application support folder, it must be something else that is user specific but i have no idea where the developers may be writing.

            • 3. Re: Problem with emulator
              I have answered your question at javame sdk blog. Copying below:
              I need more info from log files.

              --- copy from blog ----

              Hi Jorge,
              pls look at blog entry about log files here http://blogs.sun.com/javamesdk/entry/where_are_my_logs
              You can change verbosity of logging changing INFO level to DEBUG or TRACE in log4j.xml in toolkit-lib/emulator/generic/core/conf
              Then send me device log file to tomas.brandalik@sun.com

              You can do test launch of emulator and wipe out all initialization files:
              1. stop all emulators stop device-manager
              2. delete /<user home>/Library/Application Support/javame-sdk
              -optionally you can change verbosity of logging now
              3. open console and go to /Applications/Java ME SDK 3.0.app/Contents/Resources/bin. Run device-manager. Does it start? Does it create structures in /<user home>/Library/Application Support/javame-sdk ?
              4. open another console in /Applications/Java ME SDK 3.0.app/Contents/Resources/bin and run emulator -Xjam. Does emulator start?

              hope this helps

              Posted by Tomas Brandalik on May 19, 2010 at 09:33 AM CEST #
              • 4. Re: Problem with emulator
                Hi, thanks for the reply.

                I had already done what was on the blog. Did it again and changed INFO to DEBUG.

                Ran the device-manager and it created the folders and devices.
                After i ran the emulator (emulator -Xjam) and nothing happens. Actually, it tries to start and the disappears and in the logs i get:

                "[   2020] ERROR - sun.kvem.tools.http.HttpServer - java.net.BindException: Address already in use java.net.BindException: Address already in use"

                (Keep in mind that with the other user i created i get no error and it runs on the same port but since i have everything in this user it's a pain...)

                I had seen this in my previous attempts to resolve the issue and i changed the port but will do it again.
                Went to:
                And changed in file system.properties:

                device-manager.object-registry.host: localhost
                device-manager.object-registry.port: 1999


                device-manager.object-registry.port: 1399

                checked to see if there was any device-manager process ( none existed, so ok...)

                now run again emulator -Xjam

                I was tailing the device-manager.log and did not see any errors, but nothing showed up and the command ./emulator -Xjam after this line in the log

                [   3238] INFO - un.jme.toolkit.bootstrap.Batch - Objects started

                finished ( i got the shell prompt again ).

                Going to try in the IDE.
                When i ran the IDE and the device manager was on the tray i got again the BindException as to the address being already in use. So:
                1. Quit IDE
                2. Quit device-manager from tray
                3. check processes (ok, not running)
                4. Start IDE again, so he starts the device-manager

                Result: Same error, device-emulator starts but in the IDE there are no devices on the Device Selector.

                I'm sending the logs by mail and posting this reply on the forum for followups

                Thanks for your help.... but still no luck.
                • 5. Re: Problem with emulator
                  tried also changing http server port.
                  now i dont get the error from the http server, but i get error from 1399 ( device-manager )...

                  when i start the IDE there are no devices. ( one note, while loading modules the deviece-manager shows up, and then another... one of them dies after a while )

                  when i try to execute emulator -Xjam (after closing device-manager ) nothing happens. its running for a while then i get the shell prompt again. While this is happening lots of lines are written on the log ( been tail -f it ), but i find no errors.

                  going a little crazy here...
                  • 6. Re: Problem with emulator
                    HttpServer is used to deploy midlets into emulator. You don't need to change the http.server port. If the port is taken device-manager tries another one and HttpServer starts usually correctly. You can see an info message "HttpServer started" in your log.
                    Only error I can see in the logs is "Address already in use" for device-manager.object-registry.port. In case of this error device-manager doesn't start because it can't communicate with the environment since its communication port is taken.

                    Check if device-manager is not runnig
                    ps aux | grep device-manager

                    Check if emulator VM is not running
                    ps aux | grep runMidlet

                    Ensure that "device-manager.object-registry.port" is not taken.
                    lsof -i -P | grep 1999 or 1399
                    When device manager is running port is in LISTEN state

                    run emulator -Xjam
                    device-manager starts automatically, emulator should start as well
                    Look at <userhome>/Library/Application Support/javame-sdk/3.0/work/3/device.log

                    If emulator didn't start there should be an error in the log.
                    • 7. Re: Problem with emulator
                      No errors in the log.

                      Device manager is running and in listen mode.

                      Emulator does not show up.

                      Last lines in the log

                      [   2832] INFO - bootstrap.ObjectGraphProcessor - Calculating order...
                      [   2832] INFO - bootstrap.ObjectGraphProcessor - Calculated order
                      [   2832] DEBUG - un.jme.toolkit.bootstrap.Batch - Instantiating StdinShutdown class: com.sun.jme.toolkit.util.isshutdown.InputStreamShutdown
                      [   2834] DEBUG - un.jme.toolkit.bootstrap.Batch - Registering object StdinShutdown
                      [   2834] INFO - un.jme.toolkit.bootstrap.Batch - Initializing objects...
                      [   2834] DEBUG - un.jme.toolkit.bootstrap.Batch - Initializing object StdinShutdown
                      [   2835] DEBUG - strap.BasicObjectConfiguration - Setting field inputStream
                      [   2835] DEBUG - strap.BasicObjectConfiguration - Setting field printStream
                      [   2836] DEBUG - strap.BasicObjectConfiguration - Setting field shutdownTriggerLatch
                      [   2836] DEBUG - strap.BasicObjectConfiguration - Setting field notificationMessage to Enter any text to exit. using class com.sun.jme.toolkit.propertyeditors.StringEditor
                      [   2836] INFO - un.jme.toolkit.bootstrap.Batch - Applying I18N
                      [   2837] INFO - un.jme.toolkit.bootstrap.Batch - Initialized objects
                      [   2837] INFO - un.jme.toolkit.bootstrap.Batch - Calling create() methods...
                      [   2837] INFO - un.jme.toolkit.bootstrap.Batch - Calling start() methods...
                      [   2837] DEBUG - un.jme.toolkit.bootstrap.Batch - Calling start on StdinShutdown
                      [   2837] DEBUG - un.jme.toolkit.bootstrap.Batch - Called start on StdinShutdown
                      [   2837] INFO - un.jme.toolkit.bootstrap.Batch - Objects started
                      • 8. Re: Problem with emulator
                        Sorry but I need whole log.