Sachin Dave
Sachin Dave

Reputation: 111

java.lang.UnsatisfiedLinkError: /usr/local/jdk5/jre/lib/i386/xawt/libmawt.so: libXext.so.6: cannot open shared object file: No such file or directory

when I am trying deployed application on beta server (It is based on linux). I have found below error in apache-tomcat log file(localhost.log).

java.lang.UnsatisfiedLinkError: /usr/local/jdk5/jre/lib/i386/xawt/libmawt.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(ClassLoader.java:1751)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1647)
at java.lang.Runtime.load0(Runtime.java:769)
at java.lang.System.load(System.java:967)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:992)
at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.loadLibraries(Toolkit.java:1509)
at java.awt.Toolkit.<clinit>(Toolkit.java:1530)
at java.awt.Color.<clinit>(Color.java:250)
----

please help me.Thanks in advance.

Upvotes: 2

Views: 5189

Answers (2)

Luis Colorado
Luis Colorado

Reputation: 12698

The most probable thing is that you have included the awt libraries (or the complete java runtime) in your served .jar deployed file. Don't do that, as it will make your code to run only on environments like the development system you have used to test the application. Probably you are trying to deploy your application to Windows and linux platforms and it's asking for Xt.so linux libraries (to use awt over X11, on windows it uses a different library). Check your packaging configuration (the modules included in the .jar file) and don't include platform libraries (like the java runtime) that are architecture dependant. A common error is to include everything and you get this problem. Think twice before including some package in your deployment.

Upvotes: 1

Yagnesh Agola
Yagnesh Agola

Reputation: 4659

I have faced similar error and below is the solution that work for me.
Please set Java path for your tomcat server in file catalina.sh.
Set JAVA_HOME path to your jdk version which is same as your compile version.

For Example :

JAVA_HOME=/usr/java5/jdk1.5.0_21  

If required please also set CATALINA_HOME to your tomcat installation directory.

May this will help you.

Upvotes: 1

Related Questions