我在jdk1.5上开发了一个java web应用程序。
我使用eclipse IDE进行开发。当我通过eclipse运行应用程序时,它工作正常,没有面临任何问题。但是,当我试图在同一台机器的tomcat服务器上部署与war文件相同的应用程序时,它抛出了一些错误,比如Bad version number in .class file,或者在其他一些时候,我会得到像java.lang.NoClassDefFoundError这样的错误消息。
这就是我在堆栈跟踪中得到的。
javax.servlet.ServletException: Servlet execution threw an excep
当我将Tomcat默认库(jsp-api.jar、servlet-api.jar等)在我的应用程序/WebContent/WEB-INF/lib中,它抛出了一个异常:java.lang.IllegalStateException: No org.apache.tomcat.InstanceManager set in ServletContext
当我从我的库中删除这些jars并在build.xml中设置tomcat lib时,它工作得很好。有人能给我解释一下为什么会这样吗?为什么我不能在我的lib文件夹中使用tomcat库?
我正在尝试使用反射在运行时动态链接到jar文件。我已经为主类和方法创建了声明,除了当我试图调用一个方法时,我得到了这个异常:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.refle
在localhost调试我的webapp时,一切运行良好,但是当将它部署到服务器(Microsoft,OS:Ubuntu14.04 tomcat7+apache )时,无法找到jcaptcha servlet,它会抛出异常为"java.lang.NoClassDefFoundError:未能初始化类“。
type Exception report
message Servlet execution threw an exception
description The server encountered an internal error that prevented it fro