我刚刚升级到Grails 2.0,我在run-app上看到了以下错误。 它表示线上的NPE只是
return fileSpec;
我现在已经搜索了互联网一段时间了,我发现有些人在使用各种插件时遇到了问题,但没有具体说明这个NPE问题。使用组件扫描程序加载我的Spring bean似乎是一个问题,但我很难过为什么它不再工作了。在Grails 1.3.7之前,它正在顺利地滴答作响 - > 2.0升级。
如果有任何Grails或者也许是春季3.1大师可以指出我正确的方向,我将不胜感激。感谢。
这是错误:
=============== DEBUG MESSAGE: unimplemented bytecode ================
| Error 2012-01-17 21:21:42,273 [Thread-10] ERROR context.GrailsContextLoader - Error executing bootstraps: Error creating bean with name 'fileSpec': Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public myproject.spec.FileSpec myproject.spec.MyFileSpecGenerator.createFileSpec()] threw exception; nested exception is java.lang.NullPointerException
Message: Error creating bean with name 'fileSpec': Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public myproject.spec.FileSpec myproject.spec.MyFileSpecGenerator.createFileSpec()] threw exception; nested exception is java.lang.NullPointerException
Line | Method
->> 303 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 138 | run in java.util.concurrent.FutureTask
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run in ''
^ 680 | run . . in java.lang.Thread
Caused by BeanDefinitionStoreException: Factory method [public myproject.spec.FileSpec myproject.spec.MyFileSpecGenerator.createFileSpec()] threw exception; nested exception is java.lang.NullPointerException
->> 303 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 138 | run in java.util.concurrent.FutureTask
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run in ''
^ 680 | run . . in java.lang.Thread
Caused by NullPointerException: null
->> 2027 | createFileSpec in myproject.spec.MyFileSpecGenerator
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 303 | innerRun in java.util.concurrent.FutureTask$Sync
| 138 | run . . in java.util.concurrent.FutureTask
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run . . in ''
^ 680 | run in java.lang.Thread
可能相关:我的resources.groovy
beans = {
fileSpec(fileSpecGenerator:"createFileSpec")
}