有關eclipse for java ee版本遇到的坑( Context initialization failed)


這幾天把以前網上看的視頻的源代碼拷貝到eclipse下面進行學習,當時用的是eclipse-jee-neon-M4a-win32-x86_64這個版本的eclipse,因為它本身集合了web開發插件,誰知道弄好后,發現他需要運行在java8的版本下面,后來就下載安裝java8,誰知道一切准備就緒后,發現我的項目無法運行,一直再報

嚴重: Context initialization failed
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:52)
at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80)
at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:101)
at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:76)
at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:298)
at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:300)
at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:300)

。。。。

這個錯,我一直在網上找后來找到了答案

http://stackoverflow.com/questions/24128045/spring-context-initialization-failed-with-java-lang-illegalargumentexception-whi

后來我才知道,這個項目因為應用了spring 框架,但是這個框架如果想在java8下面開發使用,就必須使用spring 4.0以上的版本,否則就會報錯。

所以解決方案兩種,要么讓自己項目中的所有spring的jar包換成4.0以上的,要么就是更換eclipse版本,同時使用java7以及以下的版本來編譯運行項目


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM