views:

183

answers:

2

I'm attempting to get a local Tomcat environment running and am consistently encountering the following error:

Can't load log handler "2localhost.org.apache.juli.FileHandler"
java.lang.ClassNotFoundException: 2localhost.org.apache.juli.FileHandler
java.lang.ClassNotFoundException: 2localhost.org.apache.juli.FileHandler
 at java.net.URLClassLoader$1.run(Unknown Source)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(Unknown Source)
 at java.lang.ClassLoader.loadClass(Unknown Source)

I've confirmed the existence of 'tomcat-juli.jar' in %TOMCAT_HOME%/bin.

Pulling hair out on this one. It's almost gone.. Any help you can offer is greatly appreciated. Thanks! :)

+1  A: 

What good does a JAR do in /bin? Put it in server/lib if you're using Tomcat 5 or lib if you're using Tomcat 6. Those directories are in the CLASSPATH; bin is not.

UPDATE: You're using Tomcat 6, which uses a system class loader that's different from previous versions. This suggests that the juli JAR belongs in /bin, so my previous suggestion might correct the problem but it's not the recommended Tomcat 6 idiom.

Do you have CATALINA_HOME set?

duffymo
For whatever reasons that's where this .jar file lives in the standard Tomcat install.
Sean Owen
Try it. The class loader will not find it in /bin, but it will in /lib.
duffymo
+1  A: 

Did you modify your catalina.policy config?

grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
        permission java.security.AllPermission;
        permission java.lang.RuntimePermission "setContextClassLoader";
};
Droo
That should not be necessary.
duffymo