Spring与JDK版本不一致引发问题Caused by: java.lang.IllegalArgumentException
Posted minxinfeng的博客
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Spring与JDK版本不一致引发问题Caused by: java.lang.IllegalArgumentException相关的知识,希望对你有一定的参考价值。
tomcat启动一个spring的项目,tomcat使用8.5,JDK使用1.8,Spring使用3.0,启动之后报错
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.LocalVariableTableParameterNameDiscoverer.inspectClass(LocalVariableTableParameterNameDiscoverer.java:112) at org.springframework.core.LocalVariableTableParameterNameDiscoverer.getParameterNames(LocalVariableTableParameterNameDiscoverer.java:86) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:193) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1049) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:953) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:490) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:323) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1391) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1132) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:522) ... 100 more
但是tomcat使用7.0,JDK使用1.6可以正常启动并运行,因此考虑可能是jdk版本问题引发的。在网上搜索发现jdk1.8需要spring4以上版本才可以。所以讲spring版本升级为4.2,重新启动,发现可以正常启动
以上是关于Spring与JDK版本不一致引发问题Caused by: java.lang.IllegalArgumentException的主要内容,如果未能解决你的问题,请参考以下文章
记一次IDEA 打包环境JDK版本和生产环境JDK版本不一致引发的血案
spring cloud 与spring boot 版本不匹配引发的问题总结
关于eclpse java项目与tomcat jdk版本不一致的解决方法
Unsupported major.minor version 51.0 在配置/运行Maven工程时,JDK与Maven所引用的jdk版本不一致