B4J Question jShell crashed

Starchild

Active Member
Licensed User
Longtime User
Running on Ubuntu, sometimes calling command using jShell causes the crash. I'm not sure why. Doesn't happen all the time.

My main program calls the "service" Linux command then exits itself (ExitApplication).
Using SHL.Run(-1) ' to execute the service command.

Tried the ExitApplication, immediately following the SLH.Run(-1), delayed by a timer, and even using callsubdelayed back to "Main". All appear to have the same intermittent crash.

The returned error is,
B4X:
main._appstart (java line: 441)
java.lang.RuntimeException: java.lang.NoClassDefFoundError: anywheresoftware/b4j/objects/Shell
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:108)
    at anywheresoftware.b4a.objects.Timer$TickTack$1.run(Timer.java:118)
    at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:30)
    at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:26)
    at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:136)
    at b4j.baseinterface.main._appstart(main.java:441)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:79)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:70)
    at b4j.baseinterface.main.main(main.java:29)
Caused by: java.lang.NoClassDefFoundError: anywheresoftware/b4j/objects/Shell
    at b4j.baseinterface.barrettcommsclass._start_baseinterfaceexecutor(barrettcommsclass.java:1974)
    at b4j.baseinterface.barrettcommsclass._restarttimer_tick(barrettcommsclass.java:1593)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:79)
    ... 12 more
Caused by: java.lang.ClassNotFoundException: anywheresoftware.b4j.objects.Shell
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 19 more

Unfortunately, the error report was truncated.

Does anyone have an idea where I should look?
 

DonManfred

Expert
Licensed User
Longtime User
ExitApplication, immediately following the SLH.Run(-1)
This is the problem. You should not do anything after the exitApplication

From the Online-Help:
exitapp018.png
 
Last edited:
Upvote 0

Starchild

Active Member
Licensed User
Longtime User
Yes. #MergeLibraries set to True

As Release, the same program usually works OK.
This error is intermitant.
I can't determine any differences in the operational circumstances.

I am also redirecting the log to a file.
code came from b4x.com
can't find the site reference now.
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Upvote 0

jmon

Well-Known Member
Licensed User
Longtime User
Upvote 0

Similar Threads

Top