1
votes

I had developed a java web application on jdk1.5.

I used eclipse IDE for the development purpose. And when am running the application through eclipse, its working properly, no issues am facing. But when am trying to deploy the same application as war file in the same machine's tomcat server, its throwing some error like Bad version number in .class file or in some other time i will get error message like java.lang.NoClassDefFoundError.

This is what am getting in the stack trace.

javax.servlet.ServletException: Servlet execution threw an exception

root cause

java.lang.NoClassDefFoundError
    com.bdisys.auditservice.manager.AuditServiceManager.updateAuditServiceDetails(AuditServiceManager.java:46)
    com.bdisys.auditservice.servlet.AuditServiceHandler.doPost(AuditServiceHandler.java:45)
    com.bdisys.auditservice.servlet.AuditServiceHandler.doGet(AuditServiceHandler.java:34)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

Am attaching my project config for Java compiler settings.

enter image description here

Can anyone give suggestions to resolve this strange issue.?

2
Could you paste the stacktrace here? - Petar Minchev
@PetarMinchev Can you please check now..I had updated my question with what am getting in the stacktrace. - TKV
what is AuditServiceManager doing in line 46 - Subin Sebastian
@PetarMinchev In that am just creating an object of another class. - TKV
Please tell me the java version by selecting your project and click on properties for that project context menu and select Java Compiler. And how are you creating your war file(any building tools)? - Pokuri

2 Answers

0
votes

Your classpath and libraries are correct? The app not running because not found class AuditServiceManager in package com.bdisys.auditservice.manager (it's an library?)

0
votes

The error

Bad version number in .class 

This is caused by JVM incompatibility.

Ensure that you use same Java version for compiling and executing.

Check that your Tomcat installation is using a JRE that matches the JDK 1.5 Version that you used to compile and generate your WAR file.