我正在将 2.3 应用程序升级到 2.4.4,但在启动时遇到了一个奇怪的错误:
Caused by BeanCreationException: Error creating bean with name 'codecLookup': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: [Assertion failed] - this String argument must have text; it must not be null, empty, or blank
->> 788 | callContextInitialized in org.eclipse.jetty.server.handler.ContextHandler
有没有人以前见过这个或者可以给我任何关于可能导致它的指示?
最佳答案
我已经弄清楚了。我在 grails-app/utils 中定义了一个抽象基础编解码器以及几个子类,即
grails-app/utils/
BaseCodec.groovy
MyCodec.groovy
abstract class BaseCodec {
...
}
class MyCodec extends BaseCodec {
...
}
在 2.3+ 中这有效但是在 2.4 中 grails 不喜欢 utils 中的抽象类所以我将它移动到 src/groovy:
src/groovy/BaseCodec.groovy
grails-app/utils/MyCodec.groovy
这解决了错误。我希望从现在开始所有抽象的“grails 管理”类(编解码器、服务、域等)都应该放在 src/groovy 中
关于Grails 2.4.4 无法创建 codecLookup bean,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28356997/