当我在我的配置文件中加上如下配置会包下面的错误,我不加时就不会出错这是为什么
<aop:config>
<aop:pointcut id="interceptorPointCuts" expression="execution(* cn.qtt.service.*.*(..)) " />
<aop:pointcut id="interceptorPointCutsNew" expression="execution(* cn.qtt.advert.service.*.*(..)) " />
<aop:advisor advice-ref="txAdvice" pointcut-ref="interceptorPointCuts" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="interceptorPointCutsNew" />
</aop:config>
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'AdvertServiceTest': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private cn.qtt.service.impl.UserServiceImpl AdvertServiceTest.userService; nested exception is java.lang.IllegalArgumentException: Can not set cn.qtt.service.impl.UserServiceImpl field AdvertServiceTest.userService to com.sun.proxy.$Proxy17
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:287) ~[spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1106) ~[spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBeanProperties(AbstractAutowireCapableBeanFactory.java:374) ~[spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:110) ~[org.springframework.test-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75) ~[org.springframework.test-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:321) ~[org.springframework.test-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:211) [org.springframework.test-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:288) [org.springframework.test-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) [junit.jar:na]
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:290) [org.springframework.test-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231) [org.springframework.test-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) [junit.jar:na]
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) [junit.jar:na]
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) [junit.jar:na]
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) [junit.jar:na]
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) [junit.jar:na]
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) [junit.jar:na]
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) [org.springframework.test-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71) [org.springframework.test-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.junit.runners.ParentRunner.run(ParentRunner.java:236) [junit.jar:na]
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174) [org.springframework.test-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49) [.cp/:na]
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) [.cp/:na]
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) [.cp/:na]
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) [.cp/:na]
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) [.cp/:na]
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) [.cp/:na]
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private cn.qtt.service.impl.UserServiceImpl AdvertServiceTest.userService; nested exception is java.lang.IllegalArgumentException: Can not set cn.qtt.service.impl.UserServiceImpl field AdvertServiceTest.userService to com.sun.proxy.$Proxy17
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:506) ~[spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) ~[spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:284) ~[spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]
... 26 common frames omitted
Caused by: java.lang.IllegalArgumentException: Can not set cn.qtt.service.impl.UserServiceImpl field AdvertServiceTest.userService to com.sun.proxy.$Proxy17
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) ~[na:1.7.0_51]
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) ~[na:1.7.0_51]
at sun.reflect.UnsafeObjectFieldAccessorImpl.set(Unknown Source) ~[na:1.7.0_51]
at java.lang.reflect.Field.set(Unknown Source) ~[na:1.7.0_51]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:502) ~[spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]
... 28 common frames omitted