在service方法上加入了
@Transactional(readOnly = false, propagation = Propagation.REQUIRED,rollbackFor=Exception.class)
使得方法加载不到了。。不知道是少哪里原因,以下spring配置文件
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-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/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
<context:annotation-config /><bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="${jdbc.driverClassName}"></property>
<property name="url" value="${jdbc.url}"></property>
<property name="username" value="${jdbc.username}"></property>
<property name="password" value="${jdbc.password}"></property>
<property name="maxActive">
<value>100</value>
</property>
<property name="maxWait">
<value>1000</value>
</property>
<property name="maxIdle">
<value>30</value>
</property>
<property name="defaultAutoCommit">
<value>true</value>
</property>
<property name="removeAbandoned">
<value>true</value>
</property>
<property name="removeAbandonedTimeout">
<value>60</value>
</property>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.Oracle9Dialect
</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.format_sql">true</prop>
</props>
</property>
</bean>
<!-- 事务管理对象-->
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref local="sessionFactory"/>
</property>
</bean>
<tx:annotation-driven transaction-manager="transactionManager" />
<bean id="TCashaccountDAO"
class="com.skyTeam.junjunxia.user.dao.TCashaccountDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean></beans>另外工程中引入的spring包有
spring.jar
spring-beans.jar
spring-context.jar
spring-core.jar
spring-aop.jar
spring-context-support.jar
spring-web.jar
spring-tx.jar
spring-jms.jar
spring-orm.jar
spring-webmvc.jar
spring-webmvc-portlet.jar
spring-webmvc-struts.jar
@Transactional(readOnly = false, propagation = Propagation.REQUIRED,rollbackFor=Exception.class)
使得方法加载不到了。。不知道是少哪里原因,以下spring配置文件
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-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/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
<context:annotation-config /><bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="${jdbc.driverClassName}"></property>
<property name="url" value="${jdbc.url}"></property>
<property name="username" value="${jdbc.username}"></property>
<property name="password" value="${jdbc.password}"></property>
<property name="maxActive">
<value>100</value>
</property>
<property name="maxWait">
<value>1000</value>
</property>
<property name="maxIdle">
<value>30</value>
</property>
<property name="defaultAutoCommit">
<value>true</value>
</property>
<property name="removeAbandoned">
<value>true</value>
</property>
<property name="removeAbandonedTimeout">
<value>60</value>
</property>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.Oracle9Dialect
</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.format_sql">true</prop>
</props>
</property>
</bean>
<!-- 事务管理对象-->
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref local="sessionFactory"/>
</property>
</bean>
<tx:annotation-driven transaction-manager="transactionManager" />
<bean id="TCashaccountDAO"
class="com.skyTeam.junjunxia.user.dao.TCashaccountDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean></beans>另外工程中引入的spring包有
spring.jar
spring-beans.jar
spring-context.jar
spring-core.jar
spring-aop.jar
spring-context-support.jar
spring-web.jar
spring-tx.jar
spring-jms.jar
spring-orm.jar
spring-webmvc.jar
spring-webmvc-portlet.jar
spring-webmvc-struts.jar
<aop:aspectj-autoproxy proxy-target-class="true"/>
配置文件加这个试试
在<context:annotation-config />
下面加上
<context:component-scan base-package="com.skyTeam" />