Kevin Suttle
Kevin Suttle

Reputation: 8489

OSX 10.9.1: "Tomcat started." localhost:8080 says "no data received"

I've spent hours trying to get Tomcat installed and the server running, and still nothing.

❯ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents

❯ bash startup.sh
Using CATALINA_BASE:   /Library/Tomcat
Using CATALINA_HOME:   /Library/Tomcat
Using CATALINA_TMPDIR: /Library/Tomcat/temp
Using JRE_HOME:        /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Using CLASSPATH:       /Library/Tomcat/bin/bootstrap.jar:/Library/Tomcat/bin/tomcat-juli.jar
Using CATALINA_PID:    /Library/Tomcat/tomcat.pid
Existing PID file found during start.
Removing/clearing stale PID file.

Tomcat started.

/Library/Tomcat/bin
❯

localhost:8080 still doesn't load.

Chrome: "no data received"

I've checked, and no other processes are using that port. I've also added a dummy user. Still, nothing.

<role rolename="tomcat"/>
  <role rolename="role1"/>
  <role rolename="manager"/>
  <role rolename="admin"/>
  <user username="tomcat" password="tomcat" roles="tomcat,admin,manager"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>
  <user username="role1" password="tomcat" roles="role1"/>

Configuration tests:

❯ ./catalina.sh configtest
Using CATALINA_BASE:   /Library/Tomcat
Using CATALINA_HOME:   /Library/Tomcat
Using CATALINA_TMPDIR: /Library/Tomcat/temp
Using JRE_HOME:        /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Using CLASSPATH:       /Library/Tomcat/bin/bootstrap.jar:/Library/Tomcat/bin/tomcat-juli.jar
Using CATALINA_PID:    /Library/Tomcat/tomcat.pid
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/catalina/startup/Bootstrap : Unsupported major.minor version 51.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Configuration error detected!

❯ which java
/usr/bin/java

❯ java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

Yet, for some reason, I have 1.7 showing in my System Preferences.

Java OSX System Prefs

I even tried Tomcat Controller, but it says something isn't configured properly also. It'd be really helpful if these errors told me exactly what the problem was.

Tomcat Controller

Feel free to move this to ServerFault

Upvotes: 0

Views: 1707

Answers (1)

codelark
codelark

Reputation: 12334

You have two JVMs installed. Not the JRE_HOME line in the output from startup and compare it with the JAVA_HOME path above it.

You'll need to update the JRE_HOME environment variable and the java symlink in /usr/bin to point to the java 7 installation.

Upvotes: 2

Related Questions