【问题标题】:Grails error unable to create bean, only with scaffoldingGrails错误无法创建bean,只能使用脚手架
【发布时间】:2014-06-15 15:04:01
【问题描述】:

圣杯:2.4 Java:甲骨文 1.7 操作系统:Ubuntu 14.04 你好朋友, 我正在研究一个示例项目,以提高我对 grails 的了解。对于控制器文件,当我将 def index() { } 替换为 def scaffold = EventManagment,我收到一个错误,日志如下所述。如果我不添加该行,然后我进入 localhost 页面,那么我看不到 Web 应用程序正在运行。请让我知道该怎么做。谢谢你。 控制器文件是 /grails-2.4.0/EventMg/grails-app/controllers/com/Evenmgmt.groovy。 日志:

| 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

【问题讨论】:

    标签: grails scaffolding


    【解决方案1】:

    我能够通过全新安装旧版本的 Ubuntu 来解决问题。相同的代码有效。这个问题对我来说标记为已回答。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-06-25
      • 1970-01-01
      • 1970-01-01
      • 2013-11-06
      • 1970-01-01
      • 2018-11-21
      • 2016-05-21
      相关资源
      最近更新 更多