Not so bothered about JNI as long as TC and Apache talk to each other. I have attempted to force it to run manually; I don't trust inprocess because I need to set a couple of JVM variables and tweak the CLASSPATH
Thanks for the input so far :) JDL "Robert L Sowders" To: "Tomcat Users List" <[EMAIL PROTECTED]> <[EMAIL PROTECTED] cc: v> Subject: Re: Question about JK2, Apache2 and TC 4.1.12 with jdk1.3.1_02 26/10/2002 02:06 Please respond to "Tomcat Users List" Well, If you want to use jni and have Apache startup Tomcat you're going to have to change some things in both of your config files. You should really take a look at the new docs at C:\build\jakarta-tomcat-connectors\jk\build\docs\jk2\confighowto.html. First: apr.jniModeSo=some_path is the unix way to jni. For Win2k you just need "inprocess". Second: You have almost everything needed to start Tomcat in-process commented out in wk2.prop. Did you intend to do this. It's almost as if you meant to start TC manually, or as a separate process? I send you my conf files they are both pretty vanilla. Here's my jk2.properties file: Note: At one time you also needed a, channelJni.disabled = 0, statement. Don't know how old your version of jk2 is so you might need it. # Start jk2.p ###################### # Add the apr and channelJni to the list of handlers handler.list=apr,request,container,channelJni # The native libraries will be registered by JK2 apr.jniModeSo=inprocess # End jk2.p ###################### Here's my workers2.properties file: Note: My variable for ${serverRoot} did not work so I just hard coded my path to Apache home where it was needed. Note: I'm giving you the whole wk2.p file here. Everything is not needed. To get jni working you only need all the sections that deal with jni and of course your uri mappings, but you may gain some insight from everything else. workers2.properties: # Start wk2.p ##################### # Define the comunication channel [channel.jni:jni] info=The jni channel, used if tomcat is started inprocess # Define the parameters for the Java Virtual Machine [vm:] info=Parameters used to load a JVM in the server process OPT=-Djava.class.path=${TOMCAT_HOME}/lib/tomcat-jni.jar; ${TOMCAT_HOME}/lib/tomcat.jar OPT=-Dtomcat.home=${TOMCAT_HOME} OPT=-Dcatalina.home=${TOMCAT_HOME} OPT=-Xmx128M # JNI worker startup handler [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 stdout=${serverRoot}/logs/stdout.log stderr=${serverRoot}/logs/stderr.log # JNI worker shutdown handler [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 # Map the Tomcat examples webapp to the Web server uri space [uri:/examples/*] info=Map the whole webapp [logger] level=DEBUG [config:] #file=${serverRoot}/conf/workers2.properties file=c:/Apache2/conf/workers2.properties debug=0 debugEnv=0 [uriMap:] info=Maps the requests. Options: debug debug=0 # Alternate file logger #[logger.file:0] #level=DEBUG #file=${serverRoot}/logs/jk2.log [shm:] info=Scoreboard. Required for reconfiguration and status with multiprocess servers file=c:/Apache2/logs/jk2.shm size=1000000 debug=0 disabled=0 [workerEnv:] info=Global server options timing=1 debug=0 # Default Native Logger (apache2 or win32 ) # can be overriden to a file logger, useful # when tracing win32 related issues #logger=logger.file:0 [lb:lb] info=Default load balancer. debug=0 #[lb:lb_1] #info=A second load balancer. #debug=0 [channel.socket:localhost:8009] info=Ajp13 forwarding over socket debug=0 tomcatId=localhost:8009 #[channel.socket:localhost:8019] #info=A second tomcat instance. #debug=0 #tomcatId=localhost:8019 #lb_factor=1 #group=lb #group=lb_1 #disabled=0 #[channel.un:/opt/33/work/jk2.socket] #info=A second channel connecting to localhost:8019 via unix socket #tomcatId=localhost:8019 #lb_factor=1 #debug=0 [channel.jni:jni] info=The jni channel, used if tomcat is started inprocess [status:] info=Status worker, displays runtime informations [vm:] info=Parameters used to load a JVM in the server process #JVM=C:\Program Files\Java\j2re1.4.0_01\bin\client\jvm.dll OPT=-Djava.class.path=${TOMCAT_HOME}/lib/tomcat-jni.jar; ${TOMCAT_HOME}/lib/tomcat.jar OPT=-Dtomcat.home=${TOMCAT_HOME} OPT=-Dcatalina.home=${TOMCAT_HOME} OPT=-Xmx128M #OPT=-Djava.compiler=NONE 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=c:/Apache2/logs/stdout.log stderr=c:/Apache2/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 [uri:/jkstatus/*] info=Display status information and checks the config file for changes. group=status: #[uri:127.0.0.1:8003] #info=Example virtual host. Make sure myVirtualHost is in /etc/hosts to test it #alias=myVirtualHost:8003 #[uri:127.0.0.1:8003/ex] #info=Example webapp in the virtual host. It'll go to lb_1 ( i.e. localhost:8019 ) #context=/ex #group=lb_1 [uri:/examples] info=Example webapp in the default context. context=/examples debug=0 #[uri:/examples1/*] #info=A second webapp, this time going to the second tomcat only. #group=lb_1 #debug=0 [uri:/examples/servlets/*] info=Prefix mapping [uri:/examples/*.jsp] info=Extension mapping [uri:/examples/*] info=Map the whole webapp [uri:/examples/servlets/HelloW] info=Exampel with debug enabled. debug=10 # End wk2.p ##################### HTH rls [EMAIL PROTECTED] 10/25/2002 02:44 PM Please respond to "Tomcat Users List" To: "Tomcat Users List" <[EMAIL PROTECTED]> cc: Subject: Re: Question about JK2, Apache2 and TC 4.1.12 with jdk1.3.1_02 Robert Thank you for you reply. Herein find the config files. I really would be most grateful for any suggestions. John j2.properties --------------------------- handler.list=apr,request,channelJni # Override the default port for the socketChannel # channelSocket.port=8019 # Default: # channelUnix.file=${jkHome}/work/jk2.socket # Just to check if the the config is working shm.file=c:/Apache2/logs/jk2.shm # In order to enable jni use any channelJni directive channelJni.disabled = 0 # And one of the following directives: # apr.jniModeSo=/opt/apache2/modules/mod_jk2.so # If set to inprocess the mod_jk2 will Register natives itself # This will enable the starting of the Tomcat from mod_jk2 #apr.jniModeSo=inprocess # Try using the standalone version apr.jniModeSo=C:/Apache2/modules/mod_jk2.dll workers2.properties ---------------------------------- [logger] level=DEBUG [config:] #file=${serverRoot}/conf/workers2.properties file=C:/Apache2/conf/workers2.properties debug=0 debugEnv=0 [uriMap:] info=Maps the requests. Options: debug debug=10 # Alternate file logger #[logger.file:0] #level=DEBUG #file=${serverRoot}/logs/jk2.log [shm:] info=Scoreboard. Required for reconfiguration and status with multiprocess servers file=${serverRoot}/logs/jk2.shm size=1000000 debug=0 disabled=0 [workerEnv:] info=Global server options timing=1 debug=1 logger=logger # Default Native Logger (apache2 or win32 ) # can be overriden to a file logger, useful # when tracing win32 related issues #logger=logger.file:0 [lb:lb] info=Default load balancer. debug=0 #[lb:lb_1] #info=A second load balancer. #debug=0 [channel.socket:localhost:8009] info=Ajp13 forwarding over socket debug=0 tomcatId=localhost:8009 #[channel.jni:jni] #info=The jni channel, used if tomcat is started inprocess [status:] info=Status worker, displays runtime informations #[vm:] #info=Parameters used to load a JVM in the server process #JVM=C:\Program Files\Java\j2re1.4.0_01\bin\client\jvm.dll (Read from registry) #OPT=-Djava.class.path=c:/Java/Jakarta-tomcat-4.1.12/bin/tomcat-jni.jar #OPT=-Dtomcat.home=c:/Java/Jakarta-tomcat-4.1.12 #OPT=-Dcatalina.home=c:/Java/Jakarta-tomcat-4.1.12 #OPT=-Xmx128M #OPT=-Djava.compiler=NONE #disabled=1 [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=1 stdout=C:/Apache2/logs/stdout.log stderr=C:/Apache2/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=1 [uri:/jkstatus/*] info=Display status information and checks the config file for changes. group=status: [uri:/examples] info=Example webapp in the default context. context=/examples debug=0 [uri:/examples/servlets/*] info=Prefix mapping [uri:/examples/*.jsp] info=Extension mapping [uri:/examples/*] info=Map the whole webapp [uri:/select/*] info=Map the whole webapp context=/select debug=10 "Robert L Sowders" To: "Tomcat Users List" <[EMAIL PROTECTED]> <[EMAIL PROTECTED] cc: v> Subject: Re: Question about JK2, Apache2 and TC 4.1.12 with jdk1.3.1_02 25/10/2002 02:39 Please respond to "Tomcat Users List" Hmmm, Never tried to make it work with an old version of JSDK. It should still work with JSDK 1.3.1, but I haven't done it. Are you trying to start it up in process? jkjni.dll should not be required for Apache. Really I can only give you guesses if you don't post your configs. I'll need jk2.prop..., worker2.prop..., etc. rls [EMAIL PROTECTED] 10/24/2002 04:08 AM Please respond to "Tomcat Users List" To: "Tomcat Users List" <[EMAIL PROTECTED]> cc: Subject: Question about JK2, Apache2 and TC 4.1.12 with jdk1.3.1_02 I have been struggling with JK2 to link Apache2 and TC 4.1.12 using JDL 1.3.1_02 on a Win2K system All the docs and how-tos that I have found all talk about JDK1.4. And using JDK1.4 it does seem to work. However I have to use JDK 1.3.1_02 and cannot get it running. I have put mod_jk2.dll in Apache2\modules, and have jk2.properties in %CATALINA_HOME%\conf When I start up TC I get this: [INFO] Registry - -Loading registry information [INFO] Registry - -Creating new Registry instance [INFO] Registry - -Creating MBeanServer [INFO] Http11Protocol - -Initializing Coyote HTTP/1.1 on port 8080 Starting service Tomcat-Standalone Apache Tomcat/4.1.12 [INFO] Http11Protocol - -Starting Coyote HTTP/1.1 on port 8080 [INFO] JkMain - -APR not loaded, disabling jni components: java.io.IOException: no jkjni in java.library.path [INFO] JkMain - -Jk running ID=0 time=0/140 config=C: \Java\jakarta-tomcat-4.1.12\conf\jk2.properties I have got the jkjni.dll file too, but no matter where I put it, I get the same error. What have I forgotten/omitted? Any help gratefully received. JDL -- 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> -- 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> -- To unsubscribe, e-mail: <mailto:tomcat-user-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:tomcat-user-help@;jakarta.apache.org>