您的位置:首页 > 编程语言 > Java开发

java开源框架集成常见错误之No Hibernate Session bound to thread

2009-08-10 22:22 549 查看
错误描述:
No Hibernate Session bound to thread, and configuration does not allow creation of

non-transactional one here

原因:
<bean id="transactionManager"

class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<tx:advice id="txadvice" transaction-manager="transactionManager" >
<tx:attributes>
<tx:method name="*" propagation="REQUIRED" />
</tx:attributes>
</tx:advice>
<aop:config>
<aop:pointcut id="cut" expression="execution(* com.sale.dao..*.*

(..))" />
<aop:advisor advice-ref="txadvice" pointcut-ref="cut" />
</aop:config>
中的expression com.sale.dao..*.*(..)多写了个“s”不能找到

解决方法:
正确配置com.sales.dao..*.*(..)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐