[[ I've already posted a similar question to Apple's unix-porting
list, in case this should be something peculiar to launchd. ]]

I'm trying to get Tomcat to start as an on-demand service using
Apple's launchd. I've got to the point where I can see some
indications Tomcat is trying to start, but then it immediately exits
with a ClassNotFoundException. Here's what I've tried:

sudo -u www 
/System/Library/Frameworks/JavaVM.framework/Versions/1.4/Home/bin/java
-Djava.io.tmpdir="/opt/local/share/java/tomcat5/temp"
-Dcatalina.home="/opt/local/share/java/tomcat5"
-Djava.endorsed.dirs="/opt/local/share/java/tomcat5/common/endorsed"
-jar /opt/local/share/java/tomcat5/bin/bootstrap.jar

Running that command Tomcat to startup listening and responding on
port 8080. It works that way. But when the same command (sans 'sudo -u
www' part, instead using another method of specifying the owning user)
is exec()ed from launchd, it produces the following output:

Created MBeanServer with ID:
3e96cf:10674a37f8b:-8000:tommy-knowltons-powerbook-g4-17.local:1

stderr:

java.lang.ClassNotFoundException: org.apache.catalina.startup.Catalina
       at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
       at java.security.AccessController.doPrivileged(Native Method)
       at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
       at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:198)
       at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:386)

(and at this point, the tomcat is dead not listening).

Any ideas why Tomcat would get to the point of creating the mbean
server, and then crap out with ClassNotFound of Catalina.class?

Looking at the tomcat5 sources, it seems lke the 'catalina'
classloader can't find the Catalina class - though I can't see how
that can happen. I'm running from the bootstrap.jar, which has
catalina.properties that point the server classloader to the
${catalina.home}/server/lib/*.jar, in which catalina.jar is present.
Besides, it works when I manually sudo it.

My first thought was to setup jdwp debugging, but that craps out with

JDWP unable to initialize: Error 111 from JNI GetEnv
Error occurred during initialization of VM
-Xrun library failed to init: jdwp

So, my investigative tools appear to be somewhat limited in launchd's
environment.

Maybe my next step will be to configure a logger with debug enabled.
Does anyone know how I can do that, externally to tomcat? I really
don't want to have to rebuild from source to track down what's going
on...

Thanks,
--
Tk!

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to