We are Borg
We are Borg

Reputation: 5313

Grails error unable to create bean, only with scaffolding

Grails : 2.4 Java : Oracle 1.7 OS : Ubuntu 14.04 Hello Friends, I am working on a sample project to improve my knowledge in grails. For the controller file, when I replace def index() { } with def scaffold = EventManagment, I get an error of which the log is mentioned below. If I dont add that line, and I go on localhost page, then I don't see the web-app in action. Kindly let me know what to do. Thank you. Controller file is /grails-2.4.0/EventMg/grails-app/controllers/com/Evenmgmt.groovy. Log :

| Running Grails application
| Error 2014-06-15 16:47:52,353 [localhost-startStop-1] ERROR context.GrailsContextLoaderListener  - Error initializing the application: Error creating bean with name 'com.tekdays.TekEventController': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.tekdays.TekEventController]: Constructor threw exception; nested exception is java.lang.NullPointerException
Message: Error creating bean with name 'com.tekdays.TekEventController': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.tekdays.TekEventController]: Constructor threw exception; nested exception is java.lang.NullPointerException
    Line | Method
->>  266 | run       in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|   1142 | runWorker in java.util.concurrent.ThreadPoolExecutor
|    617 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^    745 | run       in java.lang.Thread
Caused by BeanInstantiationException: Could not instantiate bean class [com.tekdays.TekEventController]: Constructor threw exception; nested exception is java.lang.NullPointerException
->>  266 | run       in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|   1142 | runWorker in java.util.concurrent.ThreadPoolExecutor
|    617 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^    745 | run       in java.lang.Thread
Caused by NullPointerException: null
->>  266 | run       in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|   1142 | runWorker in java.util.concurrent.ThreadPoolExecutor
|    617 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^    745 | run       in java.lang.Thread
| Error Forked Grails VM exited with error

Upvotes: 2

Views: 354

Answers (1)

We are Borg
We are Borg

Reputation: 5313

I was able to fix the problem by a clean installation of old version of Ubuntu. Same code worked. This question for me marks as answered.

Upvotes: 1

Related Questions