Grails 2.4.3无法重新加载控制器或服务 [英] Grails 2.4.3 fails to reload controller or service

查看:265
本文介绍了Grails 2.4.3无法重新加载控制器或服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经将Grails 2.3.8项目升级到2.4.3。在2.3.8中,我们遇到了分叉执行的问题,所以我禁用了它。现在,当我启用它并尝试重新加载更改后的服务或控制器类时,出现如下错误:

  2014- 09-25 19:50:37,043 [Thread-11] ERROR plugins.AbstractGrailsPluginManager  -  
插件[controllers:2.4.3]无法重新加载文件[C:\projects2\\\grails -app\controllers\com\ ... \AdminController.groovy]:
无法在空对象上获取属性'cacheOperationSource'
java.lang.NullPointerException:无法获取属性'cacheOperationSource' null对象

2014-09-25 19:42:26,251 [Thread-11] ERROR plugins.AbstractGrailsPluginManager -
插件[controllers:2.4.3]无法重新加载文件[C :\projects2\ ... \grails-app\controllers\ ... \AdminController.groovy]:
无法在null对象上获取属性'instanceControllerTagLibraryApi'
java.lang。 NullPointerException:无法在空对象上获取属性'instanceControllerTagLibraryApi'

我在BuildConfig中

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

我运行Grails:

  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

无论我是否在run-app中运行,不。我是否理解错误?是这样的,我不能重新加载并同时分叉执行吗?



如果我将所有分支条目设置为false,它就像以前一样工作。 p>

预先感谢您。
最好的问候:Balázs

解决方案

类似的问题几个小时前发布在grails dev cookies邮件列表中。从我能够查看的示例应用程序中看来,当正在编辑的类的包名称中包含grails时,发生错误。
https://groups.google.com/forum /#!topic / grails-dev-discuss / u5gvuwWXoTk



您应该检查命名约定中的内容,并将其更改为更具体的应用程序....


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

解决方案

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....

这篇关于Grails 2.4.3无法重新加载控制器或服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆