MyEclipse 保存文件時報錯 An internal error occurred during: "Building Spring AOP reference model" 的解決方法

問題描述:

因爲使用了Spring 的 AOP,每次在保存的時候都報如下錯誤:

An internal error occurred during: "Building Spring AOP reference model".
java.lang.IllegalArgumentException

搜了一大圈的解決方案,在國外的Genuitec上找到了答案,原文如下:
OK. I saw this reply on another post “Thanks for the trace – this is an error in the core of the JDT, very unusual.
Do you have the right Java compiler settings locally? For instance, are the right Java versions configured in the Java Compiler properties page, and does the project have the right JRE assigned to it?
You should be able to prevent the AOP builder from running by going to Project properties > Project Facets > Spring and then choose the “General Project Configuration” tab. You can deselect the “AOP Reference Model Builder” here. Alternatively, you could turn this off globally at the preferences level too. Note that this will disable some of the cross-cutting information displayed in the Spring Explorer and some hyperlink based navigation in Spring configuration files, so ideally, it would be good to get the project settings corrected to prevent this error.”
And I turned off the setting and i don’t get that error any longer.

翻譯過來的解決方案如下:
打開Project properties > Project Facets > Spring 



然後看到 “General Project Configuration” 標薟被選擇
先勾選上Enable project specific settings

再取消選擇“AOP Reference Model Builder”,OK,問題解決。



如果上面的方法不能解決你的問題,網上還有一個方案,如下:

由於錯誤發生在更改保存擁有spring配置語法的beans.xml(Spring配置文件)時發生,所以可以推知是Spring IDE框架的驗證(Validate)錯誤。目前還沒有找到解決問題的方法,而這也不影響程序的運行,AOP也依然能正常運行,所以我只設置了關閉該錯誤對應的Spring驗證。
關閉方法:window--->preference--->Spring--->Validation--->Project Builder,把AOP Reference Model Builder的勾去掉即可。

發佈了83 篇原創文章 · 獲贊 333 · 訪問量 68萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章