/legato/systems/current/lib/legato.jar No such file

Hi

I’m trying to run the legato javaHelloWorld example program on a mangOH device. I compile it with this command:

$ mkapp -v -t wp85 javaHelloWorld.adef -s ${LEGATO_ROOT}/components

which works fine. Then I push it to the mangOH like so:

$ instapp javaHelloWorld.wp85.update 192.168.2.2 Applying update from file 'javaHelloWorld.wp85.update' to device at address '192.168.2.2'. Unpacking package: 0% Applying update: 100% ++++++++++++++++++++++++++++++++++++++++++++++++++ SUCCESS Done

However, the program can’t be run on the mangOH:

root@swi-mdm9x15:~# app start javaHelloWorld Starting app 'javaHelloWorld'... There was an error. Application 'javaHelloWorld' could not be started.

root@swi-mdm9x15:~# logread -f | grep "Hello" Jan 8 21:18:19 swi-mdm9x15 user.info Legato: INFO | supervisor[560]/supervisor T=main | sandbox.c ImportDir() 740 | Imported directory '/legato/systems/current/apps/javaHelloWorld/read-only/bin' into sandbox '/tmp/legato/sandboxes/javaHelloWorld/bin'. Jan 8 21:18:19 swi-mdm9x15 user.info Legato: INFO | supervisor[560]/supervisor T=main | sandbox.c ImportDir() 740 | Imported directory '/legato/systems/current/apps/javaHelloWorld/read-only/bin' into sandbox '/tmp/legato/sandboxes/javaHelloWorld/bin'. Jan 8 21:18:19 swi-mdm9x15 user.info Legato: INFO | supervisor[560]/supervisor T=main | sandbox.c ImportFile() 693 | Imported file '/dev/log' into sandbox '/tmp/legato/sandboxes/javaHelloWorld/dev/log'. Jan 8 21:18:19 swi-mdm9x15 user.info Legato: INFO | supervisor[560]/supervisor T=main | sandbox.c ImportFile() 693 | Imported file '/dev/null' into sandbox '/tmp/legato/sandboxes/javaHelloWorld/dev/null'. Jan 8 21:18:19 swi-mdm9x15 user.info Legato: INFO | supervisor[560]/supervisor T=main | sandbox.c ImportFile() 693 | Imported file '/dev/zero' into sandbox '/tmp/legato/sandboxes/javaHelloWorld/dev/zero'. Jan 8 21:18:19 swi-mdm9x15 user.info Legato: INFO | supervisor[560]/supervisor T=main | sandbox.c ImportDir() 740 | Imported directory '/legato/systems/current/apps/javaHelloWorld/read-only/lib' into sandbox '/tmp/legato/sandboxes/javaHelloWorld/lib'. Jan 8 21:18:19 swi-mdm9x15 user.info Legato: INFO | supervisor[560]/supervisor T=main | sandbox.c ImportDir() 740 | Imported directory '/legato/systems/current/apps/javaHelloWorld/read-only/lib' into sandbox '/tmp/legato/sandboxes/javaHelloWorld/lib'. Jan 8 21:18:19 swi-mdm9x15 user.info Legato: INFO | supervisor[560]/supervisor T=main | sandbox.c ImportFile() 693 | Imported file '/lib/ld-linux.so.3' into sandbox '/tmp/legato/sandboxes/javaHelloWorld/lib/ld-linux.so.3'. Jan 8 21:18:19 swi-mdm9x15 user.err Legato: =ERR= | supervisor[560]/supervisor T=main | sandbox.c ImportFile() 689 | Couldn't import '/legato/systems/current/lib/legato.jar' into sandbox at '/tmp/legato/sandboxes/javaHelloWorld/lib/legato.jar'. No such file or directory Jan 8 21:18:19 swi-mdm9x15 user.info Legato: INFO | supervisor[560]/supervisor T=main | sandbox.c sandbox_Remove() 1450 | 'javaHelloWorld' sandbox removed. Jan 8 21:18:19 swi-mdm9x15 user.err Legato: =ERR= | supervisor[560]/supervisor T=main | app.c app_Start() 917 | Could not create sandbox for application 'javaHelloWorld'. This application cannot be started.

The relevant line in from the above logread printout:

Jan  8 21:18:19 swi-mdm9x15 user.err Legato: =ERR= | supervisor[560]/supervisor T=main | sandbox.c ImportFile() 689 | Couldn't import '/legato/systems/current/lib/legato.jar' into sandbox at '/tmp/legato/sandboxes/javaHelloWorld/lib/legato.jar'. No such file or directory

Legato seems to be looking for a jar file ( /legato/systems/current/lib/legato.jar ) on the mangOH that isn’t there. There is a file called legato.jar in the ubuntu VM that came with legato. It’s saved under
/home/legato/legato/packages/legato.framework.16.4.0.I201606090927/resources/legato/build/wp85/framework/lib/legato.jar . So I figured I would put this on the mangOH /legato/systems/current/lib/.
But that path is a “Read-only file system” apparently.

Has anyone else had this problem?
Is it possible to tell the mkapp command to look for the legato.jar in other places?

This should work out of the box. This legato.jar library should be already on the device, assuming that the installed legato version includes it.
Please could you check what is the Legato version running on your device?