1. 程式人生 > >IDEA匯入專案報錯 java.lang.NoClassDefFoundError: org/springframework/core/env/EnvironmentCapable

IDEA匯入專案報錯 java.lang.NoClassDefFoundError: org/springframework/core/env/EnvironmentCapable

"D:\Program Files (x86)\Java\jdk1.8.0_171\bin\java.exe" "-javaagent:D:\Program Files\JetBrains\IntelliJ IDEA 2018.1.1\lib\idea_rt.jar=53353:D:\Program Files\JetBrains\IntelliJ IDEA 2018.1.1\bin" -Dfile.encoding=UTF-8 -classpath "F:\company20180508\items\sys2\target\classes;D:\Program Files (x86)\Java\jdk1.8.0_171\jre\lib\charsets.jar;D:\Program Files (x86)\Java\jdk1.8.0_171\jre\lib\deploy.jar;D:\Program Files (x86)\Java\jdk1.8.0_171\jre\lib\ext\access-bridge-32.jar;D:\Program Files (x86)\Java\jdk1.8.0_171\jre\lib\ext\cldrdata.jar;D:\Program Files (x86)\Java\jdk1.8.0_171\jre\lib\ext\dnsns.jar;D:\Program Files (x86)\Java\jdk1.8.0_171\jre\lib\ext\jaccess.jar;D:\Program Files (x86)\Java\jdk1.8.0_171\jre\lib\ext\jfxrt.jar;D:\Program Files (x86)\Java\jdk1.8.0_171\jre\lib\ext\localedata.jar;D:\Program Files (x86)\Java\jdk1.8.0_171\jre\lib\ext\nashorn.jar;D:\Program Files (x86)\Java\jdk1.8.0_171\jre\lib\ext\sunec.jar;D:\Program Files (x86)\Java\jdk1.8.0_171\jre\lib\ext\sunjce_provider.jar;D:\Program Files (x86)\Java\jdk1.8.0_171\jre\lib\ext\sunmscapi.jar;D:\Program Files (x86)\Java\jdk1.8.0_171\jre\lib\ext\sunpkcs11.jar;D:\Program Files (x86)\Java\jdk1.8.0_171\jre\lib\ext\zipfs.jar;D:\Program Files (x86)\Java\jdk1.8.0_171\jre\lib\javaws.jar;D:\Program Files (x86)\Java\jdk1.8.0_171\jre\lib\jce.jar;D:\Program Files (x86)\Java\jdk1.8.0_171\jre\lib\jfr.jar;D:\Program Files (x86)\Java\jdk1.8.0_171\jre\lib\jfxswt.jar;D:\Program Files (x86)\Java\jdk1.8.0_171\jre\lib\jsse.jar;D:\Program Files (x86)\Java\jdk1.8.0_171\jre\lib\management-agent.jar;D:\Program Files (x86)\Java\jdk1.8.0_171\jre\lib\plugin.jar;D:\Program Files (x86)\Java\jdk1.8.0_171\jre\lib\resources.jar;D:\Program Files (x86)\Java\jdk1.8.0_171\jre\lib\rt.jar;F:\company20180508\items\sys2\src\main\resources\lib\jodd-core-3.4.10.jar;C:\Users\Administrator\.m2\repository\org\springframework\boot\spring-boot-starter-redis\1.3.8.RELEASE\spring-boot-starter-redis-1.3.8.RELEASE.jar;C:\Users\Administrator\.m2\repository\org\springframework\data\spring-data-redis\1.8.1.RELEASE\spring-data-redis-1.8.1.RELEASE.jar;C:\Users\Administrator\.m2\repository\org\springframework\data\spring-data-keyvalue\1.2.1.RELEASE\spring-data-keyvalue-1.2.1.RELEASE.jar;C:\Users\Administrator\.m2\repository\org\springframework\data\spring-data-commons\1.13.1.RELEASE\spring-data-commons-1.13.1.RELEASE.jar;C:\Users\Administrator\.m2\repository\org\springframework\spring-tx\4.3.7.RELEASE\spring-tx-4.3.7.RELEASE.jar;C:\Users\Administrator\.m2\repository\org\springframework\spring-oxm\4.3.7.RELEASE\spring-oxm-4.3.7.RELEASE.jar;C:\Users\Administrator\.m2\repository\org\springframework\spring-aop\4.3.7.RELEASE\spring-aop-4.3.7.RELEASE.jar;C:\Users\Administrator\.m2\repository\org\springframework\spring-context-support\4.3.7.RELEASE\spring-context-support-4.3.7.RELEASE.jar;C:\Users\Administrator\.m2\repository\org\slf4j\slf4j-api\1.7.24\slf4j-api-1.7.24.jar;C:\Users\Administrator\.m2\repository\org\slf4j\jcl-over-slf4j\1.7.24\jcl-over-slf4j-1.7.24.jar;C:\Users\Administrator\.m2\repository\redis\clients\jedis\2.9.0\jedis-2.9.0.jar;C:\Users\Administrator\.m2\repository\org\apache\commons\commons-pool2\2.4.2\commons-pool2-2.4.2.jar;C:\Users\Administrator\.m2\repository\org\springframework\boot\spring-boot-starter\1.5.2.RELEASE\spring-boot-starter-1.5.2.RELEASE.jar;C:\Users\Administrator\.m2\repository\org\springframework\boot\spring-boot\1.5.2.RELEASE\spring-boot-1.5.2.RELEASE.jar;C:\Users\Administrator\.m2\repository\org\springframework\spring-context\4.3.7.RELEASE\spring-context-4.3.7.RELEASE.jar;C:\Users\Administrator\.m2\repository\org\springframework\boot\spring-boot-autoconfigure\1.5.2.RELEASE\spring-boot-autoconfigure-1.5.2.RELEASE.jar;C:\Users\Administrator\.m2\repository\org\springframework\boot\spring-boot-starter-logging\1.5.2.RELEASE\spring-boot-starter-logging-1.5.2.RELEASE.jar;C:\Users\Administrator\.m2\repository\ch\qos\logback\logback-classic\1.1.11\logback-classic-1.1.11.jar;C:\Users\Administrator\.m2\repository\ch\qos\logback\logback-core\1.1.11\logback-core-1.1.11.jar;C:\Users\Administrator\.m2\repository\org\slf4j\jul-to-slf4j\1.7.24\jul-to-slf4j-1.7.24.jar;C:\Users\Administrator\.m2\repository\org\slf4j\log4j-over-slf4j\1.7.24\log4j-over-slf4j-1.7.24.jar;C:\Users\Administrator\.m2\repository\org\springframework\spring-core\4.3.7.RELEASE\spring-core-4.3.7.RELEASE.jar;C:\Users\Administrator\.m2\repository\org\yaml\snakeyaml\1.17\snakeyaml-1.17.jar;C:\Users\Administrator\.m2\repository\org\springframework\boot\spring-boot-starter-web\1.5.2.RELEASE\spring-boot-starter-web-1.5.2.RELEASE.jar;C:\Users\Administrator\.m2\repository\org\hibernate\hibernate-validator\5.3.4.Final\hibernate-validator-5.3.4.Final.jar;C:\Users\Administrator\.m2\repository\javax\validation\validation-api\1.1.0.Final\validation-api-1.1.0.Final.jar;C:\Users\Administrator\.m2\repository\org\jboss\logging\jboss-logging\3.3.0.Final\jboss-logging-3.3.0.Final.jar;C:\Users\Administrator\.m2\repository\com\fasterxml\classmate\1.3.3\classmate-1.3.3.jar;C:\Users\Administrator\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.8.7\jackson-databind-2.8.7.jar;C:\Users\Administrator\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.8.0\jackson-annotations-2.8.0.jar;C:\Users\Administrator\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.8.7\jackson-core-2.8.7.jar;C:\Users\Administrator\.m2\repository\org\springframework\spring-web\4.3.7.RELEASE\spring-web-4.3.7.RELEASE.jar;C:\Users\Administrator\.m2\repository\org\springframework\spring-beans\4.3.7.RELEASE\spring-beans-4.3.7.RELEASE.jar;C:\Users\Administrator\.m2\repository\org\springframework\spring-webmvc\4.3.7.RELEASE\spring-webmvc-4.3.7.RELEASE.jar;C:\Users\Administrator\.m2\repository\org\springframework\spring-expression\4.3.7.RELEASE\spring-expression-4.3.7.RELEASE.jar;C:\Users\Administrator\.m2\repository\org\mybatis\spring\boot\mybatis-spring-boot-starter\1.1.1\mybatis-spring-boot-starter-1.1.1.jar;C:\Users\Administrator\.m2\repository\org\mybatis\spring\boot\mybatis-spring-boot-autoconfigure\1.1.1\mybatis-spring-boot-autoconfigure-1.1.1.jar;C:\Users\Administrator\.m2\repository\org\mybatis\mybatis\3.4.0\mybatis-3.4.0.jar;C:\Users\Administrator\.m2\repository\org\mybatis\mybatis-spring\1.3.0\mybatis-spring-1.3.0.jar;C:\Users\Administrator\.m2\repository\org\springframework\boot\spring-boot-starter-jdbc\1.5.2.RELEASE\spring-boot-starter-jdbc-1.5.2.RELEASE.jar;C:\Users\Administrator\.m2\repository\org\apache\tomcat\tomcat-jdbc\8.5.11\tomcat-jdbc-8.5.11.jar;C:\Users\Administrator\.m2\repository\org\apache\tomcat\tomcat-juli\8.5.11\tomcat-juli-8.5.11.jar;C:\Users\Administrator\.m2\repository\org\springframework\spring-jdbc\4.3.7.RELEASE\spring-jdbc-4.3.7.RELEASE.jar;C:\Users\Administrator\.m2\repository\com\oracle\ojdbc14\10.2.0.4.0\ojdbc14-10.2.0.4.0.jar;C:\Users\Administrator\.m2\repository\com\alibaba\druid\1.0.5\druid-1.0.5.jar;C:\Users\Administrator\.m2\repository\com\github\pagehelper\pagehelper\4.1.6\pagehelper-4.1.6.jar;C:\Users\Administrator\.m2\repository\com\github\jsqlparser\jsqlparser\0.9.5\jsqlparser-0.9.5.jar;C:\Users\Administrator\.m2\repository\javax\servlet\jstl\1.2\jstl-1.2.jar;C:\Users\Administrator\.m2\repository\org\apache\commons\commons-lang3\3.4\commons-lang3-3.4.jar;C:\Users\Administrator\.m2\repository\net\sf\json-lib\json-lib\2.4\json-lib-2.4-jdk15.jar;C:\Users\Administrator\.m2\repository\commons-beanutils\commons-beanutils\1.9.3\commons-beanutils-1.9.3.jar;C:\Users\Administrator\.m2\repository\commons-collections\commons-collections\3.2.2\commons-collections-3.2.2.jar;C:\Users\Administrator\.m2\repository\commons-lang\commons-lang\2.5\commons-lang-2.5.jar;C:\Users\Administrator\.m2\repository\commons-logging\commons-logging\1.1.1\commons-logging-1.1.1.jar;C:\Users\Administrator\.m2\repository\net\sf\ezmorph\ezmorph\1.0.6\ezmorph-1.0.6.jar;C:\Users\Administrator\.m2\repository\org\apache\shiro\shiro-spring\1.2.5\shiro-spring-1.2.5.jar;C:\Users\Administrator\.m2\repository\org\apache\shiro\shiro-core\1.2.5\shiro-core-1.2.5.jar;C:\Users\Administrator\.m2\repository\org\apache\shiro\shiro-web\1.2.5\shiro-web-1.2.5.jar;C:\Users\Administrator\.m2\repository\org\apache\shiro\shiro-ehcache\1.2.5\shiro-ehcache-1.2.5.jar;C:\Users\Administrator\.m2\repository\net\sf\ehcache\ehcache-core\2.5.0\ehcache-core-2.5.0.jar;C:\Users\Administrator\.m2\repository\org\apache\poi\poi\3.7\poi-3.7.jar;C:\Users\Administrator\.m2\repository\com\alibaba\fastjson\1.2.24\fastjson-1.2.24.jar" sc.SpringBootWebApplication
Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/core/env/EnvironmentCapable
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at sc.SpringBootWebApplication.main(SpringBootWebApplication.java:16)
Caused by: java.lang.ClassNotFoundException: org.springframework.core.env.EnvironmentCapable
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 13 more

Process finished with exit code 1

<parent>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-parent</artifactId>
   <version>1.5.9.RELEASE</version>
   <relativePath /> <!-- lookup parent from repository -->
</parent>
匯入專案使用的父工程依賴是1.5.3版本,重新將專案版本更改為1.5.9後,reimport啟動成功