4

I am using Grails 2.2.2 with GGTS 3.3M1. When I run my app (grails run-app) and change something in a groovy file then Grails recompiles the file. During this process the following error output occurs:

 | Error Unexpected problem clearing ThreadGroupContext beaninfo: 
 | Error java.lang.ClassCastException: java.beans.WeakIdentityMap cannot be cast to java.util.Map
 | Error    at org.springsource.loaded.agent.JVMPlugin.reloadEvent(JVMPlugin.java:77)
 | Error    at org.springsource.loaded.TypeRegistry.fireReloadEvent(TypeRegistry.java:1594)
 | Error    at org.springsource.loaded.ReloadableType.loadNewVersion(ReloadableType.java:396)
 | Error    at org.springsource.loaded.TypeRegistry.loadNewVersion(TypeRegistry.java:805)
 | Error    at org.springsource.loaded.agent.ReloadableFileChangeListener.fileChanged(ReloadableFileChangeListener.java:51)
 | Error    at org.springsource.loaded.agent.Watcher.determineChangesSince(FileSystemWatcher.java:218)
 | Error    at org.springsource.loaded.agent.Watcher.run(FileSystemWatcher.java:205)
 | Error    at java.lang.Thread.run(Thread.java:722)
 Reloading: JVMPlugin: warning: unable to clear BEANINFO_CACHE, cant find field

The compilation seems to work fine but the error still occurs.

tim_yates
  • 167,322
  • 27
  • 342
  • 338
Michael
  • 32,527
  • 49
  • 210
  • 370
  • This error seems to happen with JDK 1.7. I suggest you to try using GGTS 3.2 + the latest JDK 1.6, it's working here for me. –  Apr 29 '13 at 19:04
  • I cannot do that because I need JAva 1.7 for my application. – Michael Apr 29 '13 at 19:06
  • potentially related to this: http://grails.1312388.n4.nabble.com/Reloading-JVMPlugin-warning-unable-to-clear-BEANINFO-CACHE-cant-find-field-td4644050.html and this https://jira.grails.org/browse/GRAILS-10027 It says it's fixed but I'm on JDK 1.7.0_55 and Grails 2.2 and i still get it. On odd occasions I also get the above error. – mastaBlasta May 07 '14 at 18:55

1 Answers1

9

This is because you are on JDK 1.7 update 21. Something 'moved' in the JDK at that version and the state clearing logic needs updating in springloaded. This is already fixed in the springloaded codebase but won't be in a new grails version for a little while. Older versions of JDK 1.7 would be fine. You can ignore the message, but it means some state was not cleared when a type was reloaded - and this means it may look like it hasn't reloaded some of the changes you might make to your types.

Andy Clement
  • 2,510
  • 16
  • 11