grails - 仅使用脚手架,Grails错误无法创建Bean

标签 grails scaffolding

Cereal :2.4
Java:Oracle 1.7
操作系统:Ubuntu 14.04
你好 friend ,
我正在研究一个示例项目,以提高我对grails的了解。对于 Controller 文件,当我将def index(){}替换为
def scaffold = EventManagment,我收到一个错误,该错误在下面提到。如果我不添加该行,而转到本地主机页面,则看不到该Web应用程序正在运行。请让我知道该怎么办。谢谢。
Controller 文件为/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

最佳答案

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

关于grails - 仅使用脚手架,Grails错误无法创建Bean,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24230912/

相关文章:

vb.net - 为什么 <ScaffoldColumn(False)> 不起作用?

grails - 在grails-app/domain中找不到域类

ruby-on-rails - 为什么 Ruby on Rails 专业人士不使用脚手架?

grails - Grails Spring Security Facebook登录错误

ajax - Grails formRemote标签错误

grails - 如何使用Groovy渲染插件在PDF中显示页码

asp.net-mvc - 将 Asp.net mvc 添加到现有 Web 应用程序如何获取脚手架选项

grails - 如何在Grails中使用Flyway

grails - 使用Grails Spring Security插件登录的其他字段

javascript - 如何在 yeoman 上下文中从 `this.prompt` 获取存储的选项?