问题
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:
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";
};
回答2:
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?
来源:https://stackoverflow.com/questions/2166414/local-tomcat-environment-not-starting