applicationContext.xml file content

<? 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 "
xsi: schemaLhttp: / / www.springframework.org / schema / beans "> 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.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
">
<! --
<bean
>
<property name = "driverClassName"
value = "com.mysql.jdbc.Driver">
</ property>
<property name="url" value="jdbc:mysql://localhost:3306"> </ property>
<property name="username" value="root"> </ property>
<property name="password" value="123456"> </ property>
</ bean>
->
<bean
>
<property name = "jndiName"
value = "jdbc / MysqlPool">
</ property>
</ bean>

<bean
>
<property name="dataSource">
<ref bean="dataSuource" />
</ property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</ prop>
<prop key="hibernate.show_sql">
true
</ prop>
</ props>
</ property>
<property name="mappingResources">
<list>
<value> org / agilecc / sd / pojos / User.hbm.xml </ value>
</ list>
</ property>
</ bean>

<bean>
<property name="sessionFactory">
<ref bean="sessionFactory" />
</ property>
</ bean>

<bean
scope = "prototype">
<property name="userDao">
<ref bean="userDao" />
</ property>
</ bean>

<bean scope="prototype">
<property name="userService">
<ref bean="userService" />
</ property>
</ bean>
<bean scope="prototype">
<property name="userService">
<ref bean="userService" />
</ property>
</ bean>

<bean scope="prototype">
<property name="userService">
<ref bean="userService" />
</ property>
</ bean>
<bean scope="prototype">
<property name="userService">
<ref bean="userService" />
</ property>
</ bean>
<bean scope="prototype">
<property name="userService">
<ref bean="userService" />
</ property>
</ bean>

<bean>
<property name="sessionFactory">
<ref local="sessionFactory"/>
</ property>
</ bean>

<tx:advice transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="add*" propagation="REQUIRED"/>
<tx:method name="update*" propagation="REQUIRED"/>
<tx:method name="remover*" propagation="REQUIRED"/>
<tx:method name="*" read-only="true"/>
</ tx: attributes>
</ tx: advice>

<aop:config>
<aop:pointcut expression="execution (* org.agilecc.sd.service.*.*(..))"/>
<aop:advisor advice-ref="txAdvice" pointcut-ref="allManagerMethod"/>
</ aop: config>

</ beans>