标题:[求助]Hibernate建立SessionFactory时报错
只看楼主
ice00mouse
Rank: 1
等 级:新手上路
帖 子:34
专家分:0
注 册:2007-2-2
 问题点数:0 回复次数:1 
[求助]Hibernate建立SessionFactory时报错

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/dispatcherServlet-servlet.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.orm.hibernate3.LocalSessionFactoryBean]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError

在dispatcherServlet-servlet.xml中关于sessionFactory的配置是这样的:
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref local="dataSource" />
</property>
<property name="mappingResources">
<list>
<value>wang/po/User.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
</bean>

commons-dbcp.jar;commons-pool.jar我已经加到classpath中了..

相关代码都是书中的例子,,应该不会有错误;;

使用的Hibernate3和tomcat5.5.23版本..

在线求救等..

这个问题已经困扰了我两天了..网上也找了,真的没办法自己解决..
搜索更多相关主题的帖子: Hibernate 
2007-08-14 11:19
hardes
Rank: 1
等 级:新手上路
帖 子:322
专家分:0
注 册:2006-6-3
得分:0 
dataSource的配置呢??

当神已无能为力,就让爷来普度众生吧!
2007-08-14 12:10



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-162555-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.679271 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved