【八阿哥】解决spring2.5.6因使用jdk8特性的异常

版权声明:转载请注明我的个人微信平台 暴沸 https://blog.csdn.net/baofeidyz/article/details/81639549

这里贴出主要的异常信息,希望有缘人能靠关键字搜索到

Caused by: java.lang.ArrayIndexOutOfBoundsException: 51195
    at org.springframework.asm.ClassReader.<init>(Unknown Source) ~[spring-2.5.6.jar:2.5.6]
    at org.springframework.asm.ClassReader.<init>(Unknown Source) ~[spring-2.5.6.jar:2.5.6]
    at org.springframework.asm.ClassReader.<init>(Unknown Source) ~[spring-2.5.6.jar:2.5.6]
    at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:76) ~[spring-2.5.6.jar:2.5.6]
    at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:68) ~[spring-2.5.6.jar:2.5.6]
    at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:191) ~[spring-2.5.6.jar:2.5.6]
    at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:201) ~[spring-2.5.6.jar:2.5.6]
    at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:84) ~[spring-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69) ~[spring-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1297) ~[spring-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1287) ~[spring-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135) ~[spring-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92) ~[spring-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507) ~[spring-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398) ~[spring-2.5.6.jar:2.5.6]
    ... 38 common frames omitted

导致这次异常的根本原因在于spring-2.5.6最高只支持jdk1.7,然后我在这个spring-2.5.6的项目中放了一个使用jdk1.8开发的jar包,因为这个包里面有很多jdk1.8的特性,比如lamda表达式以及jdk8提供的DateTimeFormatter类导致最后无法在jdk1.7的环境中正常运行,当spring容器初始化的时候因为class文件无法运行,变成了0kb,最后抛出了这个异常。
原因找到了,至于修复的方案就请自便了,希望能帮到某些朋友啦

阅读更多
换一批

没有更多推荐了,返回首页