`

Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTup

阅读更多
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionfactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]

缺少 javassist.jar

下载地址:http://jboss.org/javassist/downloads/


最近一直在看java的三大开源框架(Struts、Spring、Hibernate)其中遇到点问题,在下费了好大劲才找到原因,所以把我的错误贴出来供大家分享,以至有同样错误的网友有个参考。
好,下面则是开篇:

我在做Spring和Hibernate整合的时候报了以下的错误:

Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file […….xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]

在百度、Google上都没找到解决方法。可能运气不好,百度只有几条结果。其中只有一条有个解决方法:
缺少 javassist.jar。索性下载它并添加进lib,结果还是不行。其它的根本就是只有提问没有回答。Google搜索的结果到挻多但中文的大多跟百度的结果差不多,有些英文的看不太懂。后来索性自己找问题。

我逐步的缩减项目把项目精减到最小,最后终于发现hibernate.cfg.xml里的mapping项目中有一条.hbm.xml文件配置写错了,暂时把它删除了,调试程序。问题解决。

这篇文章写得有点长,解决方法技术含量并不高,主要强调的是自己解决问题的思路及步骤,希望能给有同样问题的朋友一点帮助。


更有可能的是包的冲突,因为后面的错误信息中有如下错误:
NoClassDefFoundError: org/objectweb/asm/CodeVisitor
在google上一搜就有很多解决方法
分享到:
评论
3 楼 wawame 2011-03-08  
谢谢,辛苦了。
2 楼 zhou363667565 2010-12-21  
我也遇到这个错误了。 看到您的 解决方案。 问题解决了。 谢谢。
1 楼 home309 2010-04-09  
谢谢,辛苦了..

相关推荐

Global site tag (gtag.js) - Google Analytics