spring+HIBERNATE305换成313报错,请大侠们给看下

zhou7707 2006-08-29 06:14:44
Context initialization failed at org.springframework.web.context.ContextLoader.(ContextLoader.java:205)
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 java.lang.NoClassDefFoundError: org/hibernate/cfg/HbmBinder$SecondPass
Caused by:
java.lang.NoClassDefFoundError: org/hibernate/cfg/HbmBinder$SecondPass
是313中没了这个HbmBinder$SecondPass类,确实没了该怎么和SPRING集成?
...全文
333 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhou7707 2006-09-01
  • 打赏
  • 举报
回复
谢谢,我把SPRING升到2.0RC2,去掉hibernate-annotations.jar包,问题解决,等会再DOWN个hibernate-annotations.jar的新版试试。
pigo 2006-08-31
  • 打赏
  • 举报
回复


同时还需要更新hibernate-annotations 到新版本。

换上最新的 hibernate-annotations.jar就可以了。

wangx1949 2006-08-30
  • 打赏
  • 举报
回复
Spring里面应该有另外的插件和hb集成的,可以去javaeye问问
zhou7707 2006-08-30
  • 打赏
  • 举报
回复
自己顶一下,我初步估计是项目中引用的其他包有版本不匹配的问题,但我把所有库升到最新版,问题依旧,看老外一篇帖子说是HIBERNATE的新版本导致的问题,但是现在人们确实有用3.1.3版HIBERNATE和SPRING集成的,不知和3.0.5的配置有什么不同,项目快要上线了,大家帮帮忙.
icy_csdn 2006-08-29
  • 打赏
  • 举报
回复
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/db</property>
<property name="hibernate.connection.useUnicode">true</property>
<property name="hibernate.connection.characterEncoding">utf8</property>
<property name="hibernate.connection.username"></property>
<property name="hibernate.connection.password"></property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.c3p0.min_size">5</property>
<property name="hibernate.c3p0.max_size">20</property>
<property name="hibernate.c3p0.timeout">300</property>
<property name="hibernate.c3p0.max_statements">500</property>
<property name="hibernate.c3p0.idle_test_period">3000</property>
</session-factory>
</hibernate-configuration>
icy_csdn 2006-08-29
  • 打赏
  • 举报
回复
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation">
<value>/WEB-INF/classes/mysql.cfg.xml</value>
</property>
<property name="mappingDirectoryLocations">
<list>
<value>classpath:/com/...</value>
</list>
</property>
</bean>

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧