4 Replies Latest reply: Apr 16, 2013 10:58 AM by Andy Tael-Oracle RSS

    Q;Running my midlet does nothing

    Andy Tael-Oracle
      Hello (again),
      I have just installed my midlet on a Raspberry Pi (ME 3.3) using the installMidlet.sh command, works fine! But then am I trying to run the midlet and it doesn' run or am I missing something completely (again!)?

      It looks like it is installed:
      pi@raspberrypi ~/java_me_3.3/bin $ sudo ./listMidlets.sh
      argv[1] = runMidlet
      argv[2] = -1
      argv[3] = com.sun.midp.scriptutil.SuiteLister
      Command line parameters are passed.
      javacall_event_initialize: events system initialized
      Events system initialized.
      Time system initialized.
      JavaTask thread initialized.
      Starting JavaTask
      Suite: 2
        Name: TMP36rpi
        Version: 1.0
        Vendor: Vendor
        MIDlets:
          IMlet: tmp36rpi.IMlet
      Finishing JavaTask
      But when trying to run the midlet, I get this back which might be normal but I would expect the output log from my application (which I see if I execute the midlet from NetBeans and connects using the usertest.sh script):
      pi@raspberrypi ~/java_me_3.3/bin $ sudo ./runMidlet TMP36pi
      argv[1] = TMP36pi
      Command line parameters are passed.
      javacall_event_initialize: events system initialized
      Events system initialized.
      Time system initialized.
      JavaTask thread initialized.
      Starting JavaTask
      Finishing JavaTask
      pi@raspberrypi ~/java_me_3.3/bin $
      --Andy                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
        • 1. Re: Q;Running my midlet does nothing
          Andrey.P-Oracle
          Hi! :)

          Unfortunately looks like this is another implementation issue together with the doc side.
          In order to run your application from command line could you please use the following command:
          ./run.sh -1 com.sun.midp.appmanager.AmsLauncher -launcherMode <suite-id> <midlet-class-name>
          Both <suite-id> and <midlet-class-name> are according to what you get with ./listMidlets.sh
          Please note that the Java runtime will stay running even after application has quit. In addition, in this mode the watchdog part of DAAPI will not reboot the runtime.

          Regards,
          Andrey
          • 2. Re: Q;Running my midlet does nothing
            Andy Tael-Oracle
            Andrey,
            Sorry but no no luck! A different error though.
            pi@raspberrypi ~/java_me_3.3/bin $ sudo ./listMidlets.sh
            argv[1] = runMidlet
            argv[2] = -1
            argv[3] = com.sun.midp.scriptutil.SuiteLister
            Command line parameters are passed.
            javacall_event_initialize: events system initialized
            Events system initialized.
            Time system initialized.
            JavaTask thread initialized.
            Starting JavaTask
            Suite: 2
              Name: TMP36rpi
              Version: 1.0
              Vendor: Vendor
              MIDlets:
                IMlet: tmp36rpi.IMlet
            Finishing JavaTask
            pi@raspberrypi ~/java_me_3.3/bin $
            And then i try the following:
            pi@raspberrypi ~/java_me_3.3/bin $ sudo ./run.sh -1 com.sun.midp.appmanager.AmsLauncher -launcherMode 2 TMP36rpi
            argv[1] = runMidlet
            argv[2] = -1
            argv[3] = com.sun.midp.appmanager.AmsLauncher
            argv[4] = -launcherMode
            argv[5] = 2
            argv[6] = TMP36rpi
            Command line parameters are passed.
            javacall_event_initialize: events system initialized
            Events system initialized.
            Time system initialized.
            JavaTask thread initialized.
            Starting JavaTask
            java.lang.ClassNotFoundException: TMP36rpi
             - java.lang.Class.forName(), bci=0
             - com.sun.midp.main.CldcMIDletLoader.newInstance(), bci=1
             - com.sun.midp.midlet.MIDletStateHandler.createMIDlet(), bci=61
             - com.sun.midp.midlet.MIDletStateHandler.createAndRegisterMIDlet(), bci=17
             - com.sun.midp.midlet.MIDletStateHandler.startSuite(), bci=22
             - com.sun.midp.main.AbstractMIDletSuiteLoader.startSuite(), bci=38
             - com.sun.midp.main.CldcMIDletSuiteLoader.startSuite(), bci=5
             - com.sun.midp.main.AbstractMIDletSuiteLoader.runMIDletSuite(), bci=121
             - com.sun.midp.main.AppIsolateMIDletSuiteLoader.main(), bci=26
            My JAR file looks like this:
            pi@raspberrypi ~/apps $ unzip -v TMP36rpi.jar
            Archive:  TMP36rpi.jar
             Length   Method    Size  Cmpr    Date    Time   CRC-32   Name
            --------  ------  ------- ---- ---------- ----- --------  ----
                   0  Stored        0   0% 2013-04-12 14:04 00000000  META-INF/
                 273  Defl:N      187  32% 2013-04-12 14:04 61d1be90  META-INF/MANIFEST.MF
                   0  Stored        0   0% 2013-04-12 14:04 00000000  tmp36rpi/
                1196  Defl:N      689  42% 2013-04-12 14:04 c64dfeff  tmp36rpi/IMlet.class
                1558  Defl:N      907  42% 2013-04-12 14:04 ef7dffc1  tmp36rpi/MCP3008Checker.class
                4098  Defl:N     2034  50% 2013-04-12 14:04 167252e6  tmp36rpi/TMP36.class
            --------          -------  ---                            -------
                7125             3817  46%                            6 files
            pi@raspberrypi ~/apps $
            1. Is there something I need to do to my application to make it run?
            2. Is there documentation about the run.sh command e.g. which parameters and what they do?

            Thanks
            Andy
            • 3. Re: Q;Running my midlet does nothing
              Andrey.P-Oracle
              Hi Andy,

              Your command shall look like this:
              sudo ./run.sh -1 com.sun.midp.appmanager.AmsLauncher -launcherMode 2 tmp36rpi.IMlet
              The last word is a fully qualified name of main class of your application, not the application name.

              Width regards to your questions:
              1. Is there something I need to do to my application to make it run?
              Nothing special. If it runs via CLI it should run the same using linux console
              2. Is there documentation about the run.sh command e.g. which parameters and what they do?
              No, there is not. Actually run.sh is an internal tool which is used by other scripts in the bin folder. The problem is that there is no proper script to run specific application, so that what I've provided to you is actually the command line which should go into that missing script

              Regards,
              Andrey
              • 4. Re: Q;Running my midlet does nothing
                Andy Tael-Oracle
                Ahh, my bad!

                Thanks a lot for your help
                Andy