Spring加载了Gradle,Groovy和spring-boot失败了java.lang.NoSuchFieldException:classCache

时间:2014-10-31 13:48:37

标签: groovy intellij-idea gradle spring-boot spring-loaded

我成功设置了一个spring-boot-groovytemplates和执行器项目。 但是,当添加springloaded到buildscript / dependencies块时,我在IDEA中重新编译时得到以下stracktrace

java.lang.NoSuchFieldException: classCache
    at java.lang.Class.getDeclaredField(Class.java:1918)
    at org.springsource.loaded.agent.SpringPlugin.clearCachedIntrospectionResults(SpringPlugin.java:162)
    at org.springsource.loaded.agent.SpringPlugin.reloadEvent(SpringPlugin.java:127)
    at org.springsource.loaded.TypeRegistry.fireReloadEvent(TypeRegistry.java:1767)
    at org.springsource.loaded.ReloadableType.loadNewVersion(ReloadableType.java:405)
    at org.springsource.loaded.TypeRegistry.loadNewVersion(TypeRegistry.java:845)
    at org.springsource.loaded.agent.ReloadableFileChangeListener.fileChanged(ReloadableFileChangeListener.java:51)
    at org.springsource.loaded.agent.Watcher.determineChangesSince(FileSystemWatcher.java:235)
    at org.springsource.loaded.agent.Watcher.run(FileSystemWatcher.java:219)
    at java.lang.Thread.run(Thread.java:695)

任何线索?

1 个答案:

答案 0 :(得分:3)

您没有提到您正在使用的Spring Framework或Spring Loaded的哪个版本,但我猜您正在尝试将Spring Loaded 1.2.0与Spring Framework 4.1一起使用。看起来你已经在Spring Loaded中点击了this bug。您应该升级到Spring Loaded 1.2.1,因为它包含a change,它可以解决问题并使其与Spring Framework 4.1兼容。