植入出错?

植入出错?

<?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:context="http://www.springframework.org/schema/context"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context.xsd
    http://www.springframework.org/schema/aop
    http://www.springframework.org/schema/aop/spring-aop.xsd
    http://www.springframework.org/schema/tx
    http://www.springframework.org/schema/tx/spring-tx.xsd">


    <!--数据源-->
    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
        <property name="url" value="jdbc:mysql://localhost:3306/hospital?useUnicode=true&amp;characterEncoding=UTF-8"/>
        <property name="username" value="root"/>
        <property name="password" value="56872973"/>

    </bean>
    <!--session工厂-->
    <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
        <property name="dataSource" ref="dataSource"/>
        <property name="typeAliasesPackage" value="com.imooc.hospital.entity"/>
    </bean>
    <!--持久化对象-->
    <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
        <property name="basePackage" value="com.imooc.hospital.dao"/>
        <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
    </bean>

    <!--声明式事务-->
    <!--事务管理器-->
    <bean id="transcationManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="dataSource"/>
    </bean>
    <!--通知-->
    <tx:advice id="txAdvice" transaction-manager="transcationManager">
        <tx:attributes>
            <tx:method name="get*" read-only="true"/>
            <tx:method name="find*" read-only="true"/>
            <tx:method name="search*" read-only="true"/>
            <tx:method name="*" propagation="REQUIRED"/>
        </tx:attributes>
    </tx:advice>
    <!--植入-->
    <aop:config>
        <aop:pointcut id="txPiontcut" expression="execution(* com.imooc.hospital.service.*.*(..))"/>
        <aop:advisor advice-ref="txAdvice" pointcut-ref="txPiontcut"/>
    </aop:config>

    <!--全局扫描-->
    <context:component-scan base-package="com.imooc.hospital"/>
    <aop:aspectj-autoproxy/>
</beans>

http://img1.sycdn.imooc.com//climg/5e9ac0770902b9c912030432.jpg

Bean must be of 'org.aopalliance.aop.Advcie'type?

正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

2回答
好帮手慕小班 2020-04-19 11:11:44

同学你好,老师也无法具体定位同学的问题,同学可以把自己的jar包的具体内容贴出,老师来查看一下,比如:

http://img1.sycdn.imooc.com//climg/5e9bc16a0929a05405320449.jpg

如果我的回答解决了你的疑惑,请采纳,祝学习愉快~

好帮手慕阿满 2020-04-18 18:02:50

同学你好,这个错误可能是jar包冲突造成的,建议同学可以和sm项目中引入的依赖对照一下。

祝:学习愉快~

  • 提问者 masami酱 #1
    对比SM项目jar包都一样,那冲突在哪儿,又是如何解决jar包冲突问题?
    2020-04-18 19:14:43
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师