0
Not a bug

java.lang.NoClassDefFoundError on launch

Bill 7 years ago updated 7 years ago 3

I've had a running instance of 2.0 for some time. I stopped the server today, downloaded the 2.1 update, and created a new folder. When I tried to launch with:


java -jar Ubooquity.jar

I get the following error below. Note also I tried going back to my old folder and launch that and I'm getting the same error. You also linked to this file:


http://vaemendis.net/ubooquity/downloads/special/SimpletofMars/Ubooquity.jar


in another thread. Same error. 


Also, I am unable to double-click the file. It just launches the Archiver. I right-clicked the file to try open-with java but didn't see it as an option, so I did:


apt-get install openjdk-8-jdk


I can now right-click an select Open With JRE but it just spins and does nothing. Running the 'java -jar' command also gives the same error. Any ideas? 


Here's the error: 


pi@raspberrypi:~/ubooquity $ java -jar Ubooquity.jar 
20170714 14:53:37 [main] INFO  com.ubooquity.Ubooquity - Running with the following parameters - headless: false, libraryport: -1, adminport: -1, remoteadmin: false, host: null, debug: false, execdir: /home/pi/ubooquity
20170714 14:53:37 [main] INFO  com.ubooquity.Ubooquity - #############################
20170714 14:53:37 [main] INFO  com.ubooquity.Ubooquity - #     Starting Ubooquity    #
20170714 14:53:37 [main] INFO  com.ubooquity.Ubooquity - #############################
20170714 14:53:37 [main] INFO  com.ubooquity.Ubooquity - Java version: 1.8.0_40-internal
20170714 14:53:37 [main] INFO  com.ubooquity.Ubooquity - Java vendor: Oracle Corporation
20170714 14:53:37 [main] INFO  com.ubooquity.Ubooquity - Max heap size available: 224 MB
20170714 14:53:37 [main] INFO  com.ubooquity.Ubooquity - OS name: Linux
20170714 14:53:37 [main] INFO  com.ubooquity.Ubooquity - OS version: 4.9.35-v7+
20170714 14:53:37 [main] INFO  com.ubooquity.Ubooquity - OS architecture: arm
20170714 14:53:38 [main] INFO  com.ubooquity.Ubooquity - Loading local version info
20170714 14:53:38 [main] INFO  com.ubooquity.Ubooquity - Ubooquity 2.1.0 built on 2017-06-18 at 17:14
20170714 14:53:38 [main] INFO  com.ubooquity.Ubooquity - Creating application folders
20170714 14:53:38 [main] INFO  com.ubooquity.Ubooquity - Loading preferences
20170714 14:53:43 [main] INFO  org.eclipse.jetty.util.log - Logging initialized @16526ms to org.eclipse.jetty.util.log.Slf4jLog
java.lang.NoClassDefFoundError: javafx/fxml/Initializable
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at com.ubooquity.e.a.d(SourceFile:597)
at com.ubooquity.e.a.loadClass(SourceFile:962)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.ubooquity.a.<init>(SourceFile:19)
at com.ubooquity.Ubooquity.main(SourceFile:246)
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:483)
at com.ubooquity.e.a.a(SourceFile:823)
at com.ubooquity.Launcher.main(SourceFile:10)
Caused by: java.lang.ClassNotFoundException: Failure to load: javafx.fxml.Initializable
at com.ubooquity.e.a.loadClass(SourceFile:992)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 13 more
20170714 14:53:43 [Thread-2] INFO  com.ubooquity.b - Stopping internal server...
20170714 14:53:43 [Thread-2] INFO  com.ubooquity.data.feeder.a - Aborting content scan...
20170714 14:53:44 [Thread-2] ERROR com.ubooquity.b - Error while stopping internal server
java.lang.NullPointerException: null
at com.ubooquity.d.e.a(SourceFile:101) ~[Ubooquity.jar:2.1.0]
at com.ubooquity.b.c(SourceFile:112) ~[Ubooquity.jar:2.1.0]
at com.ubooquity.Ubooquity.C(SourceFile:216) [Ubooquity.jar:2.1.0]
at com.ubooquity.Ubooquity$$Lambda$3/17672517.run(Unknown Source) [Ubooquity.jar:2.1.0]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_40-internal]
20170714 14:53:44 [Thread-2] INFO  com.ubooquity.b - Internal server stopped
20170714 14:53:44 [Thread-2] INFO  com.ubooquity.Ubooquity - Ubooquity has closed.


Update:


Ran 1.10.1 just fine. Seems to be isolated to v2 for me. As this was working for me last week, I know I could just reinstall the OS, but I rather try to figure this out. 


Tried updating my Java to 1.8.0_131, but still getting the same error.

Not a bug

The problem is that the Java version you are using does not contain the UI framework used by Ubooquity.

To fix that, either:

  • use the official Oracle JRE (or JDK) instead of OpenJDK
  • try using the "--headless" command line option that will disable the desktop UI, allowing Ubooquity to run without these libraries (no guarantee of success though).

In any case I recommend using the Oracle version of Java.

Just wanted to follow up that using --headless did the trick, which is also why it had been working previously. Thanks for the help!