Error creating bean with name 'transactionManager' defined in ServletContext resource这个问题如何解决啊?(急)

woaitiyu 2008-06-25 08:31:06
配置文件中是这样写的,
<bean id="transactionManager"
class="org.springframework.orm.hibernate.HibernateTransactionManager">
<property name="sessionFactory">
<ref local="sessionFactory" />
</property>
</bean>


<bean id="baseTransaction"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"
abstract="true">
<property name="transactionManager" ref="transactionManager" />
<property name="proxyTargetClass" value="true" />
<property name="transactionAttributes">
<props>
<prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
<prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
<prop key="load*">PROPAGATION_REQUIRED,readOnly</prop>
<prop key="save*">PROPAGATION_REQUIRED</prop>
<prop key="add*">PROPAGATION_REQUIRED</prop>
<prop key="update*">PROPAGATION_REQUIRED</prop>
<prop key="remove*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>

但是启动tomcat时报:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: net/sf/hibernate/HibernateException
Caused by:
java.lang.NoClassDefFoundError: net/sf/hibernate/HibernateException

这个问题应该如何解决啊?
spring.jar,hibernate3.jar这些文件我都已经添加到lib中了!我用的是myeclipse 6.01
...全文
6206 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
www1164399 2008-12-17
  • 打赏
  • 举报
回复
woaitiyu 2008-06-25
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 M_song 的回复:]
XML code <bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">



应该写hibernate3,而不是hibernate!
[/Quote]

谢谢,就是这样!这个问题我在网上查了好久也没有解决
woaitiyu 2008-06-25
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 M_song 的回复:]
net/sf/hibernate/HibernateException 这是hibernate2的路径..
看看你用的版本!
[/Quote]

我用的是hibernate3,版本不一样,写法也不一样吗?
M_song 2008-06-25
  • 打赏
  • 举报
回复
 <bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">


应该写hibernate3,而不是hibernate!
M_song 2008-06-25
  • 打赏
  • 举报
回复
net/sf/hibernate/HibernateException 这是hibernate2的路径..
看看你用的版本!

67,513

社区成员

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

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