1

So I have to preface that I'm not familiar with tomcat/catalina, but trying to troubleshoot this anyway. Anyway I see in /var/log/tomcat5/catalina.out I'm seeing these errors:

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)

I'm not really sure what this means. This installation was working a week ago ... did something get corrupted? How would I figure if it did ... what other information would be valuable here?

Tomcat seems to be running and starting up fine ...

UPDATE: this might be related:

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.

Some more stuff in the logs:

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

CLEAN LOG OUTPUT FROM STARTING 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)

So I did a /etc/rc.d/init.d/tomcat status and I get this:

[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
Mark Steudel
  • 111
  • 1
  • 1
  • 4
  • Is this pertinent: 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. – Mark Steudel Jun 28 '11 at 18:29
  • 1
    Maybe a clean log could help. Stop tomcat, verify tomcat is not running "ps aux |grep tomcat",rename catalina.out to something else, then start tomcat and post the log – ghm1014 Jun 28 '11 at 18:44
  • added clean log output at bottom of message – Mark Steudel Jun 28 '11 at 19:11
  • If I start the process as root, is that ok? e.g. sudo /etc/rc.d/init.d/tomcat5 start? – Mark Steudel Jun 28 '11 at 19:48

2 Answers2

1

You don't have a JRE_HOME directory set. You need to download the java SDK (yes, SDK) and point your JRE_HOME to the root of your SDK folder.

You need to set it in your init script or your catalina.sh (my preference has always been catalina.sh)

Also see my answer here

My guess is that the init script is su'ing into a different user enviroment, so if you don't have it in your startup scripts it will never get properly set.

Zypher
  • 37,405
  • 5
  • 53
  • 95
  • Any thoughts to how that could unset? – Mark Steudel Jun 28 '11 at 19:59
  • @mark see my edits. – Zypher Jun 28 '11 at 20:02
  • So it looks like it's being set in the tomcat5.conf file, JAVA_HOME="/usr/java/latest", which is correct. Does that seem like a normal place for it to be set? – Mark Steudel Jun 28 '11 at 20:49
  • @Mark, IIRC that is a valid place, but the `/usr/java/latest` makes me think it's the JRE _NOT_ the JDK (see my link above) – Zypher Jun 28 '11 at 21:01
  • I'm not sure if JDK == SDK but latest is a symlink, see below:lrwxrwxrwx 1 root root 16 2010-02-19 16:03 default -> /usr/java/latest drwxr-xr-x 9 root root 4096 2010-02-19 16:03 jdk1.6.0_18 drwxr-xr-x 7 root root 4096 2010-02-19 16:20 jre1.6.0_18 lrwxrwxrwx 1 root root 21 2010-02-19 16:03 latest -> /usr/java/jdk1.6.0_18 – Mark Steudel Jun 28 '11 at 21:47
  • Ill try editing the catalina.sh file like you suggest and see if that helps. – Mark Steudel Jun 28 '11 at 21:54
  • 1
    I tried editing it explicitly stting JRE_HOME to /usr/java/latest, which actually points at /usr/java/jdk1.6.0_18, that didn't work, I tried also setting it to point at /usr/java/jdk1.6.0_18/bin ...thoughts? I also set JAVA_HOME to /usr/java/latest – Mark Steudel Jun 28 '11 at 22:12
  • Hmm, it _might_ be that you need JDK 5 not 6 – Zypher Jun 28 '11 at 22:19
0

I was facing the same issue. Then I noticed that I have accidentally deleted lib folder from tomcat directory. The issue got resolved as "lib" back in place. May this help.

Aryan
  • 101
  • 1
  • 1
    Hi, and welcome on board on SF. Please take a moment to read this: https://serverfault.com/help/how-to-answer – Marco Sep 29 '17 at 15:17