제안된 대로 설치 과정을 따랐습니다.여기. 문서에 설명된 대로 Tomcat을 Unix 데몬으로 실행하려고 합니다. 그러나 다음과 같이 실행하면 (제안에 and 를 $CATALINA_HOME/bin/jsvc
추가했음을 참고하세요 ):commons-daemon.jar
-debug
-home ...
-server
user@debian:/usr/local/tomcat7$ sudo ./bin/jsvc \
-home $JAVA_HOME -debug -server \
-classpath $CATALINA_HOME/bin/bootstrap.jar:$CATALINA__HOME/bin/tomcat-juli.jar:$CATALINA_HOME/bin/commons-daemon.jar \
-outfile $CATALINA_BASE/logs/catalina.out \
-errfile $CATALINA_BASE/logs/catalina.err \
-Dcatalina.home=$CATALINA_HOME \
-Dcatalina.base=$CATALINA_BASE \
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
-Djava.util.logging.config.file=$CATALINA_BASE/conf/logging.properties \
org.apache.catalina.startup.Bootstrap
나는 다음과 같은 결과를 얻습니다 catalina.err
.
user@debian:/usr/local/tomcat7$ sudo cat logs/catalina.err
Switching umask back to 022 from 077
Using specific JVM in /usr/local/jvm/jdk1.7.0_75/jre/lib/amd64/server/libjvm.so
Attemtping to load library /usr/local/jvm/jdk1.7.0_75/jre/lib/amd64/server/libjvm.so
JVM library /usr/local/jvm/jdk1.7.0_75/jre/lib/amd64/server/libjvm.so loaded
JVM library entry point found (0x6EE14110)
+-- DUMPING JAVA VM CREATION ARGUMENTS -----------------
| Version: 0x010004
| Ignore Unrecognized Arguments: False
| Extra options: 5
| "-Djava.class.path=/usr/local/tomcat7/bin/bootstrap.jar:/bin/tomcat-juli.jar:/usr/local/tomcat7/bin/commons-daemon.jar" (0x00000000)
| "-Dcatalina.home=/usr/local/tomcat7" (0x00000000)
| "-Dcatalina.base=/usr/local/tomcat7" (0x00000000)
| "-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager" (0x00000000)
| "-Djava.util.logging.config.file=/usr/local/tomcat7/conf/logging.properties" (0x00000000)
+-------------------------------------------------------
| Internal options: 4
| "-Dcommons.daemon.process.id=3040" (0x00000000)
| "-Dcommons.daemon.process.parent=3039" (0x00000000)
| "-Dcommons.daemon.version=1.0.15-dev" (0x00000000)
| "abort" (0x00405500)
+-------------------------------------------------------
Java VM created successfully
Class org/apache/commons/daemon/support/DaemonLoader found
Native methods registered
java_init done
Daemon loading...
java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory
at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:59)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:379)
at org.apache.commons.daemon.support.DaemonLoader.load(DaemonLoader.java:190)
Caused by: java.lang.ClassNotFoundException: org.apache.juli.logging.LogFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 7 more
Cannot load daemon
java_load failed
Service exit with a return value of 3
jar tf $CATALINA_HOME/bin/tomcat-juli.jar
내가 가서 그것을 사용하여 분명히 존재하는 클래스를 찾으면 :
user@debian:/usr/local/tomcat7$ jar tf bin/tomcat-juli.jar
META-INF/MANIFEST.MF
org/apache/juli/AsyncFileHandler$LogEntry.class
org/apache/juli/AsyncFileHandler$LoggerThread.class
org/apache/juli/AsyncFileHandler.class
org/apache/juli/ClassLoaderLogManager$1.class
org/apache/juli/ClassLoaderLogManager$2.class
org/apache/juli/ClassLoaderLogManager$3.class
org/apache/juli/ClassLoaderLogManager$ClassLoaderLogInfo.class
org/apache/juli/ClassLoaderLogManager$Cleaner.class
org/apache/juli/ClassLoaderLogManager$LogNode.class
org/apache/juli/ClassLoaderLogManager$RootLogger.class
org/apache/juli/ClassLoaderLogManager.class
org/apache/juli/DateFormatCache$1.class
org/apache/juli/DateFormatCache$Cache.class
org/apache/juli/DateFormatCache.class
org/apache/juli/FileHandler.class
org/apache/juli/JdkLoggerFormatter.class
org/apache/juli/OneLineFormatter$1.class
org/apache/juli/OneLineFormatter.class
org/apache/juli/VerbatimFormatter.class
org/apache/juli/logging/DirectJDKLog.class
org/apache/juli/logging/Log.class
org/apache/juli/logging/LogConfigurationException.class
org/apache/juli/logging/LogFactory.class
META-INF/NOTICE
META-INF/LICENSE
답변1
jsvc 명령에 오타가 있습니다. 나는 썼다:
-classpath [...]:$CATALINA_HOME/bin/tomcat-juli.jar:[...]
아니다:
-classpath [...]:$CATALINA__HOME/bin/tomcat-juli.jar:[...]
불필요한 밑줄을 제거했는데 이제 작동합니다.