当前位置: 代码迷 >> Java Web开发 >> [求助]Hibernate建立SessionFactory时报错
  详细解决方案

[求助]Hibernate建立SessionFactory时报错

热度:277   发布时间:2007-08-14 11:19:48.0
[求助]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  

----------------解决方案--------------------------------------------------------
dataSource的配置呢??

----------------解决方案--------------------------------------------------------
  相关解决方案