spring-mybatis整合异常2

 

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [spring.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: warning no match for this type name: com.imooc.hospital.service [Xlint:invalidAbsoluteTypeName]

检查发现service包出错,织入点设置为service的实现类包的全部方法

错误代码

<aop:config>

        <aop:pointcut id="txPointcut" expression="execution(* com.imooc.hospital.service.*(..))"/>

        <aop:advisor advice-ref="txAdvice" pointcut-ref="txPointcut"/>

</aop:config>

正确代码

<aop:config>

        <aop:pointcut id="txPointcut" expression="execution(* com.imooc.hospital.service.impl.*.*(..))"/>

        <aop:advisor advice-ref="txAdvice" pointcut-ref="txPointcut"/>

</aop:config>

猜你喜欢

转载自www.cnblogs.com/thyHome/p/9065420.html
今日推荐