Grails 3.3.2 / Hot Reloading / Unexpected Error尝试调用静态初始化程序时

时间:2018-01-27 01:49:33

标签: grails grails-spring-security

当我对控制器进行更改时,热重新加载会出现以下错误:

2018-01-26 19:37:43.752 ERROR --- [Loader@14dad5dc] o.s.loaded.CurrentLiveVersion            : Unexpected exception whilst trying to call the static initializer on com.emmanuj.cleena.Requestmap
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.springsource.loaded.CurrentLiveVersion.runStaticInitializer(CurrentLiveVersion.java:311)
        at org.springsource.loaded.ReloadableType.loadNewVersion(ReloadableType.java:433)
        at org.springsource.loaded.TypeRegistry.loadNewVersion(TypeRegistry.java:1018)
        at org.springsource.loaded.agent.ReloadableFileChangeListener.fileChanged(ReloadableFileChangeListener.java:104)
        at org.springsource.loaded.agent.Watcher.determineChangesSince(FileSystemWatcher.java:251)
        at org.springsource.loaded.agent.Watcher.run(FileSystemWatcher.java:235)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalAccessError
        at com.emmanuj.cleena.Requestmap$$EQhtIzZ2.___clinit___(Requestmap.groovy)
        ... 11 more
2018-01-26 19:37:43.770 ERROR --- [Loader@14dad5dc] o.s.loaded.CurrentLiveVersion            : Unexpected exception whilst trying to call the static initializer on com.emmanuj.cleena.Role
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.springsource.loaded.CurrentLiveVersion.runStaticInitializer(CurrentLiveVersion.java:311)
        at org.springsource.loaded.ReloadableType.loadNewVersion(ReloadableType.java:433)
        at org.springsource.loaded.TypeRegistry.loadNewVersion(TypeRegistry.java:1018)
        at org.springsource.loaded.agent.ReloadableFileChangeListener.fileChanged(ReloadableFileChangeListener.java:104)
        at org.springsource.loaded.agent.Watcher.determineChangesSince(FileSystemWatcher.java:251)
        at org.springsource.loaded.agent.Watcher.run(FileSystemWatcher.java:235)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalAccessError
        at com.emmanuj.cleena.Role$$EQhtIzZ2.___clinit___(Role.groovy)
        ... 11 more
2018-01-26 19:37:43.827 ERROR --- [Loader@14dad5dc] o.s.loaded.CurrentLiveVersion            : Unexpected exception whilst trying to call the static initializer on com.emmanuj.cleena.User
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.springsource.loaded.CurrentLiveVersion.runStaticInitializer(CurrentLiveVersion.java:311)
        at org.springsource.loaded.ReloadableType.loadNewVersion(ReloadableType.java:433)
        at org.springsource.loaded.TypeRegistry.loadNewVersion(TypeRegistry.java:1018)
        at org.springsource.loaded.agent.ReloadableFileChangeListener.fileChanged(ReloadableFileChangeListener.java:104)
        at org.springsource.loaded.agent.Watcher.determineChangesSince(FileSystemWatcher.java:251)
        at org.springsource.loaded.agent.Watcher.run(FileSystemWatcher.java:235)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalAccessError
        at com.emmanuj.cleena.User$$EQhtIzZ2.___clinit___(User.groovy)
        ... 11 more
2018-01-26 19:37:43.897 ERROR --- [Loader@14dad5dc] o.s.loaded.CurrentLiveVersion            : Unexpected exception whilst trying to call the static initializer on com.emmanuj.cleena.UserRole
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.springsource.loaded.CurrentLiveVersion.runStaticInitializer(CurrentLiveVersion.java:311)
        at org.springsource.loaded.ReloadableType.loadNewVersion(ReloadableType.java:433)
        at org.springsource.loaded.TypeRegistry.loadNewVersion(TypeRegistry.java:1018)
        at org.springsource.loaded.agent.ReloadableFileChangeListener.fileChanged(ReloadableFileChangeListener.java:104)
        at org.springsource.loaded.agent.Watcher.determineChangesSince(FileSystemWatcher.java:251)
        at org.springsource.loaded.agent.Watcher.run(FileSystemWatcher.java:235)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalAccessError
        at com.emmanuj.cleena.UserRole$$EQhtIzZ2.___clinit___(UserRole.groovy)
        ... 11 more

不确定如何访问完整的堆栈跟踪,但看起来这种情况发生在具有@GrailsCompileStatic注释的Spring Security类中。 我有以下配置:

  • Grails 3.3.2
  • spring-security-core plugin v3.3.2
  • spring-security-rest插件v2.0.0.M2;和
  • JVM 1.8

更新:在我的控制器中进行更改,然后从grails交互式提示符运行compile命令后,会出现此错误。

0 个答案:

没有答案