Grails clean

| |
[阴 2009/03/19 21:26 | by xeric ]
标题是个很简单的东西,问题却由下面这段既不提示groovy代码出错行又不具体告知问题的root cause的欠揍的错误信息引起的。

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to be
an 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error c
reating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.MappingException

引起这个问题的可能性很多,逛了几个国外的maillist,
主要集中在
1:同一个domain class中定义了两个domain definition
2:有个domain class是abstract的
3:你的数据库有了点小问题,重启下数据库试试

好了,我把代码检查了100遍啊100遍,没发现错误也没发现上述问题,
数据库重启了100遍啊100遍,当然,夸张了点,不过我想说的是,就算1000遍也许也没用,
当然,如果你找到代码错误了,那就抽自己吧。

我没抽自己,在万分无奈下,我想起了zend framework和ROR开发时的一个小细节:
马上检查是否grails有clean命令,发现果然有,执行之,重启,问题解决,

郁闷,不是第一次了,每个框架都要搞点缓存的事情出来调戏下我。。。。

以后要首选clean。
Tags:
开发[DEV] | 评论(0) | 引用(0) | 阅读(740)
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
昵称   密码   游客无需密码
网址   电邮   [注册]
               

验证码 请输入左侧的字母,不区分大小写