Solved

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

Posted on 2011-09-25
5
693 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with the aid of a graphical interface. Based on the inputs you provide, it generates images for deployment and creates reusable PowerShell scripts that …
This article shows the method of using the Resultant Set of Policy Tool to locate Group Policy that applies a particular setting.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

820 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