Grails 2.4.3 fails to reload controller or service

自闭症网瘾萝莉.ら 提交于 2019-12-19 17:38:58

问题


I have upgraded a Grails 2.3.8 project to 2.4.3. In 2.3.8 we had problems with forked execution, so I have disabled it. Now, when I enable it, and try to reload a changed service or controller class, I get error like these:

2014-09-25 19:50:37,043 [Thread-11] ERROR plugins.AbstractGrailsPluginManager  - 
Plugin [controllers:2.4.3] could not reload changes to file [C:\projects2\...\grails-app\controllers\com\...\AdminController.groovy]: 
Cannot get property 'cacheOperationSource' on null object
java.lang.NullPointerException: Cannot get property 'cacheOperationSource' on null object

2014-09-25 19:42:26,251 [Thread-11] ERROR plugins.AbstractGrailsPluginManager  - 
Plugin [controllers:2.4.3] could not reload changes to file [C:\projects2\...\grails-app\controllers\...\AdminController.groovy]:
Cannot get property 'instanceControllerTagLibraryApi' on null object
java.lang.NullPointerException: Cannot get property 'instanceControllerTagLibraryApi' on null object

I have in BuildConfig

forkConfig = [maxMemory: 2048, minMemory: 2048, debug: false, minPerm:256, maxPerm: 512]
grails.project.fork = [
    test: forkConfig,
    run: forkConfig, 
    war: forkConfig, 
    console: forkConfig
] 

I run Grails so:

set JAVA_OPTS=-Dgrails.full.stacktrace=true -Ddisable.auto.recompile=true -Xmx2048M -Xms2048M -XX:PermSize=512m -XX:MaxPermSize=1024m -Djava.net.preferIPv4Stack=true
grailsw --stacktrace --verbose -Dserver.port=5678 run-app %1 %2 %3 %4

The error comes no matter if I have -reloading in run-app or not. Am I understanding something wrong? Is it so, that I can't have reloading AND forked execution at the same time?

If I set all forked entries to false, it works like before.

Thank you in advance. Best regards: Balázs


回答1:


A similar problem was posted in the grails dev discus mailing list a few hourse ago. From the sample app that I was able to view, it seems the error happened when the package name of the class being edited had "grails" in it. https://groups.google.com/forum/#!topic/grails-dev-discuss/u5gvuwWXoTk

You should check for that in your naming convention and change it to something more specific to your app....



来源:https://stackoverflow.com/questions/26045344/grails-2-4-3-fails-to-reload-controller-or-service

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!