I am developing a java application that uses the UI4J library, it works great on my local pc (ubuntu 14.04), but when i create the executable jar and copy it to a virtual machine (also running ubuntu 14.04) i am getting this error:
Exception in thread "JavaFX Application Thread" java.lang.UnsatisfiedLinkError: /opt/jdk1.8.0_45/jre/lib/amd64/libjfxwebkit.so: libxslt.so.1: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1937)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1822)
at java.lang.Runtime.load0(Runtime.java:809)
at java.lang.System.load(System.java:1086)
at com.sun.glass.utils.NativeLibLoader.loadLibraryFullPath(NativeLibLoader.java:201)
at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:94)
at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:39)
at com.sun.webkit.WebPage.lambda$static$39(WebPage.java:127)
at com.sun.webkit.WebPage$$Lambda$66/754904897.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.webkit.WebPage.<clinit>(WebPage.java:126)
at javafx.scene.web.WebEngine.<init>(WebEngine.java:824)
at javafx.scene.web.WebEngine.<init>(WebEngine.java:811)
at javafx.scene.web.WebView.<init>(WebView.java:271)
at com.ui4j.webkit.WebKitBrowser$WebViewCreator.run(WebKitBrowser.java:238)
at com.sun.javafx.application.PlatformImpl.lambda$null$170(PlatformImpl.java:295)
at com.sun.javafx.application.PlatformImpl$$Lambda$52/826729279.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$171(PlatformImpl.java:294)
at com.sun.javafx.application.PlatformImpl$$Lambda$50/571777541.run(Unknown Source)
at com.sun.glass.ui.monocle.RunnableProcessor.runLoop(RunnableProcessor.java:77)
at com.sun.glass.ui.monocle.RunnableProcessor.run(RunnableProcessor.java:47)
at java.lang.Thread.run(Thread.java:745)
Exception in thread "JavaFX Application Thread" com.ui4j.api.util.Ui4jException: java.lang.NullPointerException
at com.ui4j.webkit.proxy.WebKitProxy$CallableExecutor.run(WebKitProxy.java:46)
at com.sun.javafx.application.PlatformImpl.lambda$null$170(PlatformImpl.java:295)
at com.sun.javafx.application.PlatformImpl$$Lambda$52/826729279.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$171(PlatformImpl.java:294)
at com.sun.javafx.application.PlatformImpl$$Lambda$50/571777541.run(Unknown Source)
at com.sun.glass.ui.monocle.RunnableProcessor.runLoop(RunnableProcessor.java:77)
at com.sun.glass.ui.monocle.RunnableProcessor.run(RunnableProcessor.java:47)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at com.ui4j.webkit.browser.WebKitPage.addDocumentListener(WebKitPage.java:180)
at com.ui4j.webkit.browser.WebKitPage$ByteBuddy$lA15NPlt.addDocumentListener$accessor$YFf7hhha(Unknown Source)
at com.ui4j.webkit.browser.WebKitPage$ByteBuddy$lA15NPlt$accessor$gnqvWcr9.call(Unknown Source)
at com.ui4j.webkit.proxy.WebKitProxy$CallableExecutor.run(WebKitProxy.java:44)
i added javafx-mx.jar file i found on my pc to the exported jar but again the same errors pops up.
The VM is running Oracle's Java8 (not openJava) so JFX should be there and found via the path.
Any ideas?
ilias
Related
I am trying to run ScenicView as a standalong java application. I am running
java -jar ScenicView.jar
But I am getting the following output
java.lang.UnsatisfiedLinkError: no attach in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.scenicview.model.attach.AttachHandlerFactory.patchAttachLibrary(AttachHandlerFactory.java:202)
at org.scenicview.model.attach.AttachHandlerFactory.initAttachAPI(AttachHandlerFactory.java:138)
at org.scenicview.ScenicView.start(ScenicView.java:167)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$161(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$174(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$172(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$173(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at com.sun.glass.ui.gtk.GtkApplication.lambda$null$48(GtkApplication.java:139)
at java.lang.Thread.run(Unknown Source)
Platform running
Launching ScenicView v8.7.0
Startup done
Creating server
Server done
Number of running Java applications found: 4
Exception in thread "org.scenicview.model.update.RemoteVMsUpdateStrategy" java.lang.UnsatisfiedLinkError: no attach in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at sun.tools.attach.LinuxVirtualMachine.<clinit>(LinuxVirtualMachine.java:342)
at sun.tools.attach.LinuxAttachProvider.attachVirtualMachine(LinuxAttachProvider.java:78)
at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:250)
at org.fxconnector.remote.RemoteConnectorImpl.getRunningJavaFXApplications(RemoteConnectorImpl.java:368)
at org.fxconnector.remote.RemoteConnectorImpl.connect(RemoteConnectorImpl.java:251)
at org.scenicview.model.update.RemoteVMsUpdateStrategy.getActiveApps(RemoteVMsUpdateStrategy.java:57)
at org.scenicview.model.update.RemoteVMsUpdateStrategy.work(RemoteVMsUpdateStrategy.java:77)
at org.fxconnector.helper.WorkerThread.run(WorkerThread.java:43)
ScenicView opens but never finds my JavaFX program running.
Using the JRE version of java it caused errors. Switching to the JDK version and it worked as expected.
I try to compile my code on Mobaxterm and am getting all these strange errors. Any idea what I'm doing wrong?
Exception in thread "main" java.lang.UnsatisfiedLinkError:
/usr/java/jre1.8.0_151/lib/i386/libawt_xawt.so: libXext.so.6: cannot open
shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.load0(Unknown Source)
at java.lang.System.load(Unknown Source)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)//
at java.lang.System.loadLibrary(Unknown Source)
at java.awt.Toolkit$3.run(Unknown Source)
at java.awt.Toolkit$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.loadLibraries(Unknown Source)
at java.awt.Toolkit.<clinit>(Unknown Source)
at java.awt.Component.<clinit>(Unknown Source)
at biuoop.GUI.<init>(GUI.java:36) //this is a library
at AbstractArtDrawing.DrawRandomLines(AbstractArtDrawing.java:37)
at AbstractArtDrawing.main(AbstractArtDrawing.java:15)
make: *** [run2] Error 1
If anyone has any idea what's going wrong, i'd really appreciate it.
According to this error message you need to install libXext for i386 (the processor architecture)
libXext is a package for X11 window system
you can check the below links for installation instructions:
ubuntu
Can't find/install libXtst.so.6?
centos
CentOS: error: libXext.so.6: cannot open shared object file: No such file or directory
:)
I get this exception after exporting into a .jar file with eclipse. IntelliJ says the same. But my program is working fine in eclipse.
Exception in thread "main" java.lang.NoClassDefFoundError: javafx/application/Application
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: javafx.application.Application
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 13 more
What could be the matter of this?
JDK version: 1.7.0_79
Starting: java -jar myapp.jar
After trying it with java -cp jfxrt.jar -jar myapp.jar it gives me the following error:
java -cp jfxrt.jar -jar memo.jar
Exception in thread "JavaFX Application Thread" Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Layout
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplicationWithArgs$100(LauncherImpl.java:352)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$119(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$117(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$118(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at com.sun.glass.ui.gtk.GtkApplication.lambda$null$450(GtkApplication.java:139)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Layout
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 11 more
java.lang.reflect.InvocationTargetException
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 sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.NullPointerException
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:383)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
... 5 more
The javafx.application.Application class is going to be found in a javafx library; in an IDE such as eclipse you generally configure a project to refer to those libraries it needs for compilation and execution. When you put your code into a jar and run it outside the IDE, you need to provide the library to the runtime a different way.
A standard way to do this is to set a classpath which has references to both the application jar and to any libraries it needs; the DOS command to do this would look something like:
set classpath=c:\myProjects\myApplication\myJar.jar;c:\java\libaries\javafx\jfxrt.jar
and then java would have access to the classes in both those jar files
Oracle JDK includes JavaFX on the classpath from version 1.8 onwards; if you upgrade your JDK to version 8 or later it should run. I do not recommend building production-level JavaFX applications with versions prior to Java 8 anyway.
If you really do want to use Java 7, consider using the built-in JavaFX deployment tools to build the jar, instead of the vanilla "create executable jar" from eclipse. These will properly build a jar file that includes the FX runtime, if needed. The easiest way to do this in Eclipse is to install e(fx)clipse (an Eclipse plugin); there's a tutorial which includes steps to build the jar file.
I get this exception after exporting into a .jar file with eclipse. IntelliJ says the same. But my program is working fine in eclipse.
Exception in thread "main" java.lang.NoClassDefFoundError: javafx/application/Application
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: javafx.application.Application
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 13 more
What could be the matter of this?
JDK version: 1.7.0_79
Starting: java -jar myapp.jar
After trying it with java -cp jfxrt.jar -jar myapp.jar it gives me the following error:
java -cp jfxrt.jar -jar memo.jar
Exception in thread "JavaFX Application Thread" Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Layout
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplicationWithArgs$100(LauncherImpl.java:352)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$119(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$117(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$118(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at com.sun.glass.ui.gtk.GtkApplication.lambda$null$450(GtkApplication.java:139)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Layout
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 11 more
java.lang.reflect.InvocationTargetException
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 sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.NullPointerException
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:383)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
... 5 more
The javafx.application.Application class is going to be found in a javafx library; in an IDE such as eclipse you generally configure a project to refer to those libraries it needs for compilation and execution. When you put your code into a jar and run it outside the IDE, you need to provide the library to the runtime a different way.
A standard way to do this is to set a classpath which has references to both the application jar and to any libraries it needs; the DOS command to do this would look something like:
set classpath=c:\myProjects\myApplication\myJar.jar;c:\java\libaries\javafx\jfxrt.jar
and then java would have access to the classes in both those jar files
Oracle JDK includes JavaFX on the classpath from version 1.8 onwards; if you upgrade your JDK to version 8 or later it should run. I do not recommend building production-level JavaFX applications with versions prior to Java 8 anyway.
If you really do want to use Java 7, consider using the built-in JavaFX deployment tools to build the jar, instead of the vanilla "create executable jar" from eclipse. These will properly build a jar file that includes the FX runtime, if needed. The easiest way to do this in Eclipse is to install e(fx)clipse (an Eclipse plugin); there's a tutorial which includes steps to build the jar file.
I installed Apache server (Tomcat 7.63) on client machine (Window 7 system 32 bit), The Java version used in client machine is (JDK 1.8 update 60)
Problem
Tomcat server is started by running the file (...\bin\Tomcat7.exe). But when I tried to open the home page (http://localhost:8080/) it is not coming on browser and I can see the following exception on Apache log:
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler process
SEVERE: Error reading request, ignored
java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at sun.nio.cs.AbstractCharsetProvider.lookup(Unknown Source)
at sun.nio.cs.AbstractCharsetProvider.access$000(Unknown Source)
at sun.nio.cs.AbstractCharsetProvider$1.next(Unknown Source)
at sun.nio.cs.AbstractCharsetProvider$1.next(Unknown Source)
at java.nio.charset.Charset.put(Unknown Source)
at java.nio.charset.Charset.access$200(Unknown Source)
at java.nio.charset.Charset$3.run(Unknown Source)
at java.nio.charset.Charset$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.nio.charset.Charset.availableCharsets(Unknown Source)
at org.apache.tomcat.util.buf.B2CConverter.<clinit>(B2CConverter.java:51
)
at org.apache.tomcat.util.buf.ByteChunk.<clinit>(ByteChunk.java:102)
at org.apache.tomcat.util.buf.MessageBytes.<init>(MessageBytes.java:58)
at org.apache.tomcat.util.buf.MessageBytes.<init>(MessageBytes.java:36)
at org.apache.tomcat.util.buf.MessageBytes$MessageBytesFactory.newInstan
ce(MessageBytes.java:685)
at org.apache.tomcat.util.buf.MessageBytes.newInstance(MessageBytes.java
:78)
at org.apache.coyote.Request.<init>(Request.java:83)
at org.apache.coyote.AbstractProcessor.<init>(AbstractProcessor.java:61)
at org.apache.coyote.http11.AbstractHttp11Processor.<init>(AbstractHttp1
1Processor.java:273)
at org.apache.coyote.http11.Http11Processor.<init>(Http11Processor.java:
56)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.creat
eProcessor(Http11Protocol.java:165)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.creat
eProcessor(Http11Protocol.java:103)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
AbstractProtocol.java:586)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoin
t.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskTh
read.java:61)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at sun.nio.cs.CharsetMapping.load(Unknown Source)
at sun.nio.cs.CharsetMapping$1.run(Unknown Source)
at sun.nio.cs.CharsetMapping$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.nio.cs.CharsetMapping.get(Unknown Source)
at sun.nio.cs.ext.SJIS_0213$1.run(Unknown Source)
at sun.nio.cs.ext.SJIS_0213$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.nio.cs.ext.SJIS_0213.<clinit>(Unknown Source)
... 30 more
Exception in thread "http-bio-8085-exec-1" java.lang.NullPointerException
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
AbstractProtocol.java:731)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoin
t.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskTh
read.java:61)
at java.lang.Thread.run(Unknown Source)
What is really weird to me that if I start Apache server from Services Management Console from the administrator account: Administrative Tools -> Services , it is working fine and I can see that the home page (http://localhost:8080/) is coming on browser.
Question
Why Apache home page is not coming if we run Apache server using the .exe file (...\bin\Tomcat7.exe) ? Why the home page is coming if the server started using Windows service ? In both cases the same .exe file is execute to run the server, what is the difference between the two cases ?
Tomcat cannot be started by using the exe directly (unless the correct parameters are supplied), you should use one of the included .bat files if you want to do that: startup.bat
Just be sure to define your environment variables, such as JAVA_HOME, and/or JRE_HOME