You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Chippada , Sreeni" <sc...@netegrity.com> on 2004/04/02 21:13:19 UTC

Unable to connect Apache 2.0.48 to tomcat using JK2 Connector an d JNI.

Hi,
	I am trying to connect tomcat 5.0 and Apache 2.0.48 through JK2
connector using JNI on Windows 2000. The channel.jni:jni init is failing.


I greatly appreciate any help with this.


Thanks,
Sreeni

Following are the errors from the log file mod_jk2.log

-----------------------------------------------------------------
[Fri Apr 02 11:25:21 2004] (error ) [jk_workerEnv.c (211)]
workerEnv.initChannel() init failed for channel.jni:jni
[Fri Apr 02 11:25:21 2004] ( info ) [jk_worker_jni.c (204)]
workerJni.Init() Skipping initialization for the 2224 2224
[Fri Apr 02 11:25:21 2004] (error ) [jk_workerEnv.c (178)]
workerEnv.initWorkers() init failed for worker.jni:onStartup
[Fri Apr 02 11:25:21 2004] ( info ) [jk_worker_jni.c (204)]
workerJni.Init() Skipping initialization for the 2224 2224
[Fri Apr 02 11:25:21 2004] (error ) [jk_workerEnv.c (178)]
workerEnv.initWorkers() init failed for worker.jni:onShutdown
------------------------------------------------------------------



Followed the steps below:
	

STEP 1: Installing mod_jk2
--------------------------
1. Copy the mod_jk2.dll into <APACHE_HOME>/modules directory.
2. Add the following line to httpd.conf
	LoadModule jk2_module modules/mod_jk2.dll

#I also tried installing and configuring jkjni.dll in <APACHE_HOME>/modules.
That did not help either.



STEP 2: Configure <TOMCAT_HOME>/conf/server.xml
-----------------------------------------------
Disable the default connector on port 8080

Enable the AJP connector on port 8009.


STEP 3: <TOMCAT_HOME>/conf/jk2.properties
-----------------------------------------
handler.list=apr,request,channelJni
shm.file=c:/software/Apache Group/Apache2/logs/jk2.shm
channelJni.disabled=0
apr.jniModeSo=inprocess

STEP 4: <APACHE_HOME>/conf/workers2.properties
----------------------------------------------
# Set level to ERROR or EMERG for production - check path
[logger.file:0]
level=DEBUG
file=${serverRoot}/logs/mod_jk2.log

[logger]
level=DEBUG

[config:]
file=${serverRoot}/conf/workers2.properties
debug=100
debugEnv=100

[uriMap:]
info=Maps the requests. Options: debug
debug=100

[shm:]
info=Scoreboard. Required for reconfiguration and status with multiprocess
servers
file=${serverRoot}/logs/jk2.shm
size=1000000
debug=100
disabled=0

[workerEnv:]
info=Global server options
timing=1
debug=100
logger=logger.file: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
debug=100
disabled=0

# Define the parameters for the Java Virtual Machine
[vm:]
info=Parameters used to load a JVM in the server process
JVM=C:\j2sdk1.4.2_02\jre\bin\server\jvm.dll
OPT=-Djava.class.path=C:/Software/apache/jakarta-tomcat5.0.16/bin/bootstrap.
jar;
C:/Software/apache/jakarta-tomcat-5.0.16/server/lib/tomcat-jni.jar;C:/Softwa
re/apache/jakarta-tomcat-5.0.16/server/lib/tomcat-jk2.jar;C:/Software/apache
/jakarta-tomcat-5.0.16/common/lib/jmx.jar;C:/Software/apache/jakarta-tomcat-
5.0.16/server/lib/commons-modeler.jar
OPT=-Dcatalina.home=C:/Software/apache/jakarta-tomcat-5.0.16
OPT=-Dtomcat.home=C:/Software/apache/jakarta-tomcat-5.0.16
OPT=-Xmx512M
disabled=0
debug=100

# 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
disabled=0
stdout=C:/Software/Apache Group/Apache2/logs/stdout.log
stderr=C:/Software/Apache Group/Apache2/logs/stderr.log
debug=100

# 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
disabled=0
debug=100


# define the worker
[status:]
info the status worker

[uri:/jkstatus/*]
info=Display status information and checks the config file for changes.
group=status:

[uri:/jsp-examples]
info=Example webapp in the default context. 
context=/jsp-examples
debug=100



STEP 5: Start up
----------------

Start tomcat first
Wait until the instance is started.
Start apache.



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