异常解决[ asm ClassReader failed to parse class file]

简介:     异常解决[ asm  ClassReader failed to parse class file]   15:56:17,364 []-[DEBUG] Resolved location pattern [classpath*:com/baoy/**/*.

 

  异常解决[ asm  ClassReader failed to parse class file]

 

15:56:17,364 []-[DEBUG] Resolved location pattern [classpath*:com/baoy/**/*.class] to resources [file [D:\cache\eclipse4mvn-workplace\DubboDemo\target\classes\com\baoy\base\dao\JdbcTempBaseDao.class], file [D:\cache\eclipse4mvn-workplace\DubboDemo\target\classes\com\baoy\bean\User.class], file [D:\cache\eclipse4mvn-workplace\DubboDemo\target\classes\com\baoy\dao\impl\UserDaoImpl$1.class], file [D:\cache\eclipse4mvn-workplace\DubboDemo\target\classes\com\baoy\dao\impl\UserDaoImpl$UserRowMapper.class], file [D:\cache\eclipse4mvn-workplace\DubboDemo\target\classes\com\baoy\dao\impl\UserDaoImpl.class], file [D:\cache\eclipse4mvn-workplace\DubboDemo\target\classes\com\baoy\dao\UserDao.class], file [D:\cache\eclipse4mvn-workplace\DubboDemo\target\classes\com\baoy\main\Start.class], file [D:\cache\eclipse4mvn-workplace\DubboDemo\target\classes\com\baoy\service\impl\UserServiceImpl.class], file [D:\cache\eclipse4mvn-workplace\DubboDemo\target\classes\com\baoy\service\UserService.class]]
Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [D:\cache\eclipse4mvn-workplace\DubboDemo\target\classes\com\baoy\base\dao\JdbcTempBaseDao.class]; nested exception is org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet: file [D:\cache\eclipse4mvn-workplace\DubboDemo\target\classes\com\baoy\base\dao\JdbcTempBaseDao.class]; nested exception is java.lang.IllegalArgumentException
	at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:290)
	at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:242)
	at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:84)
	at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73)
	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1438)
	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1428)
	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:195)
	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:139)
	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:108)
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:243)
	at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:127)
	at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:93)
	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
	at com.baoy.main.Start.main(Start.java:16)
Caused by: org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet: file [D:\cache\eclipse4mvn-workplace\DubboDemo\target\classes\com\baoy\base\dao\JdbcTempBaseDao.class]; nested exception is java.lang.IllegalArgumentException
	at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:56)
	at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80)
	at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:102)
	at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:266)
	... 24 more
Caused by: java.lang.IllegalArgumentException
	at org.springframework.asm.ClassReader.<init>(Unknown Source)
	at org.springframework.asm.ClassReader.<init>(Unknown Source)
	at org.springframework.asm.ClassReader.<init>(Unknown Source)
	at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:53)
	... 27 more

 

 “ASM ClassReader failed to parse class file”是其中主要的原因。检查Maven的类库,没有发现问题,无asm显性依赖,其依赖产生于spring本身。

 

   a.  使用jdk7   

   b.  升级spring 4

 

本人使用 jdk1.8 spring 使用时很早之前的demo spring- 3.1.12.RELEASE  ,修改 spring 版本为 4.3.12.RELEASE之后,问题解决

 

 

 

 

 

 

 

 

 

 

 

 

 

捐助开发者 

在兴趣的驱动下,写一个免费的东西,有欣喜,也还有汗水,希望你喜欢我的作品,同时也能支持一下。 当然,有钱捧个钱场(支持支付宝和微信 以及扣扣群),没钱捧个人场,谢谢各位。

 

个人主页http://knight-black-bob.iteye.com/



 
 
 谢谢您的赞助,我会做的更好!

目录
相关文章
JRebel-JVMTI [FATAL] Couldn‘t write to C:\Users\【完美解决方案】
JRebel-JVMTI [FATAL] Couldn‘t write to C:\Users\【完美解决方案】
JRebel-JVMTI [FATAL] Couldn‘t write to C:\Users\【完美解决方案】
|
Java Maven Spring
|
6月前
|
Python
【Error】DeprecationWarning: executable_path has been deprecated, please pass in a Service object
【Error】DeprecationWarning: executable_path has been deprecated, please pass in a Service object
105 2
|
3月前
|
Docker 容器
ADD failed: file not found in build context or excluded by .dockerignore: stat irap_rule_center: fil
ADD failed: file not found in build context or excluded by .dockerignore: stat irap_rule_center: fil
|
前端开发
【前端异常】Module build failed: Error: ENOENT: no such file or directory, scandir ‘G:\OPWeb\public\node_m
【前端异常】Module build failed: Error: ENOENT: no such file or directory, scandir ‘G:\OPWeb\public\node_m
251 0
|
7月前
|
Java 应用服务中间件
完美解决tomcat启动异常:Invalid byte tag in constant pool: 19;Unable to process Jar entry [module-info.class]
完美解决tomcat启动异常:Invalid byte tag in constant pool: 19;Unable to process Jar entry [module-info.class]
1308 0
cl.exe is unable to create an executable file. C compiler test failed.
cl.exe is unable to create an executable file. C compiler test failed.
202 0
|
Web App开发 Java
错误:Reference file contains errors http://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_1.xsdv......
引用:http://topic.csdn.net/u/20070125/18/8d676afd-868a-4c2d-9a1b-07eed6b5683d.html   6楼 xsi:schemaLocation= "http://java.
1547 0
打包错误--Error:A problem was found with the configuration of task ':app:packageRelease'.
解决办法: app目录下的build.gradle文件 将 shrinkResources 的值改为 false 或者直接去掉   shrinkResources true  表示 :打包的时候会去删除一些不必要 的文件   ------------------------------------- 问题是以往打包一直没出过这样的问题,根本原因不知。
1602 0