org.springframework.beans.factory.BeanDefin...

avatar 2017年08月24日22:50:48 5 2699 views
博主分享免费Java教学视频,B站账号:Java刘哥 ,长期提供技术问题解决、项目定制:本站商品点此
最近开发项目启动服务器后报错
org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.naarchi.microdecoration.serviceImpl.AdminServiceImpl] for bean with name 'adminServiceImpl' defined in file [C:\software\tomcat\apache-tomcat-7.0.68\webapps\my-decoration\WEB-INF\classes\com\naarchi\microdecoration\serviceImpl\AdminServiceImpl.class]: problem with class file or dependent class; nested exception is Java.lang.UnsupportedClassVersionError: com/naarchi/microdecoration/serviceImpl/AdminServiceImpl : Unsupported major.minor version 52.0 (unable to load class com.naarchi.microdecoration.serviceImpl.AdminServiceImpl)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1355)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:628)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:597)
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1445)
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:975)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:752)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5068)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5584)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1572)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1562)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.UnsupportedClassVersionError: com/naarchi/microdecoration/serviceImpl/AdminServiceImpl : Unsupported major.minor version 52.0 (unable to load class com.naarchi.microdecoration.serviceImpl.AdminServiceImpl)
at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:3122)
at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:1340)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1827)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1701)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:250)
at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:394)
at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1397)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1344)
... 20 more
七月 21, 2016 3:59:23 下午 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.naarchi.microdecoration.serviceImpl.AdminServiceImpl] for bean with name 'adminServiceImpl' defined in file [C:\software\tomcat\apache-tomcat-7.0.68\webapps\my-decoration\WEB-INF\classes\com\naarchi\microdecoration\serviceImpl\AdminServiceImpl.class]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: com/naarchi/microdecoration/serviceImpl/AdminServiceImpl : Unsupported major.minor version 52.0 (unable to load class com.naarchi.microdecoration.serviceImpl.AdminServiceImpl)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1355)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:628)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:597)
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1445)
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:975)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:752)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5068)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5584)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1572)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1562)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
后面太长不粘贴了,网上搜索了一下 相关解决方案 基本都说是什么编译生成的.class文件出了问题,什么手动删除 重新编译之类的。但是问题仍然不能解决 而且个人 也觉得不应该是这种问题。
后来访问了一大堆一大堆国内的国外的网站 有个小网站上的一个帖子 一下子提醒了我,由于个人近期往项目中添加了 环信即时聊天通讯云服务的server端就要求整个项目使用的jre环境更改为jdk1.8。之前项目也研发了一段时间从来没有服务器启动报这种错误情况,因为之前用的是jdk1.7。
这里产生这种报错的主要原因是jdk1.8跟你当前框架(spring+springmvc+mybatis)中spring框架的版本有问题,之前使用版本为3.2.0release版本,然后就升级spring框架jar的版本到了4.2.6。具体问题是否能够解决 还暂定 因为 公司网速太慢了 但是理论上应该是可以的。 等测试成功后 会追加相关文档描述记录。。。。。。。。。。。。。
刚刚试过了 升级了以后 还是报错 解决方案  项目buildpath config中 把使用jdk换成1.7或者1.6的都行
ss
以上内容转自 http://blog.csdn.net/kuizhewudi/article/details/51983379
我用的是 Maven,在 pom.xml 将一些 jar 的版本调低便能正常,主要是将几 spring 的从4.3.0调到4.2.0。 可能是一些 jar 出现了 missing 吧,具体原因暂时还搞不清楚
  • 微信
  • 交流学习,资料分享
  • weinxin
  • 个人淘宝
  • 店铺名:言曌博客咨询部

  • (部分商品未及时上架淘宝)
avatar

发表评论

avatar 登录者:匿名
匿名评论,评论回复后会有邮件通知

  

已通过评论:0   待审核评论数:0