Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

After installing tomcat6 on CentOS 6.3, I am unable to start tomcat6 server.

root@host [/var/log/tomcat6]# service tomcat6 start
Starting tomcat6:                                          [  OK  ]

Although it says OK, I cant access http://mydomain.com:8080.

catalina.out

Exception in thread "main" java.lang.NullPointerException
   at java.lang.VMClassLoader.defineClass(libgcj.so.10)
   at java.lang.ClassLoader.defineClass(libgcj.so.10)
   at java.security.SecureClassLoader.defineClass(libgcj.so.10)
   at java.net.URLClassLoader.findClass(libgcj.so.10)
   at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.10)
   at java.lang.ClassLoader.loadClass(libgcj.so.10)
   at java.lang.ClassLoader.loadClass(libgcj.so.10)
   at gnu.java.lang.MainThread.run(libgcj.so.10)

Tomcat6 was installed using yum:

yum -y install java tomcat6 tomcat6-webapps tomcat6-admin-webapps

When I tried to find the version: tomcat6 version:

Exception in thread "main" java.lang.NoClassDefFoundError: org.apache.catalina.util.ServerInfo
   at gnu.java.lang.MainThread.run(libgcj.so.10)
Caused by: java.lang.ClassNotFoundException: org.apache.catalina.util.ServerInfo not found in gnu.gcj.runtime.SystemClassLoader{urls=[], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
   at java.net.URLClassLoader.findClass(libgcj.so.10)
   at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.10)
   at java.lang.ClassLoader.loadClass(libgcj.so.10)
   at java.lang.ClassLoader.loadClass(libgcj.so.10)
   at gnu.java.lang.MainThread.run(libgcj.so.10)

Any idea what I should do? Thanks!

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Based on the "libgcj.so" string present at the end of the stack trace lines, it looks like you are trying to run Tomcat with the GNU Compiler for Java. GCJ is not a full fledge Java runtime environment and is likely the source of your problem. This may happen if there is no real JRE or JDK installed on your system, or if the JRE_HOME (or JAVA_HOME) variable is not set. Try installing a real JRE like OpenJDK or Sun/Oracle's JRE/JDK.

share|improve this answer
    
Tried openjdk, it works now. –  Nyxynyx Sep 27 '12 at 0:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.