Re: java.lang.UnsatisfiedLinkError: running tomcat on java headless?
Tim Funk schrieb: 1) Are you passing -Djava.awt.headless=true to tomcat via CATALINA_OPTS (or JAVA_OPTS) I'm passing this option to my tests on the command line. The OP was the one with the Tomcat issue; I suggested he run the iText tests on the command line as well to be sure at least that works. 2) I have found that even if you are headless, you can't use all the Graphics/awt stuff. After reading the following, I have a clearer understanding of what this headless thing is all about. http://java.sun.com/developer/technicalArticles/J2SE/Desktop/headless/ Of course - since you are using iText - this shouldn't be an issue. Indeed, and it isn't for me - only for the OP. -- Michael Ludwig - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: java.lang.UnsatisfiedLinkError: running tomcat on java headless?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 William, On 8/31/2009 6:58 AM, method8 wrote: > Could it be it's just Debian the problem? I develop on windows and deploy on > a debian machine, and had some problems in the past with policies and socket > permissions. You might want to consider developing on the same platform you are targeting for production. Yes, Java is supposed to run everywhere but there are certain environmental factors that can ruin your day (like X libraries). Note that Microsoft Windows always has X-ish capabilities available because the console runs a windowing system. Running Java "headless" doesn't mean X is not required: it just means that X doesn't have to be /running/. Some X libraries may still be required to use certain functions. You used to have to run xvfb if you wanted any kind of AWT interaction. Now, that restriction has been lifed (by going "headless") but I think the libraries still need to be available. Have you tried asking the iText folks? They are much more likely to know the answer to this. Tomcat, as you might guess, has no requirements for X whatsoever. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkqb5WkACgkQ9CaO5/Lv0PA1xwCfcWn86XD/yEbT/ziF4BgKFupF zvkAnijcPFMmiPoep+bJlOoZVhY98aPk =XXgx -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: java.lang.UnsatisfiedLinkError: running tomcat on java headless?
1) Are you passing -Djava.awt.headless=true to tomcat via CATALINA_OPTS (or JAVA_OPTS) 2) I have found that even if you are headless, you can't use all the Graphics/awt stuff. I wish I could recall what it was, but I thought the death was in similar manner. (But this was also a few years ago). Of course - since you are using iText - this shouldn't be an issue. -Tim Michael Ludwig wrote: Tim Funk schrieb: http://wiki.apache.org/tomcat/FAQ/Linux_Unix You're probably alluding to: How do I run without an X server and still get graphics? You either need to run headless or run an alternate X-server. [...] if your are using a JVM 1.4 or better, you can use the system property java.awt.headless=true Indeed, isHeadless() returns true for my Java 5 and 6 installations. import java.awt.GraphicsEnvironment; // http://mindprod.com/jgloss/headless.html public class Headless { public static void main( String[] args) { boolean headless = GraphicsEnvironment.isHeadless(); System.out.println( "Ohne Tastatur, Maus, GUI? " + headless); String p = "java.awt.headless"; System.out.println( p + "? " + System.getProperty( p)); } } The iText color test (which produces graphics in a PDF) still works when I specify java.awt.headless=false, which also makes isHeadless() return false. So it seems to work with or without this headless property. So why does it not work for Method8 (the OP)? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: java.lang.UnsatisfiedLinkError: running tomcat on java headless?
Tim Funk schrieb: http://wiki.apache.org/tomcat/FAQ/Linux_Unix You're probably alluding to: How do I run without an X server and still get graphics? You either need to run headless or run an alternate X-server. [...] if your are using a JVM 1.4 or better, you can use the system property java.awt.headless=true Indeed, isHeadless() returns true for my Java 5 and 6 installations. import java.awt.GraphicsEnvironment; // http://mindprod.com/jgloss/headless.html public class Headless { public static void main( String[] args) { boolean headless = GraphicsEnvironment.isHeadless(); System.out.println( "Ohne Tastatur, Maus, GUI? " + headless); String p = "java.awt.headless"; System.out.println( p + "? " + System.getProperty( p)); } } The iText color test (which produces graphics in a PDF) still works when I specify java.awt.headless=false, which also makes isHeadless() return false. So it seems to work with or without this headless property. So why does it not work for Method8 (the OP)? -- Michael Ludwig - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: java.lang.UnsatisfiedLinkError: running tomcat on java headless?
http://wiki.apache.org/tomcat/FAQ/Linux_Unix -Tim method8 wrote: Dear all, I'm using the iText library to generate pdfs from a database on the fly. Whenever I use some of it's features that require simple things like java.awt.Color, I get an java.lang.UnsatisfiedLinkError as shown: - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: java.lang.UnsatisfiedLinkError: running tomcat on java headless?
this is the output of ldconfig -p libz.so.1 (libc6,x86-64) => /usr/lib/libz.so.1 libxtables.so.0 (libc6,x86-64) => /lib/libxtables.so.0 libxml2.so.2 (libc6,x86-64) => /usr/lib/libxml2.so.2 libxcb.so.1 (libc6,x86-64) => /usr/lib/libxcb.so.1 libxcb-xlib.so.0 (libc6,x86-64) => /usr/lib/libxcb-xlib.so.0 libxcb-render.so.0 (libc6,x86-64) => /usr/lib/libxcb-render.so.0 libxcb-render-util.so.0 (libc6,x86-64) => /usr/lib/libxcb-render-util.so.0 libxapian.so.15 (libc6,x86-64) => /usr/lib/libxapian.so.15 libwrap.so.0 (libc6,x86-64) => /lib/libwrap.so.0 libvolume_id.so.0 (libc6,x86-64) => /lib/libvolume_id.so.0 libuuid.so.1 (libc6,x86-64) => /lib/libuuid.so.1 libutil.so.1 (libc6,x86-64, OS ABI: Linux 2.6.8) => /lib/libutil.so.1 libusb-0.1.so.4 (libc6,x86-64) => /lib/libusb-0.1.so.4 libusb-0.1.so.4 (libc6,x86-64) => /usr/lib/libusb-0.1.so.4 libuniquewm-1.0.so.0 (libc6,x86-64) => /usr/lib/libuniquewm-1.0.so.0 libts-0.0.so.0 (libc6,x86-64) => /usr/lib/libts-0.0.so.0 libtre.so.4 (libc6,x86-64) => /usr/lib/libtre.so.4 libtiff.so.4 (libc6,x86-64) => /usr/lib/libtiff.so.4 libticw.so.5 (libc6,x86-64) => /lib/libticw.so.5 libtic.so.5 (libc6,x86-64) => /lib/libtic.so.5 libthread_db.so.1 (libc6,x86-64, OS ABI: Linux 2.6.8) => /lib/libthread_db.so.1 libthai.so.0 (libc6,x86-64) => /usr/lib/libthai.so.0 libtcl8.4.so.0 (libc6,x86-64) => /usr/lib/libtcl8.4.so.0 libtasn1.so.3 (libc6,x86-64) => /usr/lib/libtasn1.so.3 libsysfs.so.2 (libc6,x86-64) => /lib/libsysfs.so.2 libstdc++.so.6 (libc6,x86-64) => /usr/lib/libstdc++.so.6 libssl.so.0.9.8 (libc6,x86-64) => /usr/lib/libssl.so.0.9.8 libss.so.2 (libc6,x86-64) => /lib/libss.so.2 libsqlite3.so.0 (libc6,x86-64) => /usr/lib/libsqlite3.so.0 libslang.so.2 (libc6,x86-64) => /lib/libslang.so.2 libsigc-2.0.so.0 (libc6,x86-64) => /usr/lib/libsigc-2.0.so.0 libsepol.so.1 (libc6,x86-64) => /lib/libsepol.so.1 libselinux.so.1 (libc6,x86-64) => /lib/libselinux.so.1 libsasl2.so.2 (libc6,x86-64) => /usr/lib/libsasl2.so.2 librt.so.1 (libc6,x86-64, OS ABI: Linux 2.6.8) => /lib/librt.so.1 libresolv.so.2 (libc6,x86-64, OS ABI: Linux 2.6.8) => /lib/libresolv.so.2 libreadline.so.5 (libc6,x86-64) => /lib/libreadline.so.5 libpython2.5.so.1.0 (libc6,x86-64) => /usr/lib/libpython2.5.so.1.0 libpthread.so.0 (libc6,x86-64, OS ABI: Linux 2.6.8) => /lib/libpthread.so.0 libproc-3.2.7.so (libc6,x86-64) => /lib/libproc-3.2.7.so libpq.so.5 (libc6,x86-64) => /usr/lib/libpq.so.5 libpostfix-util.so.1 (libc6,x86-64) => /usr/lib/libpostfix-util.so.1 libpostfix-tls.so.1 (libc6,x86-64) => /usr/lib/libpostfix-tls.so.1 libpostfix-master.so.1 (libc6,x86-64) => /usr/lib/libpostfix-master.so.1 libpostfix-global.so.1 (libc6,x86-64) => /usr/lib/libpostfix-global.so.1 libpostfix-dns.so.1 (libc6,x86-64) => /usr/lib/libpostfix-dns.so.1 libpopt.so.0 (libc6,x86-64) => /lib/libpopt.so.0 libpng12.so.0 (libc6,x86-64) => /usr/lib/libpng12.so.0 libpixman-1.so.0 (libc6,x86-64) => /usr/lib/libpixman-1.so.0 libperl.so.5.10 (libc6,x86-64) => /usr/lib/libperl.so.5.10 libpcreposix.so.3 (libc6,x86-64) => /usr/lib/libpcreposix.so.3 libpcre.so.3 (libc6,x86-64) => /usr/lib/libpcre.so.3 libpcprofile.so (libc6,x86-64, OS ABI: Linux 2.6.8) => /lib/libpcprofile.so libpangoxft-1.0.so.0 (libc6,x86-64) => /usr/lib/libpangoxft-1.0.so.0 libpangox-1.0.so.0 (libc6,x86-64) => /usr/lib/libpangox-1.0.so.0 libpangoft2-1.0.so.0 (libc6,x86-64) => /usr/lib/libpangoft2-1.0.so.0 libpangocairo-1.0.so.0 (libc6,x86-64) => /usr/lib/libpangocairo-1.0.so.0 libpango-1.0.so.0 (libc6,x86-64) => /usr/lib/libpango-1.0.so.0 libpanelw.so.5 (libc6,x86-64) => /usr/lib/libpanelw.so.5 libpanel.so.5 (libc6,x86-64) => /usr/lib/libpanel.so.5 libpamc.so.0 (libc6,x86-64) => /lib/libpamc.so.0 libpam_misc.so.0 (libc6,x86-64) => /lib/libpam_misc.so.0 libpam.so.0 (libc6,x86-64) => /lib/libpam.so.0 libodbcinst.so.1 (libc6,x86-64) => /usr/lib/libodbcinst.so.1 libodbccr.so.1 (libc6,x86-64) => /usr/lib/libodbccr.so.1 libodbc.so.1 (libc6,x86-64) => /usr/lib/libodbc.so.1 libnss_nisplus.so.2 (libc6,x86-64, OS ABI: Linux 2.6.8) => /lib/libnss_nisplus.so.2 libnss_nis.so.2 (libc6,x86-64, OS ABI: Linux 2.6.8) => /lib/libnss_nis.so.2 libnss_mdns6_minimal.so.2 (libc6,x86-64) => /lib/libnss_mdns6_minimal.so.2 libnss_mdns6.so.2 (libc6,x86-64) => /lib/libnss_mdns6.so.2 libnss_mdns4_minimal.so.2 (libc6,x86-64) => /lib/libnss_mdns4_minimal.so.2 libnss_mdns4.so.2 (libc6,x86-64) => /lib/libnss_mdns4.so.2 libnss_mdns_minimal.so.2 (libc6,x86-64) => /lib/lib
Re: java.lang.UnsatisfiedLinkError: running tomcat on java headless?
method8 schrieb: - But what about libmlib_image.so? That's the one it's complaining about. I can see that as well. So check the value of "java.library.path". Just to be sure. Could it be it's just Debian the problem? I develop on windows and deploy on a debian machine, and had some problems in the past with policies and socket permissions. Try running your Itext examples from the command-line on your server. If that works, I'd look for the issue in how you set up the environment for Tomcat. I don't know if that could be a problem, but is there more than one Java installation on your machine? Do Java library directories show up in the output of "ldconfig -p"? Could that confuse the JVM about what library to load? -- Michael Ludwig - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: java.lang.UnsatisfiedLinkError: running tomcat on java headless?
- But what about libmlib_image.so? That's the one it's complaining about. I can see that as well. This is the whole list of files in /usr/lib/jvm/java-1.5.0-sun-1.5.0.18/jre/lib/amd64 awt_robot libcmm.so libinstrument.so libjava.so libjsig.solibnative_chmod.so librmi.so motif21 gtkhelper libdcpr.so libioser12.solibjawt.so libjsoundalsa.so libnet.so libsaproc.so native_threads headless libdt_socket.solibj2pkcs11.so libJdbcOdbc.so libjsound.so libnio.so libunpack.so server jvm.cfglibfontmanager.so libjaas_unix.so libjdwp.so libmanagement.so libodbcinst.so libverify.so xawt libawt.so libhprof.solibjava_crw_demo.so libjpeg.so libmlib_image.so libodbc.so libzip.so Could it be it's just Debian the problem? I develop on windows and deploy on a debian machine, and had some problems in the past with policies and socket permissions. -- View this message in context: http://www.nabble.com/java.lang.UnsatisfiedLinkError%3A-running-tomcat-on-java-headless--tp25220313p25221584.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: java.lang.UnsatisfiedLinkError: running tomcat on java headless?
method8 schrieb: I'm using the iText library to generate pdfs from a database on the fly. Whenever I use some of it's features that require simple things like java.awt.Color, I get an java.lang.UnsatisfiedLinkError as shown: java.lang.UnsatisfiedLinkError: /usr/lib/jvm/java-1.5.0-sun-1.5.0.18/jre/lib/amd64/libawt.so: libmlib_image.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) [...] at java.security.AccessController.doPrivileged(Native Method) at java.awt.Toolkit.loadLibraries(Toolkit.java:1509) After some research and verifying that libawt.so physically exists But what about libmlib_image.so? That's the one it's complaining about. Here's what I can see on a non-X Linux system: $ ldd /usr/lib/jvm/java-1.5.0-sun-1.5.0.17/jre/lib/i386/libawt.so linux-gate.so.1 => (0xb7f67000) libmlib_image.so => not found libjvm.so => not found libm.so.6 => /lib/i686/cmov/libm.so.6 (0xb7eb1000) libdl.so.2 => /lib/i686/cmov/libdl.so.2 (0xb7ead000) libjava.so => not found libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb7d52000) /lib/ld-linux.so.2 (0xb7f68000) Still, compiling and running a color example works fine for me. (From the command line, that is.) It works because of the built-in value for the system property "java.library.path". m...@seestern:~ > /usr/lib/jvm/java-1.5.0-sun/jre/bin/java LibraryPath /usr/lib/jvm/java-1.5.0-sun-1.5.0.17/jre/lib/i386/client /usr/lib/jvm/java-1.5.0-sun-1.5.0.17/jre/lib/i386 /usr/lib/jvm/java-1.5.0-sun-1.5.0.17/jre/../lib/i386 Download an example that *I think* requires AWT. http://itextdocs.lowagie.com/examples/com/lowagie/examples/directcontent/colors/SpotColors.java m...@seestern:~ > javac -target 5 -bootclasspath \ /usr/lib/jvm/java-1.5.0-sun/jre/lib/rt.jar \ com/lowagie/examples/directcontent/colors/SpotColors.java m...@seestern:~ > /usr/lib/jvm/java-1.5.0-sun/jre/bin/java \ com/lowagie/examples/directcontent/colors/SpotColors Pantone example : Spot Color The result looks fine! I read somewhere that whenever java is installed no a linux box without x (in my case it's a remote vps) java omits certain graphics related libraries like AWT (naturally). There is no X11 server on that machine; the Sun Java is installed via the package manager; everything seems fine. I also read that you can run java headless to avoid the dependencies to X. Now is there a way to run tomcat (or add variables to tomcat's startup.sh) to avoid having these dependencies? Aren't the dependencies simply required? I think the JVM wants to load libmlib_image.so because it is needed. -- Michael Ludwig - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
java.lang.UnsatisfiedLinkError: running tomcat on java headless?
Dear all, I'm using the iText library to generate pdfs from a database on the fly. Whenever I use some of it's features that require simple things like java.awt.Color, I get an java.lang.UnsatisfiedLinkError as shown: java.lang.UnsatisfiedLinkError: /usr/lib/jvm/java-1.5.0-sun-1.5.0.18/jre/lib/amd64/libawt.so: libmlib_image.so: 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:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) 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.(Toolkit.java:1530) at java.awt.Color.(Color.java:250) at tablereport.processRequest(tablereport.java:55) at tablereport.doGet(tablereport.java:130) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:172) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection (Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt (LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) at java.lang.Thread.run(Thread.java:595) After some research and verifying that libawt.so physically exists I read somewhere that whenever java is installed no a linux box without x (in my case it's a remote vps) java omits certain graphics related libraries like AWT (naturally). I also read that you can run java headless to avoid the dependencies to X. Now is there a way to run tomcat (or add variables to tomcat's startup.sh) to avoid having these dependencies? Thanks for your help, William -- View this message in context: http://www.nabble.com/java.lang.UnsatisfiedLinkError%3A-running-tomcat-on-java-headless--tp25220313p25220313.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org