测试用例结束时发生异常

时间:2013-10-08 11:11:54

标签: maven testing grails grails-2.1

我正在使用Maven进行依赖管理。当我运行测试用例时,虽然测试用例成功通过,但在测试用例结束时会发生异常。

以下是我的堆栈跟踪:

2013-10-08 16:04:22,839 [Thread-15] ERROR plugins.DefaultGrailsPlugin  - Error configuration     scaffolding: Error creating bean with name 'instanceControllersApi': Singleton bean creation not allowed while the singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)
Message: Error creating bean with name 'instanceControllersApi': Singleton bean creation not allowed while the singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)
Line | Method
->> 662 | run in java.lang.Thread
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -     

我正在使用Grails 2.1.3。我已尝试过两种“静态”和“动态”脚手架,但它没有解决问题。

我也提到What does this exception mean?问题,但没有运气。

2 个答案:

答案 0 :(得分:0)

一个有类似错误的用户通过删除〜/ .grails目录中的项目文件夹来修复它。 http://grails.1312388.n4.nabble.com/Database-migration-plugin-Running-dbm-gorm-diff-results-Error-creating-bean-with-name-instanceContro-td4637567.html

良好的'grails clean也可能有所帮助,并且侵入性较小。

此外,如果您可以通过源代码管理(git,mercurial,svn)共享项目,您可以尝试在另一台计算机上重现该问题。如果你做不到,这是一个好的迹象,表明这个问题对你的环境来说是特殊的,并且可以通过某种清理来解决。

答案 1 :(得分:0)

我已经解决了我的问题。我不知道它为什么会发生,但我有很多控制器,其中scaffold = true。我生成了所有控制器和视图,它解决了我的问题。