Aw: Re: java.lang.UnsatisfiedLinkError in Tomcat 8.0.11 and SPDY [broken tcnative 1.1.x?]
Christopher, Gesendet: Freitag, 05. September 2014 um 22:23 Uhr Von: Christopher Schultz ch...@christopherschultz.net An: Tomcat Users List users@tomcat.apache.org Betreff: Re: java.lang.UnsatisfiedLinkError in Tomcat 8.0.11 and SPDY [broken tcnative 1.1.x?] -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Konstantin, On 9/4/14 6:20 PM, Konstantin Kolinko wrote: 2014-09-04 20:06 GMT+04:00 rolandl...@web.de: Hello, I have this error configuring SPDY in Tomcat 8.0.11 in RHEL Linux 6.4 (64bit). Everything works fine removing npnHandler attribute for SPDY. Sep 04, 2014 9:30:02 AM org.apache.catalina.core.AprLifecycleListener init INFO: Loaded APR based Apache Tomcat Native library 1.1.31 using APR version 1.3.9. Sep 04, 2014 9:30:02 AM org.apache.catalina.core.AprLifecycleListener init INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. .. Sep 04, 2014 9:30:55 AM org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler [http-apr-xx.xx.xx.xx-443] java.lang.UnsatisfiedLinkError: org.apache.tomcat.jni.SSLExt.setNPN(J[BI)I at org.apache.tomcat.jni.SSLExt.setNPN(Native Method) Your copy of Tomcat-Native library was compiled without NPN support and does not have the above method. It appears that the 1.1 branch of tcnative doesn't have any of the SSLExt.java/sslext.c methods at all: src/sslext.c does not even exist. It looks like this was added in the trunk but nobody ever bothered to back-port it to the 1.1 branch (which is of course what everybody actually uses). It also looks like there are a bunch of functions that are defined when HAVE_OPENSSL is defined, but have no definition otherwise. This means that those other methods would end up throwing UnsatisfiedLinkError if they are called. They all have to do with SSL and therefore make no sense being called under those conditions, but it's always nice to have a method exist when the Java code expects it to exist ;) The obvious solution is to back-port src/sslext.c to the 1.1 branch but I'd like someone who was involved in working on that stuff (Costin; markt only made whitespace changes to make checkstyle happy) to comment before I do it. Roland, would you be willing to patch your tcnative source and re-try? The patch should be trivial (new file). - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org iQIcBAEBCAAGBQJUChu2AAoJEBzwKT+lPKRYdjUP/0hGzwOyg58oJT/oo3uExEYN jUokpssQIu0e5bXfldErHFZD6q1Dm50Fg8EmONTDEBqaE5UbKEsQ/bi676X2OLA7 a1/9zUQyxQ0ZFkYX0yexI2mVzRWJclDj0pT3f2kvW3LR5hALO37yMyDaAjiSpDoB gEW2yqKEa2Cor6/X6/l92zg30iXcy1LyOCo3JBS30YRyRoKrXACx5aQz+2DyQ9UD SUSgLvq42urEVzOp7eyx0juQ2wjg1s3+rS4YqkGJxh+aQ2zqVglOIzmoA8xB2TiN dwrMdsYNkysPCHPI9rWm1SlZZiRG4Rge83u23Gq0mi/PZbuxeI4ggfa4cghbKpKd nQypwuLenwAp7Y/zTNaTbWShcHOedM2cw5TsBoQFndilrHYYt9xu/nu62cHddkqB qTCTm9PIrWRgJT8SilOqs3RetIeoa3+pBGct6bnKFDthsENxE7bQtfQtDiWil9va 36czpUPtAShz6e63I0AKLptSZR+jj5SIiH/ZnIoHMCL8pzqq/ELaofrB1tYI/eah 36rJ1I00tvfiob8dZ0p5mAuPzK5kr3WwXNW8IkeyYO09hneEfChLfoC3pD+z5G48 5hYmPsHK2gxdSEMeokFa86D56Mbpo6pwwSEj0yhMqE9QT4X2nhob0BMJ/nB8GWeQ uJqotCJsSf2xZsjCTufa =75Ok -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org I recompiled tcnative several times, and I looked for a configure option related to NPN, but I couldn't find it. Yes, of course I want to apply the patch and re-try. Thank you - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: java.lang.UnsatisfiedLinkError in Tomcat 8.0.11 and SPDY [broken tcnative 1.1.x?]
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Konstantin, On 9/4/14 6:20 PM, Konstantin Kolinko wrote: 2014-09-04 20:06 GMT+04:00 rolandl...@web.de: Hello, I have this error configuring SPDY in Tomcat 8.0.11 in RHEL Linux 6.4 (64bit). Everything works fine removing npnHandler attribute for SPDY. Sep 04, 2014 9:30:02 AM org.apache.catalina.core.AprLifecycleListener init INFO: Loaded APR based Apache Tomcat Native library 1.1.31 using APR version 1.3.9. Sep 04, 2014 9:30:02 AM org.apache.catalina.core.AprLifecycleListener init INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. .. Sep 04, 2014 9:30:55 AM org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler [http-apr-xx.xx.xx.xx-443] java.lang.UnsatisfiedLinkError: org.apache.tomcat.jni.SSLExt.setNPN(J[BI)I at org.apache.tomcat.jni.SSLExt.setNPN(Native Method) Your copy of Tomcat-Native library was compiled without NPN support and does not have the above method. It appears that the 1.1 branch of tcnative doesn't have any of the SSLExt.java/sslext.c methods at all: src/sslext.c does not even exist. It looks like this was added in the trunk but nobody ever bothered to back-port it to the 1.1 branch (which is of course what everybody actually uses). It also looks like there are a bunch of functions that are defined when HAVE_OPENSSL is defined, but have no definition otherwise. This means that those other methods would end up throwing UnsatisfiedLinkError if they are called. They all have to do with SSL and therefore make no sense being called under those conditions, but it's always nice to have a method exist when the Java code expects it to exist ;) The obvious solution is to back-port src/sslext.c to the 1.1 branch but I'd like someone who was involved in working on that stuff (Costin; markt only made whitespace changes to make checkstyle happy) to comment before I do it. Roland, would you be willing to patch your tcnative source and re-try? The patch should be trivial (new file). - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org iQIcBAEBCAAGBQJUChu2AAoJEBzwKT+lPKRYdjUP/0hGzwOyg58oJT/oo3uExEYN jUokpssQIu0e5bXfldErHFZD6q1Dm50Fg8EmONTDEBqaE5UbKEsQ/bi676X2OLA7 a1/9zUQyxQ0ZFkYX0yexI2mVzRWJclDj0pT3f2kvW3LR5hALO37yMyDaAjiSpDoB gEW2yqKEa2Cor6/X6/l92zg30iXcy1LyOCo3JBS30YRyRoKrXACx5aQz+2DyQ9UD SUSgLvq42urEVzOp7eyx0juQ2wjg1s3+rS4YqkGJxh+aQ2zqVglOIzmoA8xB2TiN dwrMdsYNkysPCHPI9rWm1SlZZiRG4Rge83u23Gq0mi/PZbuxeI4ggfa4cghbKpKd nQypwuLenwAp7Y/zTNaTbWShcHOedM2cw5TsBoQFndilrHYYt9xu/nu62cHddkqB qTCTm9PIrWRgJT8SilOqs3RetIeoa3+pBGct6bnKFDthsENxE7bQtfQtDiWil9va 36czpUPtAShz6e63I0AKLptSZR+jj5SIiH/ZnIoHMCL8pzqq/ELaofrB1tYI/eah 36rJ1I00tvfiob8dZ0p5mAuPzK5kr3WwXNW8IkeyYO09hneEfChLfoC3pD+z5G48 5hYmPsHK2gxdSEMeokFa86D56Mbpo6pwwSEj0yhMqE9QT4X2nhob0BMJ/nB8GWeQ uJqotCJsSf2xZsjCTufa =75Ok -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
java.lang.UnsatisfiedLinkError in Tomcat 8.0.11 and SPDY
Hello, I have this error configuring SPDY in Tomcat 8.0.11 in RHEL Linux 6.4 (64bit). Everything works fine removing npnHandler attribute for SPDY. Sep 04, 2014 9:30:02 AM org.apache.catalina.core.AprLifecycleListener init INFO: Loaded APR based Apache Tomcat Native library 1.1.31 using APR version 1.3.9. Sep 04, 2014 9:30:02 AM org.apache.catalina.core.AprLifecycleListener init INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. .. Sep 04, 2014 9:30:55 AM org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler [http-apr-xx.xx.xx.xx-443] java.lang.UnsatisfiedLinkError: org.apache.tomcat.jni.SSLExt.setNPN(J[BI)I at org.apache.tomcat.jni.SSLExt.setNPN(Native Method) at org.apache.tomcat.jni.SSLExt.setNPN(SSLExt.java:126) at org.apache.coyote.spdy.SpdyAprNpnHandler.init(SpdyAprNpnHandler.java:76) at org.apache.coyote.http11.Http11AprProtocol.start(Http11AprProtocol.java:211) at org.apache.catalina.connector.Connector.startInternal(Connector.java:986) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.StandardService.startInternal(StandardService.java:458) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:760) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.startup.Catalina.start(Catalina.java:625) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485) Sep 04, 2014 9:30:55 AM org.apache.coyote.spdy.SpdyAprNpnHandler init WARNING: SPDY/NPN not supported Machine info: Red Hat Enterprise Linux Server release 6.4 (Santiago) Linux xx.com 2.6.32-358.14.1.el6.x86_64 #1 SMP Mon Jun 17 15:54:20 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux Java version: java version 1.7.0_51 Java(TM) SE Runtime Environment (build 1.7.0_51-b13) Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode) server.xml configuration Connector port=443 address=xx.xx.xx.xx npnHandler=org.apache.coyote.spdy.SpdyAprNpnHandler protocol=HTTP/1.1 SSLEnabled=true maxThreads=150 scheme=https secure=true sslProtocol=TLS SSLCertificateFile=/xx SSLCertificateKeyFile=/xx SSLCACertificateFile=/xx/ Thanks in advance, R.Levy - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: java.lang.UnsatisfiedLinkError in Tomcat 8.0.11 and SPDY
2014-09-04 20:06 GMT+04:00 rolandl...@web.de: Hello, I have this error configuring SPDY in Tomcat 8.0.11 in RHEL Linux 6.4 (64bit). Everything works fine removing npnHandler attribute for SPDY. Sep 04, 2014 9:30:02 AM org.apache.catalina.core.AprLifecycleListener init INFO: Loaded APR based Apache Tomcat Native library 1.1.31 using APR version 1.3.9. Sep 04, 2014 9:30:02 AM org.apache.catalina.core.AprLifecycleListener init INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. .. Sep 04, 2014 9:30:55 AM org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler [http-apr-xx.xx.xx.xx-443] java.lang.UnsatisfiedLinkError: org.apache.tomcat.jni.SSLExt.setNPN(J[BI)I at org.apache.tomcat.jni.SSLExt.setNPN(Native Method) Your copy of Tomcat-Native library was compiled without NPN support and does not have the above method. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: JNI error under tomcat: java.lang.UnsatisfiedLinkError
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dennis, On 7/5/2010 3:35 AM, dennis ch wrote: modelJNI.java === public final static native void initModel(); native code = #include HEC.h #include vector #include string [snip] void initModel() { You can't use JNI like that. You have to use the 'javah' header-fine generator and then write your native code to that specification. For a class called JNITest and a method called doSomething that takes no arguments, the method signature needs to be: JNIEXPORT void JNICALL Java_JNITest_doSomething (JNIEnv *, jclass); You might want to read-up on using JNI: it's not as simple at the IJW stuff C# provides. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkwzZmQACgkQ9CaO5/Lv0PDqIQCfUHTmhYzd+iMN6z2ZS3F27z2p WGgAni70v3qoAt66x+TuD0JUkRiFXeRZ =Srci -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: JNI error under tomcat: java.lang.UnsatisfiedLinkError
Hi Chris, Thanks for your reply. I recompiled everything and checked method signature, but still got the same error. I felt it's weird why it worked for standalone app but not deployed web service... Thanks. model.java public static void initModel() { modelJNI.initModel(); } modelJNI.java === public final static native void initModel(); native code = #include HEC.h #include vector #include string string path=/tmp/model.xml; HEC *hec_obj; void initModel() { hec_obj = new HEC(path); if (!hec_obj) { cout [ERROR] Cannot instantiate HEC objects.; } } 2010/7/3 Christopher Schultz ch...@christopherschultz.net -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dennis, On 7/2/2010 3:46 AM, dennis ch wrote: However, when I deploy it as a web service (tomcat 6.0.26 + axis2 1.5.1 + eclipse jee helios) to call the native method, I got the following error (the first line means the .so was successfully loaded): Load library successfully [ERROR] com.model.modelJNI.initModel()V java.lang.reflect.InvocationTargetException [...] Caused by: java.lang.UnsatisfiedLinkError: com.model.modelJNI.initModel()V at com.model.modelJNI.initModel(Native Method) at com.model.model.initModel(model.java:13) at com.webservice.run(EvalVita.java:763) ... 25 more Sounds like a Java-class/native-library mismatch. Are you sure your .java file and .c files are sync'd up properly? Try recompiling everything, and double-check your JNI method signatures. What does modelJNI.initModel look like in the Java method declaration? What does the same method signature in your native code look like? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkwv82YACgkQ9CaO5/Lv0PABewCeIC0qjqJdNm80GMByJBJn4VEs KzsAoKDPzdgXUJKMq/S4xruHd0RlNJCv =VA0U -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: JNI error under tomcat: java.lang.UnsatisfiedLinkError
Ralph, I got this error upon first deployment... 2010/7/4 Ralph Carlson racarl...@mediacomcc.com do you get this error upon first deployment or re-deploy? do you restart tomcat after you redeploy your jni app? From: users-return-214329-racarlson=mediacomcc@tomcat.apache.org[users-return-214329-racarlson= mediacomcc@tomcat.apache.org] On Behalf Of Shay Rojansky [ r...@roji.org] Sent: Saturday, July 03, 2010 12:40 AM To: Tomcat Users List Subject: Re: JNI error under tomcat: java.lang.UnsatisfiedLinkError Hi Dennis. So do you see the Load library successful message? Also, if I remember correctly, the code in eval.java is not a safe way to load a native library. It's a very good idea to place the System.loadLibrary in a static { } block, instead of in a method. The way your class is written, it's possible for the run method to be executed more than once, in which case loadLibrary will be called more than once (and so will the native initModels). Not sure what the effects are and if it's related to your problem but it's a good idea to avoid trouble by fixing it. Shay On Fri, Jul 2, 2010 at 3:46 AM, dennis ch dennis.ch2...@gmail.com wrote: Hi, I have a java class (eval.java) that invokes a native method in an so file (libmodel.so, using SWIG 1.3.29 to generate JNI code/wrapper and compiled the library). I can use System.loadLibrary() to load the libmodel.so without any error (-Djava.library.path=/usr/lib), and the native method initModel() works fine as a standalone application. However, when I deploy it as a web service (tomcat 6.0.26 + axis2 1.5.1 + eclipse jee helios) to call the native method, I got the following error (the first line means the .so was successfully loaded): Load library successfully [ERROR] com.model.modelJNI.initModel()V java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:194) at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:102) at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40) at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:114) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:173) at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:167) at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:142) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.UnsatisfiedLinkError: com.model.modelJNI.initModel()V at com.model.modelJNI.initModel(Native Method) at com.model.model.initModel(model.java:13) at com.webservice.run(EvalVita.java:763) ... 25 more Below is the body of Eval.java: import com.model.*; public class Eval { static void loadModel() { try { System.loadLibrary(model); System.out.println(Load library successfully); } catch (UnsatisfiedLinkError e) { System.err.println(Native code library failed to load. + e); } } public void run() { loadModel(); model.initModel(); } } Do I miss anything here? Any input is appreciated! Dennis - To unsubscribe, e-mail: users
Re: JNI error under tomcat: java.lang.UnsatisfiedLinkError
Hi Shay, Thanks for your input. And yes, I did see the Load library successful message. I've also fixed the code with static { } block. However, I still received the same error message. Any other thoughts? Thanks, Dennis 2010/7/2 Shay Rojansky r...@roji.org Hi Dennis. So do you see the Load library successful message? Also, if I remember correctly, the code in eval.java is not a safe way to load a native library. It's a very good idea to place the System.loadLibrary in a static { } block, instead of in a method. The way your class is written, it's possible for the run method to be executed more than once, in which case loadLibrary will be called more than once (and so will the native initModels). Not sure what the effects are and if it's related to your problem but it's a good idea to avoid trouble by fixing it. Shay On Fri, Jul 2, 2010 at 3:46 AM, dennis ch dennis.ch2...@gmail.com wrote: Hi, I have a java class (eval.java) that invokes a native method in an so file (libmodel.so, using SWIG 1.3.29 to generate JNI code/wrapper and compiled the library). I can use System.loadLibrary() to load the libmodel.so without any error (-Djava.library.path=/usr/lib), and the native method initModel() works fine as a standalone application. However, when I deploy it as a web service (tomcat 6.0.26 + axis2 1.5.1 + eclipse jee helios) to call the native method, I got the following error (the first line means the .so was successfully loaded): Load library successfully [ERROR] com.model.modelJNI.initModel()V java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:194) at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:102) at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40) at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:114) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:173) at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:167) at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:142) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.UnsatisfiedLinkError: com.model.modelJNI.initModel()V at com.model.modelJNI.initModel(Native Method) at com.model.model.initModel(model.java:13) at com.webservice.run(EvalVita.java:763) ... 25 more Below is the body of Eval.java: import com.model.*; public class Eval { static void loadModel() { try { System.loadLibrary(model); System.out.println(Load library successfully); } catch (UnsatisfiedLinkError e) { System.err.println(Native code library failed to load. + e); } } public void run() { loadModel(); model.initModel(); } } Do I miss anything here? Any input is appreciated! Dennis
Re: JNI error under tomcat: java.lang.UnsatisfiedLinkError
2010/7/2 dennis ch dennis.ch2...@gmail.com: Do I miss anything here? Any input is appreciated! IIRC, native libraries can be loaded only once, but webapplication classloader is disposed and recreated each time the web application is stopped/reloaded. Thus the class that loads your library must be in ${catalina.base}/lib folder (and at the same time it must be removed from the webapp, because otherwise the classes in webapp are preferred over the ones in lib). Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: JNI error under tomcat: java.lang.UnsatisfiedLinkError
Had You tried to made c header by javah -jni ./your_packages/your_class.class ? It gives header for You with properly named method to be written in c.. On Mon, Jul 5, 2010 at 4:11 PM, Konstantin Kolinko knst.koli...@gmail.comwrote: 2010/7/2 dennis ch dennis.ch2...@gmail.com: Do I miss anything here? Any input is appreciated! IIRC, native libraries can be loaded only once, but webapplication classloader is disposed and recreated each time the web application is stopped/reloaded. Thus the class that loads your library must be in ${catalina.base}/lib folder (and at the same time it must be removed from the webapp, because otherwise the classes in webapp are preferred over the ones in lib). Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- best regards, Igor Chumak
RE: JNI error under tomcat: java.lang.UnsatisfiedLinkError
do you get this error upon first deployment or re-deploy? do you restart tomcat after you redeploy your jni app? From: users-return-214329-racarlson=mediacomcc@tomcat.apache.org [users-return-214329-racarlson=mediacomcc@tomcat.apache.org] On Behalf Of Shay Rojansky [r...@roji.org] Sent: Saturday, July 03, 2010 12:40 AM To: Tomcat Users List Subject: Re: JNI error under tomcat: java.lang.UnsatisfiedLinkError Hi Dennis. So do you see the Load library successful message? Also, if I remember correctly, the code in eval.java is not a safe way to load a native library. It's a very good idea to place the System.loadLibrary in a static { } block, instead of in a method. The way your class is written, it's possible for the run method to be executed more than once, in which case loadLibrary will be called more than once (and so will the native initModels). Not sure what the effects are and if it's related to your problem but it's a good idea to avoid trouble by fixing it. Shay On Fri, Jul 2, 2010 at 3:46 AM, dennis ch dennis.ch2...@gmail.com wrote: Hi, I have a java class (eval.java) that invokes a native method in an so file (libmodel.so, using SWIG 1.3.29 to generate JNI code/wrapper and compiled the library). I can use System.loadLibrary() to load the libmodel.so without any error (-Djava.library.path=/usr/lib), and the native method initModel() works fine as a standalone application. However, when I deploy it as a web service (tomcat 6.0.26 + axis2 1.5.1 + eclipse jee helios) to call the native method, I got the following error (the first line means the .so was successfully loaded): Load library successfully [ERROR] com.model.modelJNI.initModel()V java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:194) at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:102) at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40) at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:114) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:173) at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:167) at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:142) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.UnsatisfiedLinkError: com.model.modelJNI.initModel()V at com.model.modelJNI.initModel(Native Method) at com.model.model.initModel(model.java:13) at com.webservice.run(EvalVita.java:763) ... 25 more Below is the body of Eval.java: import com.model.*; public class Eval { static void loadModel() { try { System.loadLibrary(model); System.out.println(Load library successfully); } catch (UnsatisfiedLinkError e) { System.err.println(Native code library failed to load. + e); } } public void run() { loadModel(); model.initModel(); } } Do I miss anything here? Any input is appreciated! Dennis - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: JNI error under tomcat: java.lang.UnsatisfiedLinkError
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dennis, On 7/2/2010 3:46 AM, dennis ch wrote: However, when I deploy it as a web service (tomcat 6.0.26 + axis2 1.5.1 + eclipse jee helios) to call the native method, I got the following error (the first line means the .so was successfully loaded): Load library successfully [ERROR] com.model.modelJNI.initModel()V java.lang.reflect.InvocationTargetException [...] Caused by: java.lang.UnsatisfiedLinkError: com.model.modelJNI.initModel()V at com.model.modelJNI.initModel(Native Method) at com.model.model.initModel(model.java:13) at com.webservice.run(EvalVita.java:763) ... 25 more Sounds like a Java-class/native-library mismatch. Are you sure your .java file and .c files are sync'd up properly? Try recompiling everything, and double-check your JNI method signatures. What does modelJNI.initModel look like in the Java method declaration? What does the same method signature in your native code look like? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkwv82YACgkQ9CaO5/Lv0PABewCeIC0qjqJdNm80GMByJBJn4VEs KzsAoKDPzdgXUJKMq/S4xruHd0RlNJCv =VA0U -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
JNI error under tomcat: java.lang.UnsatisfiedLinkError
Hi, I have a java class (eval.java) that invokes a native method in an so file (libmodel.so, using SWIG 1.3.29 to generate JNI code/wrapper and compiled the library). I can use System.loadLibrary() to load the libmodel.so without any error (-Djava.library.path=/usr/lib), and the native method initModel() works fine as a standalone application. However, when I deploy it as a web service (tomcat 6.0.26 + axis2 1.5.1 + eclipse jee helios) to call the native method, I got the following error (the first line means the .so was successfully loaded): Load library successfully [ERROR] com.model.modelJNI.initModel()V java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:194) at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:102) at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40) at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:114) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:173) at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:167) at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:142) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.UnsatisfiedLinkError: com.model.modelJNI.initModel()V at com.model.modelJNI.initModel(Native Method) at com.model.model.initModel(model.java:13) at com.webservice.run(EvalVita.java:763) ... 25 more Below is the body of Eval.java: import com.model.*; public class Eval { static void loadModel() { try { System.loadLibrary(model); System.out.println(Load library successfully); } catch (UnsatisfiedLinkError e) { System.err.println(Native code library failed to load. + e); } } public void run() { loadModel(); model.initModel(); } } Do I miss anything here? Any input is appreciated! Dennis
Re: JNI error under tomcat: java.lang.UnsatisfiedLinkError
Hi Dennis. So do you see the Load library successful message? Also, if I remember correctly, the code in eval.java is not a safe way to load a native library. It's a very good idea to place the System.loadLibrary in a static { } block, instead of in a method. The way your class is written, it's possible for the run method to be executed more than once, in which case loadLibrary will be called more than once (and so will the native initModels). Not sure what the effects are and if it's related to your problem but it's a good idea to avoid trouble by fixing it. Shay On Fri, Jul 2, 2010 at 3:46 AM, dennis ch dennis.ch2...@gmail.com wrote: Hi, I have a java class (eval.java) that invokes a native method in an so file (libmodel.so, using SWIG 1.3.29 to generate JNI code/wrapper and compiled the library). I can use System.loadLibrary() to load the libmodel.so without any error (-Djava.library.path=/usr/lib), and the native method initModel() works fine as a standalone application. However, when I deploy it as a web service (tomcat 6.0.26 + axis2 1.5.1 + eclipse jee helios) to call the native method, I got the following error (the first line means the .so was successfully loaded): Load library successfully [ERROR] com.model.modelJNI.initModel()V java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:194) at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:102) at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40) at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:114) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:173) at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:167) at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:142) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.UnsatisfiedLinkError: com.model.modelJNI.initModel()V at com.model.modelJNI.initModel(Native Method) at com.model.model.initModel(model.java:13) at com.webservice.run(EvalVita.java:763) ... 25 more Below is the body of Eval.java: import com.model.*; public class Eval { static void loadModel() { try { System.loadLibrary(model); System.out.println(Load library successfully); } catch (UnsatisfiedLinkError e) { System.err.println(Native code library failed to load. + e); } } public void run() { loadModel(); model.initModel(); } } Do I miss anything here? Any input is appreciated! Dennis
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.clinit(Toolkit.java:1530) at java.awt.Color.clinit(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
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
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: - 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?
) = /lib/libdevmapper.so.1.02.1 libdes425.so.3 (libc6,x86-64) = /usr/lib/libdes425.so.3 libdbus-1.so.3 (libc6,x86-64) = /usr/lib/libdbus-1.so.3 libdb-4.6.so (libc6,x86-64) = /usr/lib/libdb-4.6.so libdb-4.5.so (libc6,x86-64) = /usr/lib/libdb-4.5.so libdatrie.so.0 (libc6,x86-64) = /usr/lib/libdatrie.so.0 libdaemon.so.0 (libc6,x86-64) = /usr/lib/libdaemon.so.0 libcwidget.so.3 (libc6,x86-64) = /usr/lib/libcwidget.so.3 libcups.so.2 (libc6,x86-64) = /usr/lib/libcups.so.2 libctutils.so.0 (libc6,x86-64) = /lib/libctutils.so.0 libcrypto.so.0.9.8 (libc6,x86-64) = /usr/lib/libcrypto.so.0.9.8 libcrypt.so.1 (libc6,x86-64, OS ABI: Linux 2.6.8) = /lib/libcrypt.so.1 libconsole.so.0 (libc6,x86-64) = /lib/libconsole.so.0 libcom_err.so.2 (libc6,x86-64) = /lib/libcom_err.so.2 libcidn.so.1 (libc6,x86-64, OS ABI: Linux 2.6.8) = /lib/libcidn.so.1 libcfont.so.0 (libc6,x86-64) = /lib/libcfont.so.0 libcap.so.2 (libc6,x86-64) = /lib/libcap.so.2 libcap.so.1 (libc6,x86-64) = /lib/libcap.so.1 libcairo.so.2 (libc6,x86-64) = /usr/lib/libcairo.so.2 libc.so.6 (libc6,x86-64, OS ABI: Linux 2.6.8) = /lib/libc.so.6 libbz2.so.1.0 (libc6,x86-64) = /lib/libbz2.so.1.0 libblkid.so.1 (libc6,x86-64) = /lib/libblkid.so.1 libbind9.so.40 (libc6,x86-64) = /usr/lib/libbind9.so.40 libavahi-core.so.5 (libc6,x86-64) = /usr/lib/libavahi-core.so.5 libavahi-common.so.3 (libc6,x86-64) = /usr/lib/libavahi-common.so.3 libattr.so.1 (libc6,x86-64) = /lib/libattr.so.1 libatk-1.0.so.0 (libc6,x86-64) = /usr/lib/libatk-1.0.so.0 libasound.so.2 (libc6,x86-64) = /usr/lib/libasound.so.2 libapt-pkg-libc6.7-6.so.4.6 (libc6,x86-64) = /usr/lib/libapt-pkg-libc6.7-6.so.4.6 libapt-inst-libc6.7-6.so.1.1 (libc6,x86-64) = /usr/lib/libapt-inst-libc6.7-6.so.1.1 libanl.so.1 (libc6,x86-64, OS ABI: Linux 2.6.8) = /lib/libanl.so.1 libacl.so.1 (libc6,x86-64) = /lib/libacl.so.1 libX11.so.6 (libc6,x86-64) = /usr/lib/libX11.so.6 libXtst.so.6 (libc6,x86-64) = /usr/lib/libXtst.so.6 libXt.so.6 (libc6,x86-64) = /usr/lib/libXt.so.6 libXrender.so.1 (libc6,x86-64) = /usr/lib/libXrender.so.1 libXrandr.so.2 (libc6,x86-64) = /usr/lib/libXrandr.so.2 libXp.so.6 (libc6,x86-64) = /usr/lib/libXp.so.6 libXmuu.so.1 (libc6,x86-64) = /usr/lib/libXmuu.so.1 libXinerama.so.1 (libc6,x86-64) = /usr/lib/libXinerama.so.1 libXi.so.6 (libc6,x86-64) = /usr/lib/libXi.so.6 libXft.so.2 (libc6,x86-64) = /usr/lib/libXft.so.2 libXfont.so.1 (libc6,x86-64) = /usr/lib/libXfont.so.1 libXfixes.so.3 (libc6,x86-64) = /usr/lib/libXfixes.so.3 libXext.so.6 (libc6,x86-64) = /usr/lib/libXext.so.6 libXdmcp.so.6 (libc6,x86-64) = /usr/lib/libXdmcp.so.6 libXdamage.so.1 (libc6,x86-64) = /usr/lib/libXdamage.so.1 libXcursor.so.1 (libc6,x86-64) = /usr/lib/libXcursor.so.1 libXcomposite.so.1 (libc6,x86-64) = /usr/lib/libXcomposite.so.1 libXau.so.6 (libc6,x86-64) = /usr/lib/libXau.so.6 libSegFault.so (libc6,x86-64, OS ABI: Linux 2.6.8) = /lib/libSegFault.so libSM.so.6 (libc6,x86-64) = /usr/lib/libSM.so.6 libICE.so.6 (libc6,x86-64) = /usr/lib/libICE.so.6 libBrokenLocale.so.1 (libc6,x86-64, OS ABI: Linux 2.6.8) = /lib/libBrokenLocale.so.1 ld-linux-x86-64.so.2 (libc6,x86-64) = /lib/ld-linux-x86-64.so.2 but I still don't know how to check the value of java.library.path and how to run servlets from command line. Michael Ludwig-4 wrote: 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 -- View this message in context: http://www.nabble.com/java.lang.UnsatisfiedLinkError%3A-running-tomcat-on-java-headless--tp25220313p25222024.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@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?
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?
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?
-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?
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
java.lang.UnsatisfiedLinkError
Hi, I am getting the below error when i try to open eMatrix web application. I am using Tomcat 5.0. can any one please provide me solution for this. HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: no eMatrix in java.library.path org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758) org.apache.jsp.emxLogin_jsp._jspService(emxLogin_jsp.java:703) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) com.matrixone.servlet.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:173) root cause java.lang.UnsatisfiedLinkError: no eMatrix in java.library.path java.lang.ClassLoader.loadLibrary(ClassLoader.java:1517) java.lang.Runtime.loadLibrary0(Runtime.java:788) java.lang.System.loadLibrary(System.java:834) com.matrixone.jni.MatrixKernel.getKernel(MatrixKernel.java:49) com.matrixone.jni.MatrixKernel.getKernel(MatrixKernel.java:42) com.matrixone.jdl.rmi.bosErrorObjectImpl.init(bosErrorObjectImpl.java:10) com.matrixone.jdl.rmi.bosInterfaceImpl.init(bosInterfaceImpl.java:52) com.matrixone.jdl.MatrixJNISession.getInterface(MatrixJNISession.java:33) com.matrixone.jdl.MatrixRMISession.getInterface(MatrixRMISession.java:49) matrix.db.Context.getInterface(Context.java:861) matrix.db.Context.getContext(Context.java:922) matrix.db.Context.setLanguage(Context.java:515) matrix.db.Context.setLocale(Context.java:584) com.matrixone.servlet.ServletUtil.checkAuthentication(ServletUtil.java:86) com.matrixone.servlet.FrameworkServlet.isLoggedIn(FrameworkServlet.java:623) com.matrixone.servlet.FrameworkServlet.isLoggedIn(FrameworkServlet.java:610) com.matrixone.servlet.Framework.isLoggedIn(Framework.java:399) org.apache.jsp.emxLogin_jsp._jspService(emxLogin_jsp.java:243) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) com.matrixone.servlet.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:173) note The full stack trace of the root cause is available in the Apache Tomcat/5.0.27 logs. Apache Tomcat/5.0.27 -- View this message in context: http://www.nabble.com/java.lang.UnsatisfiedLinkError-tp20832248p20832248.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: java.lang.UnsatisfiedLinkError
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 the jvm can't find a native library, which will be called libeMatrix.so on a *nix system, or eMatrix.dll on win. This library should be somewhere in the eMatrix distribution and you must make sure that it's on the java.library.path, which you can find out using System.out.println(System.getProperty(java.library.path)); but /lib and /usr/lib usually work on nix. xhd634 wrote: Hi, I am getting the below error when i try to open eMatrix web application. I am using Tomcat 5.0. can any one please provide me solution for this. HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: no eMatrix in java.library.path org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758) org.apache.jsp.emxLogin_jsp._jspService(emxLogin_jsp.java:703) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) com.matrixone.servlet.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:173) root cause java.lang.UnsatisfiedLinkError: no eMatrix in java.library.path java.lang.ClassLoader.loadLibrary(ClassLoader.java:1517) java.lang.Runtime.loadLibrary0(Runtime.java:788) java.lang.System.loadLibrary(System.java:834) com.matrixone.jni.MatrixKernel.getKernel(MatrixKernel.java:49) com.matrixone.jni.MatrixKernel.getKernel(MatrixKernel.java:42) com.matrixone.jdl.rmi.bosErrorObjectImpl.init(bosErrorObjectImpl.java:10) com.matrixone.jdl.rmi.bosInterfaceImpl.init(bosInterfaceImpl.java:52) com.matrixone.jdl.MatrixJNISession.getInterface(MatrixJNISession.java:33) com.matrixone.jdl.MatrixRMISession.getInterface(MatrixRMISession.java:49) matrix.db.Context.getInterface(Context.java:861) matrix.db.Context.getContext(Context.java:922) matrix.db.Context.setLanguage(Context.java:515) matrix.db.Context.setLocale(Context.java:584) com.matrixone.servlet.ServletUtil.checkAuthentication(ServletUtil.java:86) com.matrixone.servlet.FrameworkServlet.isLoggedIn(FrameworkServlet.java:623) com.matrixone.servlet.FrameworkServlet.isLoggedIn(FrameworkServlet.java:610) com.matrixone.servlet.Framework.isLoggedIn(Framework.java:399) org.apache.jsp.emxLogin_jsp._jspService(emxLogin_jsp.java:243) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) com.matrixone.servlet.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:173) note The full stack trace of the root cause is available in the Apache Tomcat/5.0.27 logs. Apache Tomcat/5.0.27 -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkk305AACgkQ0JfS0fIxFN19rQCeJo/2S/5vYIk/VLffKmzVVgVp OdcAn3WBhqPG3y/70wAdbjSMrQRxEqfh =SaSP -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]