Tomcat 正在运行,catalina 抛出异常

Tomcat 正在运行,catalina 抛出异常

因此,我必须先声明,我不熟悉 tomcat/catalina,但无论如何我都会尝试排除故障。无论如何,我在 /var/log/tomcat5/catalina.out 中看到以下错误:

Using CATALINA_BASE:   /usr/share/tomcat5
Using CATALINA_HOME:   /usr/share/tomcat5
Using CATALINA_TMPDIR: /usr/share/tomcat5/temp
Using JRE_HOME:
java.lang.ClassNotFoundException: org.apache.catalina.startup.Catalina
            at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
            at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:223)
            at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:410)

我不太清楚这意味着什么。这个安装一周前还在运行……是不是有什么东西损坏了?如果真的损坏了,我该如何判断……这里还有哪些其他信息有价值?

Tomcat 似乎正在运行并且启动正常……

更新:这可能相关:

Jun 19, 2011 11:00:25 PM org.apache.coyote.http11.Http11BaseProtocol pause
INFO: Pausing Coyote HTTP/1.1 on http-9080
Jun 19, 2011 11:00:26 PM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.

日志中还有一些内容:

2011-06-12 23:04:45,223 INFO [main] [com.atlassian.confluence.lifecycle] contextInitialized Starting Confluence 3.1.1 (build #1724)
2011-06-12 23:04:45,663 INFO [main] [beans.factory.xml.XmlBeanDefinitionReader] loadBeanDefinitions Loading XML bean definitions from c
lass path resource [bootstrapContext.xml]
2011-06-12 23:04:46,134 INFO [main] [beans.factory.xml.XmlBeanDefinitionReader] loadBeanDefinitions Loading XML bean definitions from c
lass path resource [setupContext.xml]
2011-06-12 23:04:46,236 INFO [main] [beans.factory.xml.XmlBeanDefinitionReader] loadBeanDefinitions Loading XML bean definitions from c
lass path resource [bootstrapCacheContext.xml]
2011-06-12 23:04:47,571 INFO [main] [atlassian.plugin.manager.DefaultPluginManager] init Initialising the plugin system
2011-06-12 23:04:48,338 INFO [main] [atlassian.plugin.manager.DefaultPluginManager] init Plugin system started in 0:00:00.748
Jun 12, 2011 11:05:05 PM org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop: 
java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:525)
        at java.net.Socket.connect(Socket.java:475)
        at java.net.Socket.<init>(Socket.java:372)
        at java.net.Socket.<init>(Socket.java:186)
        at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:395)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:344)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:435)
Jun 12, 2011 11:05:44 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.pa
th: /usr/java/jdk1.6.0_18/jre/lib/i386/client:/usr/java/jdk1.6.0_18/jre/lib/i386:/usr/java/jdk1.6.0_18/jre/../lib/i386:/usr/java/packag
es/lib/i386:/lib:/usr/lib

从启动 TOMCAT 清除日志输出:

Using CATALINA_BASE:   /usr/share/tomcat5
Using CATALINA_HOME:   /usr/share/tomcat5
Using CATALINA_TMPDIR: /usr/share/tomcat5/temp
Using JRE_HOME:       
java.lang.ClassNotFoundException: org.apache.catalina.startup.Catalina
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:223)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:410)

因此我执行了 /etc/rc.d/init.d/tomcat status 并得到了以下结果:

[wqadm1n@ip-72-167-51-178 proc]$ sudo /etc/rc.d/init.d/tomcat5 status
/etc/rc.d/init.d/tomcat5 is stopped
[wqadm1n@ip-72-167-51-178 proc]$ sudo /etc/rc.d/init.d/tomcat5 start
Starting tomcat5:                                          [  OK  ]
[wqadm1n@ip-72-167-51-178 proc]$ sudo /etc/rc.d/init.d/tomcat5 status
lock file found but no process running for pid 30774

答案1

您没有JRE_HOME设置目录。您需要下载 Java SDK(是的,SDK)并将 JRE_HOME 指向 SDK 文件夹的根目录。

catalina.sh您需要在您的初始化脚本或您的(我一直偏好catalina.sh)中进行设置

另请参阅我的回答这里

我的猜测是,init 脚本正在进入不同的用户环境,所以如果您的启动脚本中没有它,它将永远无法正确设置。

答案2

我遇到了同样的问题。然后我注意到我意外地从 tomcat 目录中删除了 lib 文件夹。问题得到解决,因为“lib”回到了原位。希望这能有所帮助。

相关内容