Help,error while trying to integrate apache and tomcat with jni
I tried hard these days to make tomcat and apache work together with jni but only to find these in the [apache_home_dir]/logs/error_log * error_log * [Tue Mar 23 08:37:46 2004] [notice] Apache/2.0.49 (Unix) mod_jk2/2.0.2 configure d -- resuming normal operations [Tue Mar 23 08:37:46 2004] [error] jk2_init() Can't find child 25455 in scoreboa rd [Tue Mar 23 08:37:46 2004] [error] jk2_init() Can't find child 25456 in scoreboa rd [Tue Mar 23 08:37:46 2004] [error] jk2_init() Can't find child 25457 in scoreboa rd .and many many as this Then my site(was served ok by apache) become unvisible It seemed the apache child proccess was unable to startup,it starts and down immediately and it try again to start and ... I am using Redhat linux 9.0,j2sdk1.4.2_03,apache 2.0.49 and tomcat 4.1.30 Here is my workers2.properties *** workers2.properties *** [config:] file=${serverRoot}/conf/workers2.properties debug=0 debugEnv=0 [shm:] disabled=1 [channel.jni:jni] info=The jni channel, used if tomcat is started inprocess [vm:] info=Parameters used to load a JVM in the server process JVM=/usr/java/j2sdk1.4.2_03/jre/lib/i386/server/libjvm.so classpath=/usr/tomcat/tomcat4/lib OPT=-Dtomcat.home=/usr/tomcat/tomcat4 OPT=-Dcatalina.home=/usr/tomcat/tomcat4 OPT=-Xmx128M disabled=0 [worker.jni:onStartup] info=Command to be executed by the VM on startup. This one will start tomcat. class=org/apache/jk/apr/TomcatStarter ARG=start disabled=0 stdout=${serverRoot}/logs/stdout.log stderr=${serverRoot}/logs/stderr.log [worker.jni:onShutdown] info=Command to be executed by the VM on shutdown. This one will stop tomcat. class=org/apache/jk/apr/TomcatStarter ARG=stop disabled=0 [status:] info=Status worker, displays runtime informations [uri:/jkstatus/*] info=Display status information and checks the config file for changes. group=status: [uri:/jsp-examples/*] info=Map the whole webapp (for tomcat5) And here is the jk2.properties *** jk2.properties *** handler.list=apr,request,channelJni apr.jniModeSo=inprocess the comments was ommited I really don't know what to do, please help me. _ MSN Toolbar provides one-click access to Hotmail from any Web page FREE download! http://clk.atdmt.com/AVE/go/onm00200413ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Error while trying to integrate apache and tomcat with jni
Hi, I tried hard these days to make tomcat and apache work together with jni but only to find this in the [apache_home_dir]/logs/error_log * error_log * [Tue Mar 23 08:37:46 2004] [notice] Apache/2.0.49 (Unix) mod_jk2/2.0.2 configure d -- resuming normal operations [Tue Mar 23 08:37:46 2004] [error] jk2_init() Can't find child 25455 in scoreboa rd [Tue Mar 23 08:37:46 2004] [error] jk2_init() Can't find child 25456 in scoreboa rd [Tue Mar 23 08:37:46 2004] [error] jk2_init() Can't find child 25457 in scoreboa rd .and many many as this Then my site(was served ok by apache) become unvisible It seemed the apache child proccess was unable to startup,it starts and down immediately and it try again to start and ... I am using redhat linux 9.0,j2sdk1.4.2_03,apache 2.0.49 and tomcat 4.1.30 Here is my workers2.properties *** workers2.properties *** [config:] file=${serverRoot}/conf/workers2.properties debug=0 debugEnv=0 [shm:] disabled=1 [channel.jni:jni] info=The jni channel, used if tomcat is started inprocess [vm:] info=Parameters used to load a JVM in the server process JVM=/usr/java/j2sdk1.4.2_03/jre/lib/i386/server/libjvm.so classpath=/usr/tomcat/tomcat4/lib OPT=-Dtomcat.home=/usr/tomcat/tomcat4 OPT=-Dcatalina.home=/usr/tomcat/tomcat4 OPT=-Xmx128M disabled=0 [worker.jni:onStartup] info=Command to be executed by the VM on startup. This one will start tomcat. class=org/apache/jk/apr/TomcatStarter ARG=start disabled=0 stdout=${serverRoot}/logs/stdout.log stderr=${serverRoot}/logs/stderr.log [worker.jni:onShutdown] info=Command to be executed by the VM on shutdown. This one will stop tomcat. class=org/apache/jk/apr/TomcatStarter ARG=stop disabled=0 [status:] info=Status worker, displays runtime informations [uri:/jkstatus/*] info=Display status information and checks the config file for changes. group=status: [uri:/jsp-examples/*] info=Map the whole webapp (for tomcat5) And here is the jk2.properties *** jk2.properties *** handler.list=apr,request,channelJni apr.jniModeSo=inprocess the comments was ommited I really don't know what to do, and really need your help. _ FREE pop-up blocking with the new MSN Toolbar get it now! http://toolbar.msn.com/go/onm00200415ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Error while trying to integrate apache and tomcat with jni
I don't believe you can run Tomcat inprocess with Apache on Unix. You need to use sockets. -Original Message- From: Zheng Neil [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 23, 2004 7:58 PM To: [EMAIL PROTECTED] Subject: Error while trying to integrate apache and tomcat with jni Hi, I tried hard these days to make tomcat and apache work together with jni but only to find this in the [apache_home_dir]/logs/error_log * error_log * [Tue Mar 23 08:37:46 2004] [notice] Apache/2.0.49 (Unix) mod_jk2/2.0.2 configure d -- resuming normal operations [Tue Mar 23 08:37:46 2004] [error] jk2_init() Can't find child 25455 in scoreboa rd [Tue Mar 23 08:37:46 2004] [error] jk2_init() Can't find child 25456 in scoreboa rd [Tue Mar 23 08:37:46 2004] [error] jk2_init() Can't find child 25457 in scoreboa rd .and many many as this Then my site(was served ok by apache) become unvisible It seemed the apache child proccess was unable to startup,it starts and down immediately and it try again to start and ... I am using redhat linux 9.0,j2sdk1.4.2_03,apache 2.0.49 and tomcat 4.1.30 Here is my workers2.properties *** workers2.properties *** [config:] file=${serverRoot}/conf/workers2.properties debug=0 debugEnv=0 [shm:] disabled=1 [channel.jni:jni] info=The jni channel, used if tomcat is started inprocess [vm:] info=Parameters used to load a JVM in the server process JVM=/usr/java/j2sdk1.4.2_03/jre/lib/i386/server/libjvm.so classpath=/usr/tomcat/tomcat4/lib OPT=-Dtomcat.home=/usr/tomcat/tomcat4 OPT=-Dcatalina.home=/usr/tomcat/tomcat4 OPT=-Xmx128M disabled=0 [worker.jni:onStartup] info=Command to be executed by the VM on startup. This one will start tomcat. class=org/apache/jk/apr/TomcatStarter ARG=start disabled=0 stdout=${serverRoot}/logs/stdout.log stderr=${serverRoot}/logs/stderr.log [worker.jni:onShutdown] info=Command to be executed by the VM on shutdown. This one will stop tomcat. class=org/apache/jk/apr/TomcatStarter ARG=stop disabled=0 [status:] info=Status worker, displays runtime informations [uri:/jkstatus/*] info=Display status information and checks the config file for changes. group=status: [uri:/jsp-examples/*] info=Map the whole webapp (for tomcat5) And here is the jk2.properties *** jk2.properties *** handler.list=apr,request,channelJni apr.jniModeSo=inprocess the comments was ommited I really don't know what to do, and really need your help. _ FREE pop-up blocking with the new MSN Toolbar get it now! http://toolbar.msn.com/go/onm00200415ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Error while trying to integrate apache and tomcat with jni
Thank you for telling me this.But can i ask why? Yes,I have already have apache2.0.40 and tomcat5.19 running together using ajp13. From: David Short [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Subject: RE: Error while trying to integrate apache and tomcat with jni Date: Tue, 23 Mar 2004 20:06:51 -0800 I don't believe you can run Tomcat inprocess with Apache on Unix. You need to use sockets. -Original Message- From: Zheng Neil [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 23, 2004 7:58 PM To: [EMAIL PROTECTED] Subject: Error while trying to integrate apache and tomcat with jni Hi, I tried hard these days to make tomcat and apache work together with jni but only to find this in the [apache_home_dir]/logs/error_log * error_log * [Tue Mar 23 08:37:46 2004] [notice] Apache/2.0.49 (Unix) mod_jk2/2.0.2 configure d -- resuming normal operations [Tue Mar 23 08:37:46 2004] [error] jk2_init() Can't find child 25455 in scoreboa rd [Tue Mar 23 08:37:46 2004] [error] jk2_init() Can't find child 25456 in scoreboa rd [Tue Mar 23 08:37:46 2004] [error] jk2_init() Can't find child 25457 in scoreboa rd .and many many as this Then my site(was served ok by apache) become unvisible It seemed the apache child proccess was unable to startup,it starts and down immediately and it try again to start and ... I am using redhat linux 9.0,j2sdk1.4.2_03,apache 2.0.49 and tomcat 4.1.30 Here is my workers2.properties *** workers2.properties *** [config:] file=${serverRoot}/conf/workers2.properties debug=0 debugEnv=0 [shm:] disabled=1 [channel.jni:jni] info=The jni channel, used if tomcat is started inprocess [vm:] info=Parameters used to load a JVM in the server process JVM=/usr/java/j2sdk1.4.2_03/jre/lib/i386/server/libjvm.so classpath=/usr/tomcat/tomcat4/lib OPT=-Dtomcat.home=/usr/tomcat/tomcat4 OPT=-Dcatalina.home=/usr/tomcat/tomcat4 OPT=-Xmx128M disabled=0 [worker.jni:onStartup] info=Command to be executed by the VM on startup. This one will start tomcat. class=org/apache/jk/apr/TomcatStarter ARG=start disabled=0 stdout=${serverRoot}/logs/stdout.log stderr=${serverRoot}/logs/stderr.log [worker.jni:onShutdown] info=Command to be executed by the VM on shutdown. This one will stop tomcat. class=org/apache/jk/apr/TomcatStarter ARG=stop disabled=0 [status:] info=Status worker, displays runtime informations [uri:/jkstatus/*] info=Display status information and checks the config file for changes. group=status: [uri:/jsp-examples/*] info=Map the whole webapp (for tomcat5) And here is the jk2.properties *** jk2.properties *** handler.list=apr,request,channelJni apr.jniModeSo=inprocess the comments was ommited I really don't know what to do, and really need your help. _ FREE pop-up blocking with the new MSN Toolbar ?get it now! http://toolbar.msn.com/go/onm00200415ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Is your PC infected? Get a FREE online computer virus scan from McAfee® Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Error while trying to integrate apache and tomcat with jni
Don't know, you'll have to ask the developers. I read it here on the list. Just trying to help you avoid a little pain. -Original Message- From: Zheng Neil [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 23, 2004 8:22 PM To: [EMAIL PROTECTED] Subject: RE: Error while trying to integrate apache and tomcat with jni Thank you for telling me this.But can i ask why? Yes,I have already have apache2.0.40 and tomcat5.19 running together using ajp13. From: David Short [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Subject: RE: Error while trying to integrate apache and tomcat with jni Date: Tue, 23 Mar 2004 20:06:51 -0800 I don't believe you can run Tomcat inprocess with Apache on Unix. You need to use sockets. -Original Message- From: Zheng Neil [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 23, 2004 7:58 PM To: [EMAIL PROTECTED] Subject: Error while trying to integrate apache and tomcat with jni Hi, I tried hard these days to make tomcat and apache work together with jni but only to find this in the [apache_home_dir]/logs/error_log * error_log * [Tue Mar 23 08:37:46 2004] [notice] Apache/2.0.49 (Unix) mod_jk2/2.0.2 configure d -- resuming normal operations [Tue Mar 23 08:37:46 2004] [error] jk2_init() Can't find child 25455 in scoreboa rd [Tue Mar 23 08:37:46 2004] [error] jk2_init() Can't find child 25456 in scoreboa rd [Tue Mar 23 08:37:46 2004] [error] jk2_init() Can't find child 25457 in scoreboa rd .and many many as this Then my site(was served ok by apache) become unvisible It seemed the apache child proccess was unable to startup,it starts and down immediately and it try again to start and ... I am using redhat linux 9.0,j2sdk1.4.2_03,apache 2.0.49 and tomcat 4.1.30 Here is my workers2.properties *** workers2.properties *** [config:] file=${serverRoot}/conf/workers2.properties debug=0 debugEnv=0 [shm:] disabled=1 [channel.jni:jni] info=The jni channel, used if tomcat is started inprocess [vm:] info=Parameters used to load a JVM in the server process JVM=/usr/java/j2sdk1.4.2_03/jre/lib/i386/server/libjvm.so classpath=/usr/tomcat/tomcat4/lib OPT=-Dtomcat.home=/usr/tomcat/tomcat4 OPT=-Dcatalina.home=/usr/tomcat/tomcat4 OPT=-Xmx128M disabled=0 [worker.jni:onStartup] info=Command to be executed by the VM on startup. This one will start tomcat. class=org/apache/jk/apr/TomcatStarter ARG=start disabled=0 stdout=${serverRoot}/logs/stdout.log stderr=${serverRoot}/logs/stderr.log [worker.jni:onShutdown] info=Command to be executed by the VM on shutdown. This one will stop tomcat. class=org/apache/jk/apr/TomcatStarter ARG=stop disabled=0 [status:] info=Status worker, displays runtime informations [uri:/jkstatus/*] info=Display status information and checks the config file for changes. group=status: [uri:/jsp-examples/*] info=Map the whole webapp (for tomcat5) And here is the jk2.properties *** jk2.properties *** handler.list=apr,request,channelJni apr.jniModeSo=inprocess the comments was ommited I really don't know what to do, and really need your help. _ FREE pop-up blocking with the new MSN Toolbar ?get it now! http://toolbar.msn.com/go/onm00200415ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Is your PC infected? Get a FREE online computer virus scan from McAfee® Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
FW: Regarding Tomcat and JNI based webapps...
Hi: I am deploying Axis based web services in Tomcat (4.0.6). My web app .jar files need to be dynamically updated... However, since some of the helper .jar files use Native (JNI) dlls, I am unable to do this...I get the following error when Axis tries to re-load the web app? WebappClassLoader: Lifecycle error : CL stopped I was trying to place the common helper .jar files in the common\lib folder...Please help regards Somesh Marepalli
TOMCAT and JNI problem...
Hello. I'm running a JSP based Web aplicacion using Tomcat wich uses a Java Class that loads a native library (JNI). The files are created as follows: javac extractor/HTDInterface.java javah extractor.HTDInterface then I compile my c++ source code with the header file extractor_HTDInterface.h to create the shared library libhtd.so create a jar file with the Class that implements JNI call static { System.loadLibrary(htd); jar cvf extractor.jar extractor/HTDInterface.class For testing a standalone application I set my CLASSPATH to include extractor.jar and libhtd.so file is placed inside the JDK at /JAVA_HOME/jre/lib/i386/ I successfully build and run The standalone application usin the shared library. For the web application, extractor.jar is placed at /common/lib/ TOMCAT directory I leave the libhtd.so at the /JAVA_HOME/jre/lib/i386/ JDK directory. When my JSP based Web application calls the native library method the Tomcat just STOPS it doesn't work STOPS The message is: The connection was refused when attempting to contact localhost:8080 I have to run startup.sh script again. I took off the libhtd.so file from /JAVA_HOME/jre/lib/i386/ and I placed it in a different directory outside the tomcat: /home/myuser/lib/libhtd.so Then I made a script to start the tomcat with the LD_LIBRARY_PATH environment variable set up: - #!/bin/sh export JAVA_HOME=/opt/java export CATALINA_HOME=/usr/local/jakarta-tomcat export PATH=${JAVA_HOME}/bin:${PATH} export JAVA_PATH=${JAVA_HOME} # path to load the libhtd.so shared library export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/home/myuser/lib cd /usr/local/jakarta-tomcat/bin sh startup.sh - BUT the same happens when the Web application calls the native library method the Tomcat just STOPS it doesn't work ..STOPS The message is: The connection was refused when attempting to contact localhost:8080 just like when you try to load the web application and the TOMCAT server is not UP. Does anyone knows how to solve this I have read that maybe setting up the CATALINA_OPTS environment variable can solve this problem BUT I dont know how to set that variable. ??? I hope this time I've made myself clear Another thing: I'm working under Red Hat 9.0 TOMCAT 4.1.27 and JDK 1.4.2 Pablo Vidal _ MSN Amor: busca tu ½ naranja http://latam.msn.com/amor/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: TOMCAT and JNI problem...
Then I made a script to start the tomcat with the LD_LIBRARY_PATH environment variable set up: - #!/bin/sh export JAVA_HOME=/opt/java export CATALINA_HOME=/usr/local/jakarta-tomcat export PATH=${JAVA_HOME}/bin:${PATH} export JAVA_PATH=${JAVA_HOME} # path to load the libhtd.so shared library export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/home/myuser/lib cd /usr/local/jakarta-tomcat/bin sh startup.sh - Did you try to startup Tomcat with the same script, without using your library, in order to check if the script works right? Sometimes I had such error when I forgot to set JAVA_HOME or CATALINA_HOME properly :-))) G -- Giuseppe Briotti [EMAIL PROTECTED] Alme Sol, curru nitido diem qui promis et celas aliusque et idem nasceris, possis nihil urbe Roma visere maius. (Orazio) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: TOMCAT and JNI problem...
Did you try to startup Tomcat with the same script, without using your library, in order to check if the script works right? YES I start up the tomcat with the same script to test other applications that doesn't work with JNI and everything goes fine. Pablo Vidal From: Giuseppe Briotti [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: TOMCAT and JNI problem... Date: Mon, 26 Jan 2004 17:29:02 +0100 (CET) Then I made a script to start the tomcat with the LD_LIBRARY_PATH environment variable set up: - #!/bin/sh export JAVA_HOME=/opt/java export CATALINA_HOME=/usr/local/jakarta-tomcat export PATH=${JAVA_HOME}/bin:${PATH} export JAVA_PATH=${JAVA_HOME} # path to load the libhtd.so shared library export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/home/myuser/lib cd /usr/local/jakarta-tomcat/bin sh startup.sh - Did you try to startup Tomcat with the same script, without using your library, in order to check if the script works right? Sometimes I had such error when I forgot to set JAVA_HOME or CATALINA_HOME properly :-))) G -- Giuseppe Briotti [EMAIL PROTECTED] Alme Sol, curru nitido diem qui promis et celas aliusque et idem nasceris, possis nihil urbe Roma visere maius. (Orazio) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: TOMCAT and JNI problem...
Hi Pablo we also use JNI in our web apps. it works (except the reloading issue, but that's another story). we use the ./bin/setenv.sh script for our settings, therefore: ... # must contain the ACE Agent JNI library libaceagent.so: LD_LIBRARY_PATH=/home/bgo/deploy/sr-hls/native export LD_LIBRARY_PATH ... I assume, your JNI implementation is somehow broken... and this makes Tomcat stop... but that's just a wild guess from far away... regards -Bernd. -Original Message- From: J.Pablo M [mailto:[EMAIL PROTECTED] Sent: Montag, 26. Januar 2004 17:20 To: [EMAIL PROTECTED] Subject: TOMCAT and JNI problem... Hello. I'm running a JSP based Web aplicacion using Tomcat wich uses a Java Class that loads a native library (JNI). The files are created as follows: javac extractor/HTDInterface.java javah extractor.HTDInterface then I compile my c++ source code with the header file extractor_HTDInterface.h to create the shared library libhtd.so create a jar file with the Class that implements JNI call static { System.loadLibrary(htd); jar cvf extractor.jar extractor/HTDInterface.class For testing a standalone application I set my CLASSPATH to include extractor.jar and libhtd.so file is placed inside the JDK at /JAVA_HOME/jre/lib/i386/ I successfully build and run The standalone application usin the shared library. For the web application, extractor.jar is placed at /common/lib/ TOMCAT directory I leave the libhtd.so at the /JAVA_HOME/jre/lib/i386/ JDK directory. When my JSP based Web application calls the native library method the Tomcat just STOPS it doesn't work STOPS The message is: The connection was refused when attempting to contact localhost:8080 I have to run startup.sh script again. I took off the libhtd.so file from /JAVA_HOME/jre/lib/i386/ and I placed it in a different directory outside the tomcat: /home/myuser/lib/libhtd.so Then I made a script to start the tomcat with the LD_LIBRARY_PATH environment variable set up: - #!/bin/sh export JAVA_HOME=/opt/java export CATALINA_HOME=/usr/local/jakarta-tomcat export PATH=${JAVA_HOME}/bin:${PATH} export JAVA_PATH=${JAVA_HOME} # path to load the libhtd.so shared library export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/home/myuser/lib cd /usr/local/jakarta-tomcat/bin sh startup.sh - BUT the same happens when the Web application calls the native library method the Tomcat just STOPS it doesn't work ..STOPS The message is: The connection was refused when attempting to contact localhost:8080 just like when you try to load the web application and the TOMCAT server is not UP. Does anyone knows how to solve this I have read that maybe setting up the CATALINA_OPTS environment variable can solve this problem BUT I dont know how to set that variable. ??? I hope this time I've made myself clear Another thing: I'm working under Red Hat 9.0 TOMCAT 4.1.27 and JDK 1.4.2 Pablo Vidal _ MSN Amor: busca tu ½ naranja http://latam.msn.com/amor/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problems with Tomcat and JNI
Pablo - What do you mean by Tomcat Crash, is there an exception message at all? If you aren't using a web-application where you could see the error message on the displayed page, you can check the Tomcat logs to see what Tomcat is complaining about prior to the crash. I have two different web-applications that use JNI to access a C device driver and a VB DLL for some server software on one of our cabinets. In general, we would get something along the lines of an unsatisfied link error on the line where you first make a call to the native function (not where you do the System.loadLibrary(XXX), that usually succeeds). The problem for me (and a fellow developer attempting something similar) was that when we created the JNI header file javah -jni ... (-jni is now a default, so its unnecessary to specify it) we didn't include the entire path to the package/class of the java file using the jni. Generally with jni (at least in my exp.), you end up with a header file created by jni that has a very long name - as it includes the entire path to the class file that uses the jni functions (such as mil_navy_XXX_XXX_XXX.h) in my case. If you have created this header file incorrectly, you will still be able to run the application statically - but as soon as you run it through tomcat and it attempts to go through the JNI to access the native function, it will fail because it cannot link to the appropriate location for the function. Eden -Original Message- From: J.Pablo M [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 1:00 PM To: [EMAIL PROTECTED] Subject: Problems with Tomcat and JNI Hi. I'm runnin a Web aplicacion wich uses a Java Class that loads a native library (JNI). This Class is placed in a jar file at /common/lib/ The .so file is placed inside the jdk at /JAVA_HOME/jre/lib/i386/ I sucesfully build and test an standalone application to the use of the JNI. But when I test the Class method in the Web aplication with Tomcat, as soon as I try to use the native metod, the Tomcat CRASH. I dont know if must keep the .so file placed at the jdk directory mencioned above, otherwise... WHERE shoud I place the .so file ?? Juan Pablo Muñoz Vidal _ MSN Amor: busca tu ½ naranja http://latam.msn.com/amor/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problems with Tomcat and JNI
Hi. I'm runnin a Web aplicacion wich uses a Java Class that loads a native library (JNI). This Class is placed in a jar file at /common/lib/ The .so file is placed inside the jdk at /JAVA_HOME/jre/lib/i386/ I sucesfully build and test an standalone application to the use of the JNI. But when I test the Class method in the Web aplication with Tomcat, as soon as I try to use the native metod, the Tomcat CRASH. I dont know if must keep the .so file placed at the jdk directory mencioned above, otherwise... WHERE shoud I place the .so file ?? Juan Pablo Muñoz Vidal _ MSN Amor: busca tu ½ naranja http://latam.msn.com/amor/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat/Apache2/JNI on Solaris Again
Has anyone been able to get Apache2 to start Tomcat 4.1.x on Solaris? There was a thread subject on this back in February, but there was no resolution that I can find. I am getting the following errors: [Fri Aug 29 12:47:25 2003] [error] env.createBean2(): Factory error creating channel.jni:jni ( channel.jni, jni) [Fri Aug 29 12:47:25 2003] [error] config.update(): Can't create channel.jni:jni [Fri Aug 29 12:47:25 2003] [error] env.createBean2(): Factory error creating vm: ( vm, ) [Fri Aug 29 12:47:25 2003] [error] config.update(): Can't create vm: [Fri Aug 29 12:47:25 2003] [error] env.createBean2(): Factory error creating worker.jni:onStartup ( worker.jni, onStartup) [Fri Aug 29 12:47:25 2003] [error] config.update(): Can't create worker.jni:onStartup [Fri Aug 29 12:47:25 2003] [error] env.createBean2(): Factory error creating worker.jni:onShutdown ( worker.jni, onShutdown) [Fri Aug 29 12:47:25 2003] [error] config.update(): Can't create worker.jni:onShutdown [Fri Aug 29 12:47:27 2003] [error] mod_jk child init 1 0 [Fri Aug 29 12:47:27 2003] [error] jk2_init() Can't find child 11765 in scoreboard [Fri Aug 29 12:47:27 2003] [error] mod_jk child init 1 -2 [Fri Aug 29 12:47:27 2003] [notice] Apache/2.0.47 (Unix) mod_jk2/2.0.3-dev configured -- resuming normal operations in the Apache error log. Have been able to get things working under Windows, but not on Solaris. Any help that you all can offer would be very greatly appriciated. Ron --=-=-=-=-=-=-=-=-oOo-=-=-=-=-=-=-=-=-- mailto:[EMAIL PROTECTED]Phone:(607)770-3701 BAE SYSTEMS Controls600 Main St Johnson City, NY 13790-1888 --=-=-=-=-=-=-=-=-===-=-=-=-=-=-=-=-=-- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat/Apache2/JNI on Solaris
Thanks for your reply, Paul. I did post my entire problem last week but maybe it was too much at once. My config is Solaris 8, Apache 2.0.43, TC 4.1.18, and JDK 1.4. I have used the default config that is specified on the jakarta JK2 website (not very helpful, unfortunately), but I just get more errors in apache's error log about the shm file in additional to the factory errors. I don't get any errors in catalina.out, but I get this error in apache once i start it: [error] env.createBean2(): Factory error creating channel.jni:jni ( channel.jni, jni) [error] config.update(): Can't create channel.jni:jni [error] env.createBean2(): Factory error creating vm: ( vm, ) [error] config.update(): Can't create vm: [error] env.createBean2(): Factory error creating worker.jni:onStartup ( worker.jni, onStartup) [error] config.update(): Can't create worker.jni:onStartup [error] env.createBean2(): Factory error creating worker.jni:onShutdown ( worker.jni, onShutdown) [error] config.update(): Can't create worker.jni:onShutdown [error] mod_jk child init 1 0 [notice] Apache/2.0.43 (Unix) mod_jk2/2.0.2 configured -- resuming normal operations [info] Server built: Feb 4 2003 11:38:17 [debug] prefork.c(1039): AcceptMutex: pthread (default: pthread) It seems to me like apache isn't able to start tomcat at all. I noticed that I get the same error even if I completely remove the jkjni.so file from the modules directory. Should I send more info? thanks again, -francesa Brzezinski, Paul J [EMAIL PROTECTED] wrote:Francesa Lacreativa wrote: Has anyone been able to get Apache2 to start tomcat 4 via JNI and the JK2 connector? on Solaris by chance? If so, could you please post or privately email me your configuration files (httpd.conf, workers2.properties, jk2.properties)? gracias, have you tried any of the latest builds? Are you getting errors in catalina.out? Please post your errors or give a little more detail about your config -- which flavor of J2SDK, what version of Apache, TomCat and the connectors you're using... I did get this work on TC 4.1.15 but ended up combining all the jars into $CATALINA_HOME/common/lib because of a classloader issue...don't know if that's been resolved yet...my config: Solaris 8, J2SE v1.4, Tomcat was the 4.1.15-JDK-1.4. - Do You Yahoo!? Todo lo que quieres saber de Estados Unidos, América Latina y el resto del Mundo. Visíta Yahoo! Noticias.
RE: Tomcat/Apache2/JNI on Solaris
-- mailto:[EMAIL PROTECTED] Enterprise Distributed Capabilities EDS Corporation 248-265-8283 : -Original Message- : From: Francesa Lacreativa [mailto:[EMAIL PROTECTED]] : Sent: Tuesday, February 11, 2003 10:03 AM : To: Tomcat Users List : Subject: Re: Tomcat/Apache2/JNI on Solaris : : : : Thanks for your reply, Paul. I did post my entire problem : last week but maybe it was too much at once. : My config is Solaris 8, Apache 2.0.43, TC 4.1.18, and JDK : 1.4. I have used the default config that is specified on the : jakarta JK2 website (not very helpful, unfortunately), but I : just get more errors in apache's error log about the shm file : in additional to the factory errors. I don't get any errors : in catalina.out, but I get this error in apache once i start it: Can you start Catalina directly w/o any errors? : [error] env.createBean2(): Factory error creating : channel.jni:jni ( channel.jni, jni) : [error] config.update(): Can't create channel.jni:jni : [error] env.createBean2(): Factory error creating vm: ( vm, ) : [error] config.update(): Can't create vm: : [error] env.createBean2(): Factory error creating : worker.jni:onStartup ( worker.jni, onStartup) : [error] config.update(): Can't create worker.jni:onStartup : [error] env.createBean2(): Factory error creating : worker.jni:onShutdown ( worker.jni, onShutdown) : [error] config.update(): Can't create worker.jni:onShutdown : [error] mod_jk child init 1 0 : [notice] Apache/2.0.43 (Unix) mod_jk2/2.0.2 configured -- : resuming normal operations : [info] Server built: Feb 4 2003 11:38:17 : [debug] prefork.c(1039): AcceptMutex: pthread (default: pthread) Didn't realize that you had posted last week -- sometimes I don't pay close attention to the list during the day, but look at the posts a little closer after hours. Can you (re)post your jk2.properties and workers2.properties including the full paths to each? One difference I noticed -- I have jkjni.so in $APACHE_HOME/lib/jkjni.so. I don't know if that makes a difference, maybe the default loc is now $APACHE_HOME/modules or maybe it doesn't make a difference in 4.1.18 TC. Paul : It seems to me like apache isn't able to start tomcat at all. : I noticed that I get the same error even if I completely : remove the jkjni.so file from the modules directory. : : Should I send more info? : : thanks again, : : -francesa : : : : : Brzezinski, Paul J [EMAIL PROTECTED] : wrote:Francesa Lacreativa wrote: : : Has anyone been able to get Apache2 to start tomcat 4 via JNI and the : JK2 connector? on Solaris by chance? If so, could you please post or : privately email me your configuration files (httpd.conf, : workers2.properties, jk2.properties)? : : gracias, : : : have you tried any of the latest builds? Are you getting errors in : catalina.out? Please post your errors or give a little more detail : about your config -- which flavor of J2SDK, what version of Apache, : TomCat and the connectors you're using... : : I did get this work on TC 4.1.15 but ended up combining all the jars : into $CATALINA_HOME/common/lib because of a classloader issue...don't : know if that's been resolved yet...my config: Solaris 8, J2SE v1.4, : Tomcat was the 4.1.15-JDK-1.4. : : : : - : Do You Yahoo!? : Todo lo que quieres saber de Estados Unidos, América Latina y : el resto del Mundo. : Visíta Yahoo! Noticias. : - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat/Apache2/JNI on Solaris
I had the same errors on linux (mod_jk2 4.1.18). I did a google search and all the success stories with mod_jk2/jni are on Microsoft Windows. Anybody know if mod_jk2 jni inprocess work under Unix? Francesa Lacreativa [EMAIL PROTECTED] wrote: --0-497224639-1044915285=:59810 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Has anyone been able to get Apache2 to start tomcat 4 via JNI and the JK2 connector? on Solaris by chance? If so, could you please post or privately email me your configuration files (httpd.conf, workers2.properties, jk2.properties)? gracias, -francesa - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat/Apache2/JNI on Solaris
One difference I noticed -- I have jkjni.so in = $APACHE_HOME/lib/jkjni.so. I don't know if that makes a difference, maybe the default loc is now $APACHE_HOME/modules or maybe it doesn't make a difference in 4.1.18 = TC. Paul Where exactly should jkjni.so live? the official tomcat document http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk2/installhowto.html says to put both mod_jk2.so and jkjni.so into the apache modules directory, which is what I did. On the other hand, the document: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk2/confighowto.html has the following: OPT=-Djava.class.path=${TOMCAT_HOME}/lib/tomcat-jni.jar;${TOMCAT_HOME}/lib/tomcat.jar and neither of the jar files exist in the respective directories. (btw, shouldn't it be : instead of ; between two jars?) This makes me suspect the acuaracy of the document. Do I have to set those OPT in the workers2.properties? I don't need to do any of those if I start tomcat manually. btw, where is {TOMCAT_HOME} defined, how does workers2.properties get that info? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat/Apache2/JNI on Solaris
That's exactly what I found: plenty of successes on windows - how ironic. I have been trying off and on for almost two weeks to get it working on Solaris, and I've been working with tomcat and apache for almost three years now. I am very interested in the JNI-based one process approach, but I'm beginning to think it's just vaporware on unix... liug [EMAIL PROTECTED] wrote: I had the same errors on linux (mod_jk2 4.1.18). I did a google search and all the success stories with mod_jk2/jni are on Microsoft Windows. Anybody know if mod_jk2 jni inprocess work under Unix? Francesa Lacreativa wrote: --0-497224639-1044915285=:59810 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Has anyone been able to get Apache2 to start tomcat 4 via JNI and the JK2 connector? on Solaris by chance? If so, could you please post or privately email me your configuration files (httpd.conf, workers2.properties, jk2.properties)? gracias, -francesa - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do You Yahoo!? Todo lo que quieres saber de Estados Unidos, América Latina y el resto del Mundo. Visíta Yahoo! Noticias.
Re: Tomcat/Apache2/JNI on Solaris
One difference I noticed -- I have jkjni.so in = $APACHE_HOME/lib/jkjni.so. I don't know if that makes a difference, maybe the default loc is now $APACHE_HOME/modules or maybe it doesn't make a difference in 4.1.18 = TC. Paul Where exactly should jkjni.so live? the official tomcat document http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk2/installhowto.html says to put both mod_jk2.so and jkjni.so into the apache modules directory, which is what I did. I have mine in both places (lib and modules) and it doesn't seem to make a difference. On the other hand, the document: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk2/confighowto.html has the following: OPT=-Djava.class.path=${TOMCAT_HOME}/lib/tomcat-jni.jar;${TOMCAT_HOME}/lib/tomcat.jar and neither of the jar files exist in the respective directories. (btw, shouldn't it be : instead of ; between two jars?) This makes me suspect the acuaracy of the document. that makes two of us. that documentation leaves much to be desired. but, of course, it's free... Do I have to set those OPT in the workers2.properties? I don't need to do any of those if I start tomcat manually. it doesn't seem to make a difference in my errors if all those optional arguments to the java vm (OPT) are omitted or in full swing. But I don't have it working yet so I can't say much. btw, where is {TOMCAT_HOME} defined, how does workers2.properties get that info? ${TOMCAT_HOME} is supposed to be defined in your environment variables of the executing user. try: echo $TOMCAT_HOME to see if you have it set. if you don't, either replace ${TOMCAT_HOME} with the full path to your tomcat install or set the environment variable in the .rc file for your shell (which could be any number of files depending on which shell you use. .profile often works for multiple shells). if i ever get mine working, i'll post the complete configuration for the group to see. Who knows, i might even right a HOWTO at this point... -francesa - Do You Yahoo!? Todo lo que quieres saber de Estados Unidos, América Latina y el resto del Mundo. Visíta Yahoo! Noticias.
Tomcat/Apache2/JNI on Solaris
Has anyone been able to get Apache2 to start tomcat 4 via JNI and the JK2 connector? on Solaris by chance? If so, could you please post or privately email me your configuration files (httpd.conf, workers2.properties, jk2.properties)? gracias, -francesa - Do You Yahoo!? Todo lo que quieres saber de Estados Unidos, América Latina y el resto del Mundo. Visíta Yahoo! Noticias.
Re: Tomcat/Apache2/JNI on Solaris
Francesa Lacreativa wrote: Has anyone been able to get Apache2 to start tomcat 4 via JNI and the JK2 connector? on Solaris by chance? If so, could you please post or privately email me your configuration files (httpd.conf, workers2.properties, jk2.properties)? gracias, have you tried any of the latest builds? Are you getting errors in catalina.out? Please post your errors or give a little more detail about your config -- which flavor of J2SDK, what version of Apache, TomCat and the connectors you're using... I did get this work on TC 4.1.15 but ended up combining all the jars into $CATALINA_HOME/common/lib because of a classloader issue...don't know if that's been resolved yet...my config: Solaris 8, J2SE v1.4, Tomcat was the 4.1.15-JDK-1.4. -francesa - Do You Yahoo!? Todo lo que quieres saber de Estados Unidos, América Latina y el resto del Mundo. Visíta Yahoo! Noticias. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat 4 JNI Help
I don't understand why I'm getting the following UnsatisfiedLinkError. The static initializer is finding and loading my library but when I then try to my method which calls native Method throws exception. Any thoughts please! Apache Tomcat/4.0.4 Starting service Tomcat-Apache Apache Tomcat/4.0.4 JMatBean constructor JMatLink library loaded! JMatLink constructor JMatBean: jmat instance: Thread[Thread-2,5,main] Number of Java-Threads: 24 Name of active Java-Threads: Thread-3 active Java-Thread is Daemon: true JMatLink run method switch status: 0null Number of Java-Threads: 24 Name of active Java-Threads: Thread-3 active Java-Thread is Daemon: true JMatLink run method switch status: 13 /automation java.lang.UnsatisfiedLinkError: engOpenSingleUseNATIVE at com.gefa.JMatLink.engOpenSingleUseNATIVE(Compiled Code) at com.gefa.JMatLink.run(Compiled Code) at java.lang.Thread.run(Compiled Code) g GE Global Research Center _ __ Tom St.Louis Computer Scientist Advanced Computing Technologies One Research Circle, K1-5B32 Niskayuna, NY 12309 8*833-4900 [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org
RE: Tomcat 4 JNI Help
Pretty obvious isn't it? The JVM can't find the library. Since you didn't tell anyone what OS you are using, research how native libraries are loaded for your OS, put your native code there, and try again. -Original Message- From: St. Louis, Thomas (Research) [mailto:stlouis;crd.ge.com] Sent: 13 November, 2002 3:09 PM To: '[EMAIL PROTECTED]' Subject: Tomcat 4 JNI Help I don't understand why I'm getting the following UnsatisfiedLinkError. The static initializer is finding and loading my library but when I then try to my method which calls native Method throws exception. Any thoughts please! Apache Tomcat/4.0.4 Starting service Tomcat-Apache Apache Tomcat/4.0.4 JMatBean constructor JMatLink library loaded! JMatLink constructor JMatBean: jmat instance: Thread[Thread-2,5,main] Number of Java-Threads: 24 Name of active Java-Threads: Thread-3 active Java-Thread is Daemon: true JMatLink run method switch status: 0null Number of Java-Threads: 24 Name of active Java-Threads: Thread-3 active Java-Thread is Daemon: true JMatLink run method switch status: 13 /automation java.lang.UnsatisfiedLinkError: engOpenSingleUseNATIVE at com.gefa.JMatLink.engOpenSingleUseNATIVE(Compiled Code) at com.gefa.JMatLink.run(Compiled Code) at java.lang.Thread.run(Compiled Code) g GE Global Research Center _ __ Tom St.Louis Computer Scientist Advanced Computing Technologies One Research Circle, K1-5B32 Niskayuna, NY 12309 8*833-4900 [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:tomcat-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org
version recommendation for apache+tomcat via jni?
Hi. I'm trying to set up Tomcat and apache using the jni connector, but so far I've been unsuccessful. I've read that only Apache 2.x can do JNI since earlier versions are not thread-aware. Unfortunately, Tomcat 3.x doesn't have an Apache-2.x mod_jk. Tomcat 4.x also doesn't have an Apache-2.x compatible mod_jk, but does have an Apache-2.0 compatible mod_jk2. Unfortunately, when I tried Tomcat 4.0.4-b1 with Apache 2.0.36, it caused libjvm.so to crash while loading (An unexpected exception has been detected in native code outside the VM in libc's strlen())... Can anybody reccommend a fairly stable pair of Apache and Tomcat versions that can communicate using JNI? I'd prefer versions that are relitavely mature (ie non-beta) if that's possible. I'm using Solaris right now, but I'd like to be able to use the same configuration on Linux as well. Thanks! - a -- If I put copyrighted material into the 'chewy nougat center', I can claim the crunchy chocolate coating is an 'Access Control Mechanism'. --lynx_user_abroad Why Windows NT/2k/XP is unreliable: www.zappadoodle.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Tomcat and JNI
What ClassLoader should load the java classes that contain JNI calls? Currently the java classes that load the JNI calls are in the global web.xml file, in the jsp servlet's classpath: servlet servlet-namejsp/servlet-name servlet-classorg.apache.jasper.servlet.JspServlet/servlet-class init-param param-namelogVerbosityLevel/param-name param-valueDEBUG/param-value /init-param init-param param-nameclasspath/param-name param-value/appl/rware69/rware/lib/:/appl/rware69/rware/web/java/rwjavah l.jar/param-value /init-param init-param param-namekeepgenerated/param-name param-valuetrue/param-value /init-param load-on-startup3/load-on-startup /servlet The Tomcat docs have: - Tomcat 4.0 and JNI Based Applications: - Applications that require native libraries must ensure that the libraries have been loaded prior to use. Typically, this is done with a call like: static { System.loadLibrary(path-to-library-file); } in some class. However, the application must also ensure that the library is not loaded more than once. If the above code were placed in a class inside the web application (i.e. under /WEB-INF/classes or /WEB-INF/lib), and the application were reloaded, the loadLibrary() call would be attempted a second time. To avoid this problem, place classes that load native libraries outside of the web application, and ensure that the loadLibrary() call is executed only once during the lifetime of a particular JVM. Any help would be appreciated. Thanks Brian Hanuska -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: RE: Tomcat and JNI
Title: RE: RE: Tomcat and JNI The solution to this problem was to add the location of the class that contains the native methods to the CLASSPATH prior to launching Tomcat. Eric. -Original Message- From: Niall Gormley [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 06, 2000 12:23 PM To: [EMAIL PROTECTED] Subject: Re: RE: Tomcat and JNI Eric, I have just finished integrating a large amount of 'C' code into servlets using JNI. One useful tool I used was trace (or truss on Solaris, there is a eqivalent on HP but I can't remember what is is.) This traces all the system calls and you shoud see that library it is trying to load when your code fails. In addition is all your C code compilied with the -pthread option? Regards, Niall Additions and Corrections welcome. _ Get your free E-mail at http://www.ireland.com
RE: RE: Tomcat and JNI
Title: RE: RE: Tomcat and JNI Eric: Is the jni_connect.dll required for accessing native code from a servlet? I'm having the UnsatisfiedLinkError problem that you have mentioned previously. I'm running on Win2K, with Tomcat 3.2. On a related note, what is jni_server.xml needed for? Thanks for any assistance, Michael Kintzer -Original Message-From: Eric Lee (LYN) (EUS) [mailto:[EMAIL PROTECTED]]Sent: Thursday, December 07, 2000 10:08 AMTo: '[EMAIL PROTECTED]'Subject: RE: RE: Tomcat and JNI The solution to this problem was to add the location of the class that contains the native methods to the CLASSPATH prior to launching Tomcat. Eric. -Original Message- From: Niall Gormley [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 06, 2000 12:23 PM To: [EMAIL PROTECTED] Subject: Re: RE: Tomcat and JNI Eric, I have just finished integrating a large amount of 'C' code into servlets using JNI. One useful tool I used was trace (or truss on Solaris, there is a eqivalent on HP but I can't remember what is is.) This traces all the system calls and you shoud see that library it is trying to load when your code fails. In addition is all your C code compilied with the -pthread option? Regards, Niall Additions and Corrections welcome. _ Get your free E-mail at http://www.ireland.com
RE: Tomcat and JNI
Title: Tomcat, JNI and HP-UX I know that the library is be loaded, and I am fairly certain that the linkage is correct because the class performs as expected when invoking interactively, e.g. java Hello. I failed to mention earlier that this works on NT, but not HP-UX. I have also read postings that indicate this is an issue on other versions of UNIX as well. Has anyone accomplished this on UNIX? If so, were there any special configuration issues? Eric. -Original Message-From: Russell Freeman [mailto:[EMAIL PROTECTED]]Sent: Tuesday, December 05, 2000 10:48 AMTo: '[EMAIL PROTECTED]'Subject: RE: Tomcat, JNI and HP-UX I have some tips from experience with both Win32 and AIX platforms. I'm assuming that HP UK C dynamic link libraries are built similar to AIX ones...? - JDK 1.18 uses JNI version 1.0 bindings by default. Use the -jni option with javah to create a JNI 1.1 style C headers. These are easier to link with. - Make sure you use the generated header for the basis of the function implementation (rather than copying by hand). This will ensure you get the function header exactly right. - The unsatified link exception can occur for many reasons: the library is not found (not on the LIBPATH for instance), the method wasn't resolved (not exported or wrong signature in C) Given the following java class with natic methods: package a.b; public class c { public native void doSomething() {} public native void doSomethingElse() {} } You will need an export file with your so/shared library/DLL containing the mangled function prototypes, For example, in foo.exp ( the export file for the library foo.so ) I have: - Java_a_b_c_doSomething Java_a_b_c_doSomethingElse This is the JNI 1.1 C export for the above java code. -Original Message-From: Eric Lee (LYN) (EUS) [mailto:[EMAIL PROTECTED]]Sent: 05 December 2000 14:45To: '[EMAIL PROTECTED]'Subject: Tomcat, JNI and HP-UX I am using Tomcat 3.1 on HP-UX 10.20 with Java version (HP-UX Java C.01.18.03 05/12/2000 16:31:36 hkhd02) I am attempting to use a servlet that instantiates a class that contains JNI methods and I keep getting java.lang.UnsatisfiedLinkError exceptions when these native methods are accessed. The JNI methods execute fine from the command line with Java interpreter, I also know that the servlet is loading the shared library. There are similar postings in the mailing list archives but they are without response. If anyone has any comments, I sure would appreciate them. Many Thanks, Eric Lee
Re: RE: Tomcat and JNI
Eric, I have just finished integrating a large amount of 'C' code into servlets using JNI. One useful tool I used was trace (or truss on Solaris, there is a eqivalent on HP but I can't remember what is is.) This traces all the system calls and you shoud see that library it is trying to load when your code fails. In addition is all your C code compilied with the -pthread option? Regards, Niall Additions and Corrections welcome. _ Get your free E-mail at http://www.ireland.com