> -----Original Message----- > From: Rahul Bhargava [mailto:[EMAIL PROTECTED]] > Sent: 11. veljača 2003 20:34 > To: [EMAIL PROTECTED] > Subject: JNI broken in jk2 - due to jk2_channel_jni_open() > > There is no way in hell JNI can ever work with JK2. > jk_channel_jni.c::jk2_channel_jni_open invokes > the java static method createJavaContext() which in turns tries to return > a registered JkHandler for > Jni (ChannelJni) from the underlying hashtable. However when the in- > process mode is enabled, there > is nobody registering any handlers! As a result null is trurned into c > land from Java when createJavaContext > returns causing the JNI invocation to fail. >
The jni channel is initialized from inside AprImpl. That is where all the java-native stuff is done and initialized. Also that imposes some problems, and one of them is missing LogFactory class from commons-logging. All you have to do is to add the commons-logging to the TC's startup classpath. Here is the snippet from the _original_ workers2.properties: [vm:] .... classpath=${TOMCAT_HOME}/bin/tomcat-jni.jar classpath=${TOMCAT_HOME}/server/lib/commons-logging.jar .... So, you'll need both classes preloaded to be able to use the JNI. > > This convince me that JNI mode never really worked with JK2. If you look > at the tomcat-user archive > you can see people falling on their faces trying to get this to work,but > nobody has succedded now > I know why. > Just follow the: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk2/confighowto.html You have the minimum JNI configuration section there, except that you should replace the classpath directive with the above two lines. MT. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]