关于 Unsupported major.minor version 51.0的错误



java.lang.UnsupportedClassVersionError: org/apache/cxf/transport/servlet/CXFServlet : Unsupported major.minor version 51.0 (unable to load class org.apache.cxf.transport.servlet.CXFServlet)
 at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2858)
 at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1159)
 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1647)
 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
 at org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(WebAnnotationSet.java:108)
 at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:58)
 at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:294)
 at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1047)
 at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:265)
 at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4616)
 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:802)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:583)
 at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1080)
 at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1003)
 at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:507)
 at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1322)
 at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:325)
 at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1068)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1060)
 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
 at org.apache.catalina.core.StandardService.start(StandardService.java:525)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:759)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)


使用maven管理jar包依赖后建立基于cxf的服务端在tomacat启动时候报此错。原因是jdk版本的问题。修改tomcat的jdk版本为正确版本即可。

你可能感兴趣的:(日常问题解决)