tomcat启动报异常:Caused by: java.lang.UnsupportedClassVersionError

    今天,把本地开发的项目部署到测试环境。本地好好的,但是放到系统环境上不行。其中报了许多异常,其中Caused by: java.lang.UnsupportedClassVersionError是导致异常的主要原因。这个异常的意思是,不支持的类版本错误。本地是jdk1.8,检查了测试环境,配置的jdk1.7,需改成1.8后,ok了。下边是报错的一部分,希望能帮到小伙伴^-^

Caused by: java.lang.UnsupportedClassVersionError: org/springframework/web/SpringServletContainerInitializer : Unsupported major.minor version 52.0 (unable to load class [org.springframework.web.SpringServletContainerInitializer])
    at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2404)
    at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:859)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1185)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:274)
    at org.apache.catalina.startup.WebappServiceLoader.loadServices(WebappServiceLoader.java:188)
    at org.apache.catalina.startup.WebappServiceLoader.load(WebappServiceLoader.java:159)
    at org.apache.catalina.startup.ContextConfig.processServletContainerInitializers(ContextConfig.java:1622)
    at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1129)
    at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:769)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5134)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 10 more

10-Apr-2019 12:04:42.805 SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Error deploying web application directory [/home/work/kaowu-algorithm-service/webapps/ROOT]
 java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:758)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1135)
    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1870)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

你可能感兴趣的:(java)