You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Xtreme Modem <xt...@yahoo.com> on 2003/02/07 20:03:07 UTC

Trouble with Apache 2.0.43 mod_jk2 JNI connector to Tomcat 4.1.18

Hello,

I am having a lot of difficulty getting the JNI connector for Tomcat to work with Apache 2.0.43. I have Tomcat version 4.1.18. I have followed the examples in the documentation at http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk2/confighowto.html, and it appears that I have everything configured correctly, but I still get the following error in apache whenever I start apache:

[Tue Feb 04 15:00:03 2003] [error] env.createBean2(): Factory error creating channel.jni:jni ( channel.jni, jni) 
[Tue Feb 04 15:00:03 2003] [error] config.update(): Can't create channel.jni:jni 
[Tue Feb 04 15:00:03 2003] [error] env.createBean2(): Factory error creating vm: ( vm, ) 
[Tue Feb 04 15:00:03 2003] [error] config.update(): Can't create vm: 
[Tue Feb 04 15:00:03 2003] [error] env.createBean2(): Factory error creating worker.jni:onStartup ( worker.jni, onStartup) 
[Tue Feb 04 15:00:03 2003] [error] config.update(): Can't create worker.jni:onStartup 
[Tue Feb 04 15:00:03 2003] [error] env.createBean2(): Factory error creating worker.jni:onShutdown ( worker.jni, onShutdown)
[Tue Feb 04 15:00:03 2003] [error] config.update(): Can't create worker.jni:onShutdown 
[Tue Feb 04 15:00:03 2003] [error] mod_jk child init 1 0 
[Tue Feb 04 15:00:03 2003] [notice] Apache/2.0.43 (Unix) mod_jk2/2.0.2 configured -- resuming normal operations 

 

Apache will still serve up regular HTML pages without error, but whenever I just try to load the /examples page I get an error in my web browser and the following error in the apache error log:

[Tue Feb 04 15:01:36 2003] [error] lb_worker.service() all workers in error or disabled state 
[Tue Feb 04 15:01:36 2003] [error] mod_jk.handler() Error connecting to tomcat 120000 

 

I have jkjni.so and mod_jk2-2.0.43.so in the apache modules directory. My JAVA_HOME, CATALINA_HOME, and LD_LIBRARY_PATH environment variables are set correctly. I have tried this with both version 1.3.1 of the JDK and 1.4.1 but I get the same error either way. I have also tried this with both 2.0.44 and 2.0.43 versions of apache and that doesn't make a difference.

This is the contents of my jk2.properties file:

handler.list=apr,request,container,channelJni
shm.file=/apps/apache/product/2.0.43/logs/jk2.shm
channelJni.disabled=0 
apr.jniModeSo=inprocess 

 

This is the contents of my workers2.properties file:



[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 
OPT=-Djava.class.path=.;${CATALINA_HOME}/lib/tomcat-jni.jar;${CATALINA_HOME}/lib/tomcat.jar:${JAVA_HOME} 
OPT=-Dtomcat.home=${CATALINA_HOME} 
OPT=-Dcatalina.home=${CATALINA_HOME} 
OPT=-Xmx128M 



[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=${APACHE_ROOT}/logs/stdout.log 
stderr=${APACHE_ROOT}/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 



[uri:/examples/*] 
info=Map the whole webapp 



[shm:] 
debug=10 
file=${APACHE_ROOT}/logs/jk2.shm 
size=1000000 
disabled=0 

 

This is how apache is loading the modules (from httpd.conf):

LoadFile modules/jkjni.so
LoadModule jk2_module modules/mod_jk2-2.0.43.so

 

The system is a Solaris 2.8.

I have searched all through the archives and documentation for several days now but I have not seen anyone with this same problem. 

PLEASE HELP!

Thank you!

-frances



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

Re: Trouble with Apache 2.0.43 mod_jk2 JNI connector to Tomcat 4.1.18

Posted by liug <li...@mama.indstate.edu>.
I am having the same problem mod_jk2, tomcat 4.1.18, apache2,
but on linux.
I am wondering if mod_jk2/jni inprocess works for Unix (solaris or linux).
All the success stories that I've seen are on Microsoft Windows.
I tried to minic their config files with no luck.

the connector builds fine and I copied both mod_jk2.so and
jkjni.so into the apache2 modules directory as suggested at
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk2/installhowto.html

I then added the mod_jk2 loading in the httpd.conf:
LoadModule jk2_module modules/mod_jk2.so 

Here is my simple tomcat/conf/jk2.properties file:
handler.list=apr,request,channelJni
channelJni.disabled = 0
apr.jniModeSo=inprocess

Here is my simple apache2/conf/workers2.properties file:
[shm]
file=${serverRoot}/logs/shm.file
size=1048576
 
[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}/bin/tomcat-jni.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


Now when I start apache, I got the following in the error log:

[Tue Feb 11 10:01:07 2003] [error] env.createBean2(): Factory error creating channel.jni:jni ( channel.jni, jni)
[Tue Feb 11 10:01:07 2003] [error] config.update(): Can't create channel.jni:jni
[Tue Feb 11 10:01:07 2003] [error] env.createBean2(): Factory error creating vm: ( vm, )
[Tue Feb 11 10:01:07 2003] [error] config.update(): Can't create vm:
[Tue Feb 11 10:01:07 2003] [error] env.createBean2(): Factory error creating worker.jni:onStartup ( worker.jni, onStartup)
[Tue Feb 11 10:01:07 2003] [error] config.update(): Can't create worker.jni:onStartup
[Tue Feb 11 10:01:07 2003] [error] env.createBean2(): Factory error creating worker.jni:onShutdown ( worker.jni, onShutdown)
[Tue Feb 11 10:01:07 2003] [error] config.update(): Can't create worker.jni:onShutdown
[Tue Feb 11 10:01:07 2003] [error] mod_jk child init 1 0
[Tue Feb 11 10:01:07 2003] [error] jk2_init() Can't find child 1360 in scoreboard
[Tue Feb 11 10:01:07 2003] [error] mod_jk child init 1 -2


Anybody from the core team can comment? Let me know if you need
more info.

Thanks!
Frank


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


Re: Trouble with Apache 2.0.43 mod_jk2 JNI connector to Tomcat 4.1.18

Posted by Francesa Lacreativa <xt...@yahoo.com>.
 
 Xtreme Modem <xt...@yahoo.com> wrote:
Hello,

I am having a lot of difficulty getting the JNI connector for Tomcat to work with Apache 2.0.43. I have Tomcat version 4.1.18. I have followed the examples in the documentation at http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk2/confighowto.html, and it appears that I have everything configured correctly, but I still get the following error in apache whenever I start apache:

[Tue Feb 04 15:00:03 2003] [error] env.createBean2(): Factory error creating channel.jni:jni ( channel.jni, jni) 
[Tue Feb 04 15:00:03 2003] [error] config.update(): Can't create channel.jni:jni 
[Tue Feb 04 15:00:03 2003] [error] env.createBean2(): Factory error creating vm: ( vm, ) 
[Tue Feb 04 15:00:03 2003] [error] config.update(): Can't create vm: 
[Tue Feb 04 15:00:03 2003] [error] env.createBean2(): Factory error creating worker.jni:onStartup ( worker.jni, onStartup) 
[Tue Feb 04 15:00:03 2003] [error] config.update(): Can't create worker.jni:onStartup 
[Tue Feb 04 15:00:03 2003] [error] env.createBean2(): Factory error creating worker.jni:onShutdown ( worker.jni, onShutdown)
[Tue Feb 04 15:00:03 2003] [error] config.update(): Can't create worker.jni:onShutdown 
[Tue Feb 04 15:00:03 2003] [error] mod_jk child init 1 0 
[Tue Feb 04 15:00:03 2003] [notice] Apache/2.0.43 (Unix) mod_jk2/2.0.2 configured -- resuming normal operations 



Apache will still serve up regular HTML pages without error, but whenever I just try to load the /examples page I get an error in my web browser and the following error in the apache error log:

[Tue Feb 04 15:01:36 2003] [error] lb_worker.service() all workers in error or disabled state 
[Tue Feb 04 15:01:36 2003] [error] mod_jk.handler() Error connecting to tomcat 120000 



I have jkjni.so and mod_jk2-2.0.43.so in the apache modules directory. My JAVA_HOME, CATALINA_HOME, and LD_LIBRARY_PATH environment variables are set correctly. I have tried this with both version 1.3.1 of the JDK and 1.4.1 but I get the same error either way. I have also tried this with both 2.0.44 and 2.0.43 versions of apache and that doesn't make a difference.

This is the contents of my jk2.properties file:

handler.list=apr,request,container,channelJni
shm.file=/apps/apache/product/2.0.43/logs/jk2.shm
channelJni.disabled=0 
apr.jniModeSo=inprocess 



This is the contents of my workers2.properties file:



[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 
OPT=-Djava.class.path=.;${CATALINA_HOME}/lib/tomcat-jni.jar;${CATALINA_HOME}/lib/tomcat.jar:${JAVA_HOME} 
OPT=-Dtomcat.home=${CATALINA_HOME} 
OPT=-Dcatalina.home=${CATALINA_HOME} 
OPT=-Xmx128M 



[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=${APACHE_ROOT}/logs/stdout.log 
stderr=${APACHE_ROOT}/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 



[uri:/examples/*] 
info=Map the whole webapp 



[shm:] 
debug=10 
file=${APACHE_ROOT}/logs/jk2.shm 
size=1000000 
disabled=0 



This is how apache is loading the modules (from httpd.conf):

LoadFile modules/jkjni.so
LoadModule jk2_module modules/mod_jk2-2.0.43.so



The system is a Solaris 2.8.

I have searched all through the archives and documentation for several days now but I have not seen anyone with this same problem. 

PLEASE HELP!

Thank you!

-frances



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



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