Solved

Tomcat Class unable to load when moving a site from Dev to Test servers

Posted on 2011-09-25
5
686 Views
Last Modified: 2012-05-12
I have a web site I have been developing for a while (other people did the dev so excuse my ignorance of Tomcat / Java)... My dev server is running Tomcat 5.5.31 and JDK 1.6.026 and the database is MS SQL 2008 R2

When I try move this to my test server I get an error about a DBInit class that cannot load (I have pasted the log in full below). The only difference I am aware of is MS SQL is Version 2008 (not R2).

I then tried it on another server with MS SQL 2008 R2 and the same error (unable to load class com.DBInit) occurs.

There must be something one of the developers loaded on the Dev server that was undocumented. Does anyone have any idea what the problem could be?

Thanks
Sep 25, 2011 1:38:53 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Tomcat\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Dell\SysMgt\RAC5;C:\Program Files (x86)\Dell\SysMgt\oma\bin;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;.
Sep 25, 2011 1:38:53 PM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-192.168.100.34-80
Sep 25, 2011 1:38:53 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 451 ms
Sep 25, 2011 1:38:54 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Sep 25, 2011 1:38:54 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.34
Sep 25, 2011 1:38:54 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Sep 25, 2011 1:38:54 PM org.apache.catalina.startup.HostConfig deployDirectory
SEVERE: Error deploying web application directory ROOT
java.lang.UnsupportedClassVersionError: com/DBInit : Unsupported major.minor version 51.0 (unable to load class com.DBInit)
	at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1964)
	at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:933)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1405)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1284)
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1068)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3996)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4266)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:980)
	at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:943)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1203)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:319)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
	at org.apache.catalina.core.StandardService.start(StandardService.java:448)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Sep 25, 2011 1:38:54 PM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-192.168.100.34-80
Sep 25, 2011 1:38:54 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Sep 25, 2011 1:38:54 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/20  config=null
Sep 25, 2011 1:38:54 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Sep 25, 2011 1:38:54 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 752 ms

Open in new window

0
Comment
Question by:Bird757
  • 3
5 Comments
 
LVL 47

Expert Comment

by:for_yan
ID: 36596797

This kind of error usuall hints taht certain class
was compiled with Java newer  than the virtual machine you want to execute it with:
java.lang.UnsupportedClassVersionError: com/DBInit : Unsupported major.minor version 51.0 (unable to load class com.DBInit

What version of Java are you using on the Test server which runs Tomcat ?
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36596801

>My dev server is running Tomcat 5.5.31 and JDK 1.6.026

Now you are rnunning on the test server which is different form your dev server, correct?
Can't it be that you are running Tomcat say with java 1.5 ?
0
 
LVL 27

Expert Comment

by:rrz
ID: 36596811
The error message is telling you that the class DBInit was compiled with Java 7.  
You need to compile it with  JDK 1.6  since that is what is on your server.
0
 
LVL 47

Accepted Solution

by:
for_yan earned 500 total points
ID: 36596863

Or run your Tomcat with Java 7
(install Java 7 and change JAVA_HOME ebevironment varaible to point at Java 7 )
0
 

Author Closing Comment

by:Bird757
ID: 36597098
Thanks for the insights. Somehow I have ended up with a mixed version of Java on the Dev server. JAVA_HOME points to the JDK 1.6 installation (java.exe is SE 6.0.260.3), but there is a registry setting referring to 1.7. And when I checked installed programs I see someone installed Java 7. I am going to have to address this with the developers.

Thanks for the help!

Microsoft Windows [Version 6.1.7601]
C:\Users\Administrator>java -version
Registry key 'Software\JavaSoft\Java Runtime Environment\CurrentVersion'
has value '1.7', but '1.6' is required.
Error: could not find java.dll
Error: could not find Java SE Runtime Environment.
C:\Users\Administrator>
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Running Java Servlet inside Eclipse Luna 6 139
Javascript onclick event 4 101
Apache server configuration 7 79
java beans and EJBs 5 182
Owning a franchise can be the dream of a lifetime. It provides a chance for economic growth. You can be as successful as you want.  To make your franchise successful, you need to market it successfully. Here are six of the best marketing strategies …
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now