美文网首页
java.lang.UnsupportedClassVersio

java.lang.UnsupportedClassVersio

作者: 飞翔的道长 | 来源:发表于2017-06-09 15:24 被阅读138次

    Jun 09, 2017 8:03:24 AM org.apache.catalina.core.ApplicationContext log
    INFO: No Spring WebApplicationInitializer types detected on classpath
    Jun 09, 2017 8:03:25 AM org.apache.catalina.core.ApplicationContext log
    INFO: Initializing Spring root WebApplicationContext
    Jun 09, 2017 8:03:26 AM org.apache.catalina.core.StandardContext listenerStart
    SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
    org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.taotao.service.Impl.ContentCategoryServiceImpl] for bean with name 'contentCategoryServiceImpl' defined in URL [jar:file:/usr/tomcat/webapps/ROOT/WEB-INF/lib/taotao-manager-service-0.0.1-SNAPSHOT.jar!/com/taotao/service/Impl/ContentCategoryServiceImpl.class]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: com/taotao/service/Impl/ContentCategoryServiceImpl : Unsupported major.minor version 52.0 (unable to load class com.taotao.service.Impl.ContentCategoryServiceImpl)
    at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1320)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:622)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:591)
    at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1386)
    at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:957)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:742)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:983)
    at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1660)
    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)
    Caused by: java.lang.UnsupportedClassVersionError: com/taotao/service/Impl/ContentCategoryServiceImpl : Unsupported major.minor version 52.0 (unable to load class com.taotao.service.Impl.ContentCategoryServiceImpl)
    at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2922)
    at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1174)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1669)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)
    at org.springframework.util.ClassUtils.forName(ClassUtils.java:249)
    at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:395)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1338)
    at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1309)
    ... 23 more

    Jun 09, 2017 8:03:26 AM org.apache.catalina.core.ApplicationContext log
    INFO: Set web app root system property: 'webapp.root' = [/usr/tomcat/webapps/ROOT/]
    Jun 09, 2017 8:03:26 AM org.apache.catalina.core.ApplicationContext log
    INFO: Initializing log4j from [classpath:mybatis/log4j.properties]
    Jun 09, 2017 8:03:26 AM org.apache.catalina.core.ApplicationContext log
    INFO: Shutting down log4j
    Jun 09, 2017 8:03:26 AM org.apache.catalina.core.ApplicationContext log
    INFO: Closing Spring root WebApplicationContext
    Jun 09, 2017 8:03:26 AM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: contextInitialized()
    Jun 09, 2017 8:03:26 AM org.apache.catalina.core.ApplicationContext log
    INFO: SessionListener: contextInitialized()
    Jun 09, 2017 8:03:26 AM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@11cf9ad')
    Jun 09, 2017 8:03:26 AM org.apache.catalina.core.ApplicationContext log
    INFO: SessionListener: contextDestroyed()
    Jun 09, 2017 8:03:26 AM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: contextDestroyed()

    java.lang.UnsupportedClassVersionError
    这个是JDK版本不对造成的。
    即你用某版本的JDK编译的class,放在另一版本JDK上去运行,就容易发生这种异常了(常常是高版本编译在低版本上运行时发生)。
    这里显然你的Tomcat用的JDK与你编译用的JDK不一样,换成一致的版本就OK了。

    相关文章

      网友评论

          本文标题:java.lang.UnsupportedClassVersio

          本文链接:https://www.haomeiwen.com/subject/cqkfqxtx.html