spring aop配置出错 帮忙检查

<?xmlversion="1.0"encoding="UTF-8"?><beansxmlns="http://www.springframework.org/schem... <?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:schemaLocation="http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
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/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd"
default-autowire="byName"
default-lazy-init="false">

<!--读取驱动信息参数文件 -->
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:config/jdbc.properties</value>
</list>
</property>
</bean>
<!-- C3P0 数据源 -->
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<property name="driverClass" value="${jdbc.driverClassName}" />
<property name="jdbcUrl" value="${jdbc.url}" />
<property name="user" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
</bean>
<!-- - - - - - - spring Transaction Manager - - - - - - - -->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>

<!-- - - - - - - spring Transaction Attribute - - - - - - - -->
<tx:advice id="transactionAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="* sen.*.*(..)"/>
</tx:attributes>
</tx:advice>
<!--****** weave *********-->
<aop:config>
<aop:pointcut id="serviceOperation" expression="execution(* *.*(..))" />
<aop:advisor advice-ref="transactionAdvice" pointcut-ref="serviceOperation" />
</aop:config>
<bean id="sqlSessionFactory" class="org.springframework.orm.ibatis3.SqlSessionFactoryBean">
<property name="configLocation" value="classpath:config/ibatisConfig.xml"/>
<property name="dataSource" ref="dataSource" />
</bean>

<bean id="sqlSessionTemplate" class="org.springframework.orm.ibatis3.SqlSessionTemplate">
<property name="sqlSessionFactory" ref="sqlSessionFactory"/>
</bean>
<bean id="sqlSessionDaoSupport" class="org.springframework.orm.ibatis3.support.SqlSessionDaoSupport" abstract="true"/>
tomcat 启动不起来 [ERROR] 2010-01-18 15:52:40 :Context initialization failed
org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'dataSource': Bean with name 'dataSource' has been injected into other beans [transactionManager] in its raw version as part of a circular reference, but has eventually been wrapped. This means that said other beans do not use the final version of the bean. This is often the result of over-eager type matching - consider using 'getBeanNamesOfType' with the 'allowEagerInit' flag turned off, for example.
展开
 我来答
yxc0433
2010-01-18 · TA获得超过158个赞
知道答主
回答量:77
采纳率:0%
帮助的人:70.3万
展开全部
你的dataSource在一个地方重复注入了
看你的这个地方,你的切面定义在全局。所以这个地方有问题,把下面这段先注释掉,或者把切面精确去找问题。(和上面注入冲突了)
<aop:config>
<aop:pointcut id="serviceOperation" expression="execution(* *.*(..))" />
<aop:advisor advice-ref="transactionAdvice" pointcut-ref="serviceOperation" />
</aop:config>
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式