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]
找了我两天,终于发现是.hbm.xml中
<id name="customerId" type="long">
<column name="CUSTOMER_ID" />
<generator class="identity" />
</id>
<property name="name" type="string">
<column name="NAME" length="45" not-null="true" />
</property>
应该改为:
<id name="customerId" type="java.lang.Long">
<column name="CUSTOMER_ID" />
<generator class="identity" />
</id>
<property name="name" type="java.lang.String">
<column name="NAME" length="45" not-null="true" />
</property>
报错能不能报出详细信息啊,漫无目的的找实在是太痛苦。。。
本文深入分析了在使用Spring框架时遇到的关于Hibernate的BeanCreationException问题,详细介绍了错误产生的原因以及如何通过修改.hbm.xml文件中的属性来解决此问题。文章旨在帮助开发者快速定位并解决类似的初始化失败问题。
9052

被折叠的 条评论
为什么被折叠?



