Tomcat 提示 HTTP Status 500 – Internal Server Error

发布时间:2019-04-10 14:00:01发布者:Mr.Zhang阅读(822)

错误信息:

 1 HTTP Status 500 – Internal Server Error
 2 Type Exception Report
 3 
 4 Message Error instantiating servlet class [Servlet.BeerSelect]
 5 
 6 Description The server encountered an unexpected condition that prevented it from fulfilling the request.
 7 
 8 Exception
 9 
10 javax.servlet.ServletException: Error instantiating servlet class [Servlet.BeerSelect]
11 org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
12 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
13 org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668)
14 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
15 org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
16 org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
17 org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:791)
18 org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1417)
19 org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
20 java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
21 java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
22 org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
23 java.lang.Thread.run(Unknown Source)
24 Root Cause
25 
26 java.lang.UnsupportedClassVersionError: Servlet/BeerSelect has been compiled by a more recent version of the Java Runtime (class file version 54.0), this version of the Java Runtime only recognizes class file versions up to 52.0 (unable to load class [Servlet.BeerSelect])
27 org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2376)
28 org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:834)
29 org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1297)
30 org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1157)
31 org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
32 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
33 org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668)
34 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
35 org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
36 org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
37 org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:791)
38 org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1417)
39 org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
40 java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
41 java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
42 org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
43 java.lang.Thread.run(Unknown Source)
44 Note The full stack trace of the root cause is available in the server logs.

 

 一开始没有细看,以为是tomcat目录结构错误,网上搜了各种方法都没能解决

后来仔细一看Root Cause,是Java Runtime版本引起的。想了想,我安装的

 是jdk10,默认的编译版本也是10,应该是编译版本过高。

 

解决方案:
将编译等级调低即可

 





本文转自博客园,原文地址:https://www.cnblogs.com/yeungyu/p/10682616.html