【问题标题】:Grails doesn't run my applicationGrails 不运行我的应用程序
【发布时间】:2014-08-05 18:29:44
【问题描述】:

我正在尝试运行 grails 应用程序,但它会生成此错误:

aused by BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.HibernateException: Missing table: accounting_category
->>  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 BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.HibernateException: Missing table: accounting_category
->>  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 HibernateException: Missing table: accounting_category
->>  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

我在网上做了一些研究,但不幸的是,我找不到任何可行的解决方案,,,有什么想法吗?

【问题讨论】:

  • 在错误消息中,表 accounting_category 丢失。您有任何具有该名称的域类吗?你的数据库配置是什么(Datasource.groovy)。
  • 你能发布你的 DataSource.groovy 吗?您使用的是哪个版本的 Grails?你试过 clean/clean-all 吗?

标签: grails


【解决方案1】:

错误消息清楚地表明缺少表。因此您的表可能会被重命名或删除。所以请检查您的域[您是否在域的映射部分表中定义了(名称:“accounting_category”)? ] 以及具有表 accounting_category 的数据库。

【讨论】:

    猜你喜欢
    • 2013-05-23
    • 2013-11-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-02
    • 2010-09-28
    • 2016-07-20
    • 1970-01-01
    相关资源
    最近更新 更多