欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

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

程序员文章站 2022-03-28 09:36:45
...

 

  异常解决[ 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/


异常解决[ asm ClassReader failed to parse class file]
            
    
    博客分类: springexception springexception异常解决 异常解决[ asm ClassReader failed to parse class file]
            
    
    博客分类: springexception springexception异常解决 异常解决[ asm ClassReader failed to parse class file]
            
    
    博客分类: springexception springexception异常解决 
 
 
 谢谢您的赞助,我会做的更好!