2

I'm using Maven for dependency management. When I run the test cases an exception occurs at the end of test cases though test cases pass successfully.

Following is my stack trace:

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

I'm using Grails 2.1.3. I have tried both, "static" and "dynamic" scaffolding but it did not resolve the issue.

I also referred to What does this exception mean? issue but no luck.

Community
  • 1
  • 1
user9873999
  • 311
  • 3
  • 15
  • I had this issue, and to be honest not sure how it was fixed. But as I mentioned on those comments, mine seemed to be related to dynamic scaffolded controllers. Maybe I had some tests against those and removed them while re-factoring and that fixed my problem. If you have an empty generated test remove them see if that helps. Also one suggestion try to narrow down the test, comment them out find which test suite is causing it. – Alidad Oct 08 '13 at 19:23
  • I removed all test case and tried to execute "grails test-app", Still facing same issue :(. – user9873999 Oct 10 '13 at 05:11

2 Answers2

0

One user with a similar error fixed it by deleting the project folder in his ~/.grails directory. http://grails.1312388.n4.nabble.com/Database-migration-plugin-Running-dbm-gorm-diff-results-Error-creating-bean-with-name-instanceContro-td4637567.html

A good ol' grails clean might help too, and be less invasive.

Also, if you can share the project through source control (git, mercurial, svn), you might try reproducing the issue on another machine. If you can't, that's a good sign that the issue is peculiar to your environment, and could be resolved through some sort of cleanup.

jonnybot
  • 2,435
  • 1
  • 32
  • 56
0

I have resolved my issue. I am not sure why it was occurring but i had many controller where scaffold=true. I generated the all controller and view and it resolved my issue.

user9873999
  • 311
  • 3
  • 15