No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here
我是用spring事务声明管理
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:aop="http://www.springframework.org/schema/aop"
     xmlns:tx="http://www.springframework.org/schema/tx"
     xmlns:context="http://www.springframework.org/schema/context"
     xsi:schemaLocation="
     http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
     http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
      http://www.springframework.org/schema/context
     http://www.springframework.org/schema/context/spring-context-2.5.xsd
     http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
  
  <context:component-scan base-package="com.yuxuan.crm"/>
 <context:annotation-config/>   
  <bean id="myDataSource" class="org.apache.commons.dbcp.BasicDataSource">
    <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
    <property name="url" value="jdbc:mysql://localhost:3306/crm"/>
    <property name="username" value="root"/>
    <property name="password" value="root"/>
  </bean>
 <bean id="mySessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    <property name="dataSource" ref="myDataSource"/>
    
        <property name="mappingResources">
      <list>
        <value>com/yuxuan/crm/domain/Department.hbm.xml</value>
        </list>
    </property>
    <property name="hibernateProperties">
      <value>
        hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
       hibernate.show_sql=true
       hibernate.hbm2ddl.auto=update
      </value>
    </property>
  </bean> 
  
   <!-- similarly, don't forget the PlatformTransactionManager -->
  <bean id="txManager2" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
  <property name="sessionFactory" ref="mySessionFactory"/>
  </bean> <tx:annotation-driven transaction-manager="txManager2"/> 
</beans>@Component
@Transactional
public class TestConfiguration {
private SessionFactory mySessionFactory;
public SessionFactory getMySessionFactory() {
return mySessionFactory;
}
@Resource(name="mySessionFactory") public void setMySessionFactory(SessionFactory mySessionFactory) {
this.mySessionFactory = mySessionFactory;
}
@Test
@Transactional
public void testTransactionManager(){
Department department = new Department();
department.setName("吼吼吼");
ApplicationContext applicationContext = new ClassPathXmlApplicationContext("beans.xml");
TestConfiguration tConfiguration =  (TestConfiguration) applicationContext.getBean("testConfiguration");
tConfiguration.getMySessionFactory().getCurrentSession().sav(department);}
}
麻烦帮我看看是什么问题啊?