使用网络服务时出现以下错误。
500内部服务器错误
java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].util.OC4JSecureClassLoader.defineClassEntry(OC4JSecureClassLoader.java:172)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].naming.ContextClassLoader.defineClass(ContextClassLoader.java:1179)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].naming.ContextClassLoader.defineClass(ContextClassLoader.java:1065)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].naming.ContextClassLoader.findClass(ContextClassLoader.java:404)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].naming.ContextClassLoader.loadClass(ContextClassLoader.java:143)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].naming.ContextClassLoader.loadClass(ContextClassLoader.java:143)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at oracle.j2ee.ws.JavaRpcWebService.init(JavaRpcWebService.java:85)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].server.http.HttpApplication.loadServlet(HttpApplication.java:2358)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].server.http.HttpApplication.findServlet(HttpApplication.java:4800)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].server.http.HttpApplication.getRequestDispatcher(HttpApplication.java:2826)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:666)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:231)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:136)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
at java.lang.Thread.run(Thread.java:595)
我也看过早些时候的帖子但是找不到任何解决办法。源文件存在于不同的服务器上,Web服务部署在不同的服务器上。任何人都可以帮忙找出导致问题的原因吗?
答案 0 :(得分:0)
这是因为系统上的java version
较低。表示您在项目中导入的jar
或java
文件是在更高版本的java上编译的。
答案 1 :(得分:0)
您的源文件(或您使用的jar)的编译版本高于您用于运行服务器的javac
版本。
可能的解决方案:重新编译针对您运行服务器的Java版本的源代码,或者在您的服务器上安装所需的新Java版本并运行您的webapp。