You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Rahul Bhargava <co...@hotmail.com> on 2003/02/11 20:35:29 UTC

Beware: Don't use JNI inprocess mode with JK2, it's badly broken

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.

Tried this with Apache 2.0.43/44. With the out of process mode the declaration in server.xml cause a JkCoyoteHandler to be registered but with the in-process mode, this was suppose to happen automatically. Nobody seems to trigger a call to AprImpl.addJkHandler() - not in java land not in c land!

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.

Someone should fix the Jk2 web site which lures naive users to believe that JNI mode is working with
Jk2! I did try to fix the problem by tring to instantiate a ChannelJni instance in the ctor of AprImpl and register
it into the jkHandlers table but  was getting NPE...don't know the code that well to know what assumptions are built into ChannelJni. Will continue to debug. But in the meatime stay away from JNI.
_________________________________
Rahul Bhargava

Re: Beware: Don't use JNI inprocess mode with JK2, it's badly broken

Posted by liug <li...@mama.indstate.edu>.
As I mentioned in other posts, all the success stories I've
seen so far are with Microsoft Windows platform.
Is that me or someone else can imply from the response
in that bug report that the developer also uses Microsoft Windows?

Frank

Rahul Bhargava <co...@hotmail.com> wrote:
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16974



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Beware: Don't use JNI inprocess mode with JK2, it's badly broken

Posted by Rahul Bhargava <co...@hotmail.com>.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16974

_________________________________
Rahul Bhargava
----- Original Message -----
From: "Francesa Lacreativa" <xt...@yahoo.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Tuesday, February 11, 2003 12:21 PM
Subject: Re: Beware: Don't use JNI inprocess mode with JK2, it's badly
broken


|
| Thanks for the info, Rahul.  I incorrectly assumed that the code was good.
What's the bug number you got from BUGZILLA when you submitted this?
| thanks,
| -francesa
|
|
|  Rahul Bhargava <co...@hotmail.com> wrote: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.
|
| Tried this with Apache 2.0.43/44. With the out of process mode the
declaration in server.xml cause a JkCoyoteHandler to be registered but with
the in-process mode, this was suppose to happen automatically. Nobody seems
to trigger a call to AprImpl.addJkHandler() - not in java land not in c
land!
|
| 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.
|
| Someone should fix the Jk2 web site which lures naive users to believe
that JNI mode is working with
| Jk2! I did try to fix the problem by tring to instantiate a ChannelJni
instance in the ctor of AprImpl and register
| it into the jkHandlers table but was getting NPE...don't know the code
that well to know what assumptions are built into ChannelJni. Will continue
to debug. But in the meatime stay away from JNI.
| _________________________________
| Rahul Bhargava
|
|
|
| ---------------------------------
| 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: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Beware: Don't use JNI inprocess mode with JK2, it's badly broken

Posted by Francesa Lacreativa <xt...@yahoo.com>.
Thanks for the info, Rahul.  I incorrectly assumed that the code was good.  What's the bug number you got from BUGZILLA when you submitted this?
thanks,
-francesa
 
 
 Rahul Bhargava <co...@hotmail.com> wrote: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.

Tried this with Apache 2.0.43/44. With the out of process mode the declaration in server.xml cause a JkCoyoteHandler to be registered but with the in-process mode, this was suppose to happen automatically. Nobody seems to trigger a call to AprImpl.addJkHandler() - not in java land not in c land!

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.

Someone should fix the Jk2 web site which lures naive users to believe that JNI mode is working with
Jk2! I did try to fix the problem by tring to instantiate a ChannelJni instance in the ctor of AprImpl and register
it into the jkHandlers table but was getting NPE...don't know the code that well to know what assumptions are built into ChannelJni. Will continue to debug. But in the meatime stay away from JNI.
_________________________________
Rahul Bhargava



---------------------------------
Do You Yahoo!?
Todo lo que quieres saber de Estados Unidos, América Latina y el resto del Mundo.
Visíta Yahoo! Noticias.