Hi, I just wanted to let you know that I finally figured it out. I was 1) forgetting to move a couple of jars from the connector directory and 2) there was a conflict between one of the new jars and the old one it replaced. It also needed to be moved from CATALINA_HOME/bin to CATALINA_HOME/common/lib. I have put together a little mini HOWTO on how to get the Unix socket running on JK2 and Solaris 9. Is there a place to post HOWTOs? Thanks for all of your support, Robert Williams
HOWTO set up JK2 on Solaris 9 using ChannelUnix (AF_UNIX socket) I am using the following: jakarta-tomcat-4.1.12 (binary) jakarta-tomcat-connectors-4.1.12-src Apache httpd-2.0.43 (source) j2sdk-1_4_1_01-solaris-sparc jakarta-ant-1.5.1 BUILD APACHE cd httpd-2.0.43/ ./configure --with-mpm=worker --enable-so --enable-layout=Apache --enable-module=most --enable-mods-shared=most Alter the config to suit your needs. The --enable-so is important for JK2 connector. I used the Apache layout which puts it it in /usr/local/ so that it would not interfere with the Solaris packages. If you would like to use the Solaris layout use --enable-layout=Solaris and alter following paths to suit. make make install Edit http.conf User nobody Group other ( or whatever you want as long as it is the same as the group of tomcat) BUILD THE TOMCAT CONNECTOR JK2 - build the java jar files cd ${connector.home} ant - build the native code cd ${connector.home}/jk/native2 sh ./buildconf.sh cp /usr/java/include/solaris/* /usr/java/include/ CPPFLAGS=-DBSD_COMP ./configure \ --with-apxs2=/usr/local/apache2/bin/apxs \ --with-tomcat41=/usr/local/tomcat \ --with-java-home=${JAVA_HOME} \ --with-java-platform=2 \ --with-jni make CPPFLAGS=-DBSD_COMP INSTALL FILES Edit or create the following files. /usr/local/apache2/conf/workers2.properties # workers2.properties [shm] file=${serverRoot}/logs/shm.file size=1048576 # Example unixsocket channel. [channel.un:unixsocket] file=/usr/local/tomcat/work/jk2.socket # define the worker [ajp13:unixsocket] channel=channel.un:unixsocket # Uri mapping [uri:/examples/*] worker=ajp13:unixsocket # end workers2.properties /usr/local/tomcat/conf/jk2.properties # jk2.properties # list of needed handlers. handler.list=apr,channelUnix,request # Location of the socket. channelUnix.file=${jkHome}/work/jk2.socket # Dynamic library jtc=/export/home/rcw/jakarta-tomcat-connectors-4.1.12-src apr.NativeSo=${jtc}/jk/build/jk2/apache2/jkjni.so # end jk2.properties MOVE DRIVERS AND JARS cd jakarta-tomcat-connectors-4.1.12-src cp jtc.jar /usr/local/tomcat/common/lib/ cd jakarta-tomcat-connectors-4.1.12-src/jk/build/lib cp tomcat-jni.jar /usr/local/tomcat/common/lib/ rm /usr/local/tomcat/bin/tomcat-jni.jar (back up if you want) cd jakarta-tomcat-connectors-4.1.12-src/jk/build/jk2/apache2/ cp mod_jk2.so /usr/local/apache2/modules/ SET UP ENVIRONMENT export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/apache2/lib export JAVA_HOME /usr/java export CATALINA_HOME /usr/local/tomcat export CATALINA_BASE (if you use --enable-layout=Solaris) START HER UP /usr/local/tomcat/bin/catalina.sh start Wait a bit for it to load you can check progress in /usr/local/tomcat/logs/catalina.out /usr/local/apache2/bin/apachectl start You should now be able to view the /examples/* directory from http://localhost:8080/examples/ (tomcat) and more importantly http://localhost/examples/ (apache with jk2) My build environment for this project is: Solaris 9 (32 bit) autoconf-2.54-sol9-sparc-local.gz tar-1.13.19-sol9-sparc-local.gz (the jakarta files require this tar. The Solaris one won't work) m4-1.4-sol9-sparc-local automake-1.7.1-sol9-sparc-local make-3.80-sol9-sparc-local.gz libtool-1.4 For errors or comments pleas feel free to contact me Robert at [EMAIL PROTECTED] -----Original Message----- From: Brzezinski, Paul J [mailto:Paul.Brzezinski@;EDS.COM] Sent: Thursday, November 14, 2002 5:51 PM To: Tomcat Users List Subject: Re: JK2 unixsocket: Can't create apr Robert Williams wrote: >Thanks for the info however I have not had any luck. I have put tried >putting the commons-logging-api.jar in commons/lib, /usr/java/lib, and >/usr/java/lib/ext. I then did the same with the commons-logging-1.0.2 >putting both the commons-logging-api.jar and commons-logging.jar in >the same places as well as adding it manually to the classpath. I then >upgraded to jdk 1.4.1 and tried the above again. Wow I don't get it. Is >there a way to see what the classpath that tomcat is seeing or a way to >see what classes are actually loaded into the JVM? > >When I run a test program calling the logger simiar(diferent class as >argument) to the one that is causing all of the fuss it runs fine. Any >Ideas? > > Try this: I created a file called reqinfo.jsp and put it in the $CATALINA_HOME/webapps/ROOT, which should be accessible by the URL: http://localhost:8080/reqinfo.jsp or whatever port you've configured for the http/1.1 connector. <%@ page language="java" contentType="text/html" %> <html> <body bgcolor="white"> The following information was received: <ul> <li>Request Method: <%= request.getMethod( ) %> <li>Request URI: <%= request.getRequestURI( ) %> <li>Request Protocol: <%= request.getProtocol( ) %> <li>Servlet Path: <%= request.getServletPath( ) %> <li>Query String: <%= request.getQueryString( ) %> <li>Server Name: <%= request.getServerName( ) %> <li>Server Port: <%= request.getServerPort( ) %> <li>Remote Address: <%= request.getRemoteAddr( ) %> <li>Remote Host: <%= request.getRemoteHost( ) %> <li>Browser Type: <%= request.getHeader( "User-Agent" ) %> <li>CLASSPATH: <%= System.getProperty( "java.class.path" ) %> </ul> </body> </html> Another idea -- which I haven't tried yet is to put *ALL* the jars in the $CATALINA_HOME/commons/lib. This was a suggestion from Costin Manolache. Another suggestion from Bill Barker was to try Costin's fix to the Manifrest Class-Path in 4.1.15. >public class MyClassLoader { > private static org.apache.commons.logging.Log log= > org.apache.commons.logging.LogFactory.getLog( >MyClassLoader.class ); > > private void doStuff(){ > System.out.println("log is " + log); > } > > public static void main(String[] args) { > new MyClassLoader().doStuff(); > } >} > > >-----Original Message----- >From: Brzezinski, Paul J [mailto:Paul.Brzezinski@;EDS.COM] >Sent: Thursday, November 14, 2002 4:32 AM >To: Tomcat Users List >Subject: Re: JK2 unixsocket: Can't create apr > > >Robert Williams -- try this...I haven't been able to try it yet, so >your mileage may vary. > >Paul > >Costin Manolache wrote: > > >A quick test: put commons-logging.jar and log4j.jar in common/lib. > > > >>Most classloader problems are due to the loader hierarchy. > >It is >> >> >possible ( at least with 5.0 - I'm running it this way ) to >put all >the jars in the same place ( like common/lib or just in CLASSPATH) >>and run tomcat with delegation and a simple class loader hierarchy. > >>I would bet the same works with 4.1.x - jboss for example is using > > >>embeded tocmat with all the jars in the main loader. > >Regarding >>the >> >> >unix channel - you need to be able to load libjkjni.so >and libapr.so. >It may be a good idea ( at least for testing ) to place >them in the >JRE_HOME/lib dir - that's a place where java will certainly >look for >.so files. ( at least with JDK1.4 I had some problems with loading > >jars, and the LD_LIBRARY_PATH may create some problems ). > > > >Costin > > > > > > > >Brzezinski, Paul J wrote: > > > > > > > >>Original post came from Tomcat Users, replying/cross-posting... >> > > >>> >> >>> >>> > >>: -----Original Message----- > >>: From: Costin Manolache [mailto:cmanolache@;yahoo.com] > >>: Sent: Wednesday, November 13, 2002 3:16 PM > >>: To: Tomcat Developers List > >>: Subject: RE: JK2 unixsocket: Can't create apr > >>: > >>: > >>: Very weird. > >>: > >>: Are you using the latest commons-logging.jar ? JDK1.4 or 1.3 > >>: ? Do you have log4j ? > >> > >>Yes -- *I* get this error on 4.1.12/5.0 on Solaris 8, hopefully >Robert >>Williams can provide details about his specfic config: >> >>> > > >>>I have: >> >>j2sdk1.4.1 >>commons-logging-1.0.2 >>>jakarta-log4j-1.2.6 >> >>Tried this against: jakarta-tomcat-4.1.12 >>>>>jakarta-tomcat-4.1.12-LE-jdk14 >>>jakarta-tomcat-5 >> >>I get the same error -- can't create apr... >>> >>> >>> > >>java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory > >> at org.apache.jk.apr.AprImpl.<clinit>(AprImpl.java:340) > >> > >>: The problem seems releated to class loading ( as usual :-). >> > > >>>Yeah, but how do we work-around it or solve it permanently. I've >>> >>> >tried >>massaging the catalina.sh startup script to include >commons-logging.jar in > >>CLASSPATH that gets passed to the JVM at startup. > >> > >>I've put commons-logging.jar in $CATALINA_HOME/server/lib even > >>though > > >>>commons-logging-api.jar exists there. >> >>I see in the -LE-jdk14 >>> >>> >that there's a log4j.rename-to-jar. What's the >>confidence level >that this will resolve this problem? >> >>Is this a problem on other >platforms? >> >>Is this NOT a problem on Linux? >> > >>: Costin > >>: > >>: > >>: Brzezinski, Paul J wrote: > >>: > >>: > I wonder if a better question is: > >>: > > >>: > Is anyone using the ChannelUnix (AF_UNIX socket) connector on > >>any > >>: > platform? > >>: > > >>: > On what platforms is the ChannelUnix (AF_UNIX socket) connector > >>: > actually known to function? > >>: > > >>: > > >>: > > >>: > : -----Original Message----- > >>: > : From: Robert Williams [mailto:rcw1@;pacbell.net] > >>: > : Sent: Wednesday, November 13, 2002 1:05 PM > >>: > : To: Tomcat User > >>: > : Subject: JK2 unixsocket: Can't create apr > >>: > : > >>: > : > >>: > : Hi all, > >>: > : I am trying to implement the unixsocket on JK2. While the > >>: > : channelSocket > >>: > : works fine I was hoping to get the speed benefits of a > >>: > : unixsocket. I am > >>: > : using the example setups in the JK2 documentation. And since > >>: > : it seems to > >>: > : be looking for the LogFactory I have made sure that > >>: > : commons-logging-api.jar was in the Tomcat common/lib and I > >>: > : also put it > >>: > : in java/jre/lib/ext as well. All to no avail. I am > >>: stumped. I haven't > >>: > : been able to find anything in the list or on google > >>: addressing this > >>: > : problem. Some docs regarding channelSocket say disable > >>: apr for this > >>: > : error but apparently unixsocket won't work without apr > >>: > : enabled. Any help > >>: > : would be appreciated. > >>: > : Thanks Robert > >>: > : > >>: > : jakarta-tomcat-4.1.12 > >>: > : jakarta-tomcat-connectors-4.1.12 > >>: > : Apache/2.0.43 > >>: > : Solaris 9 > >>: > : > >>: > : Nov 13, 2002 9:29:04 AM org.apache.jk.server.JkMain newHandler > >>: > : SEVERE: Can't create apr > >>: > : java.lang.NoClassDefFoundError: > >>: org/apache/commons/logging/LogFactory > >>: > : at org.apache.jk.apr.AprImpl.<clinit>(AprImpl.java:340) > >>: > : at java.lang.Class.forName0(Native Method) > >>: > : at java.lang.Class.forName(Class.java:130) > >>: > : at >org.apache.jk.server.JkMain.newHandler(JkMain.java:494) > >>: > : at org.apache.jk.server.JkMain.start(JkMain.java:316) > >>: > : at > >>: > : org.apache.jk.server.JkCoyoteHandler.start(JkCoyoteHandler.jav > >>: > : > >>: > : workers2.properties > >>: > : > >>: > : [shm] > >>: > : file=${serverRoot}/logs/shm.file > >>: > : size=1048576 > >>: > : > >>: > : # Example unixsocket channel. > >>: > : [channel.un:unixsocket] > >>: > : file=/usr/local/tomcat/work/jk2.socket > >>: > : > >>: > : # define the worker > >>: > : [ajp13:unixsocket] > >>: > : channel=channel.un:unixsocket > >>: > : > >>: > : # Uri mapping > >>: > : [uri:/examples/*] > >>: > : worker=ajp13:unixsocket > >>: > : > >>: > : jk2.properties > >>: > : # list of needed handlers. > >>: > : handler.list=apr,channelUnix,request > >>: > : > >>: > : # Location of the socket. > >>: > : channelUnix.file=${jkHome}/work/jk2.socket > >>: > : > >>: > : # Dynamic library > >>: > : apr.NativeSo=${jkHome}/lib/jkjni.so > >>: > : > >>: > : jk2.properties.save > >>: > : #AUTOMATICALLY GENERATED > >>: > : #Wed Nov 13 09:38:33 PST 2002 > >>: > : handler.list=apr,channelUnix,request > >>: > : secure=false > >>: > : soTimeout=20000 > >>: > : port=8009 > >>: > : jkHome=/usr/local/jakarta-tomcat-4.1.12 > >>: > : maxThreads=75 > >>: > : backlog=10 > >>: > : apr.NativeSo=${jkHome}/lib/jkjni.so > >>: > : timeout=20000 > >>: > : channelUnix.file=${jkHome}/work/jk2.socket > >>: > : tcpNoDelay=true > >>: > : > >>: > : > >>: > : Build Apache > >>: > : ./configure --with-mpm=worker --enable-so >--enable-layout=Apache > >>: > : --enable-module=most --enable-mods-shared=most > >>: > : make > >>: > : make install > >>: > : > >>: > : Build jk2 Conector > >>: > : cd ${conector.home}/jk/native2 > >>: > : sh ./buildconf.sh > >>: > : > >>: > : cp /usr/java/include/solaris to /usr/java/include/ > >>: > : > >>: > : CPPFLAGS=-DBSD_COMP ./configure \ > >>: > : --with-apxs2=/usr/local/apache2/bin/apxs \ > >>: > : --with-tomcat41=/usr/local/tomcat \ > >>: > : --with-java-home=${JAVA_HOME} \ > >>: > : --with-java-platform=2 \ > >>: > : --with-jni > >>: > : > >>: > : make CPPFLAGS=-DBSD_COMP > >>: > : > >>: > : cd ${conector.home}/jk/build/jk2/apache2 > >>: > : mkdir /usr/local/tomcat/lib/ > >>: > : cp * /usr/local/tomcat/lib/ > >>: > : cp mod_jk2.so /usr/local/apache2/modules/ > >>: > : > >>: > : installed GNU Tools > >>: > : autoconf-2.54-sol9-sparc-local.gz > >>: > : tar-1.13.19-sol9-sparc-local.gz > >>: > : m4-1.4-sol9-sparc-local > >>: > : automake-1.7.1-sol9-sparc-local > >>: > : make-3.80-sol9-sparc-local.gz > >>: > : libtool-1.4 > >>: > : > >>: > : > >>: > : > >>: > : > >>: > : -- > >>: > : To unsubscribe, e-mail: > >>: > : <mailto:tomcat-user-: [EMAIL PROTECTED]> > >>: > : For > >>: > : additional commands, > >>: > : e-mail: <mailto:tomcat-user-help@;jakarta.apache.org> > >>: > : > >>: > >>: > >>: -- > >>: To unsubscribe, e-mail: > >>: <mailto:tomcat-dev-: [EMAIL PROTECTED]> > >>: For > >>: additional commands, > >>: e-mail: <mailto:tomcat-dev-help@;jakarta.apache.org> > >>: > >> > >> > > > > > >-- > >To unsubscribe, e-mail: ><mailto:tomcat-dev-unsubscribe@;jakarta.apache.org> > >For additional commands, e-mail: ><mailto:tomcat-dev-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>