Hi Rob,
somehow the bean's don't load after setting the proxyTargetClass in the ProxyFactoryBean to true.
I get the following exception stack:
Code:
[junit] 1) testService(com.apgsga.vk.preisermittlung.service.BatchServiceInterfaceImplTests)org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'monitoredrabattDao' defined in class path resource [batchtestbeans.xml]: Initialization of bean failed; nested exception is org.aopalliance.aop.AspectException: null
[junit] java.lang.IllegalStateException: Callback Lnet/sf/cglib/proxy/MethodInterceptor; is not assignable to Lnet/sf/cglib/proxy/MethodInterceptor;
[junit] at net.sf.cglib.proxy.Enhancer.validate(Enhancer.java:374)
[junit] at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:399)
[junit] at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:318)
[junit] at org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.java:194)
[junit] at org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.java:150)
[junit] at org.springframework.aop.framework.ProxyFactoryBean.getSingletonInstance(ProxyFactoryBean.java:256)
[junit] at org.springframework.aop.framework.ProxyFactoryBean.setBeanFactory(ProxyFactoryBean.java:220)
[junit] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:349)
[junit] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:223)
[junit] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
[junit] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:271)
[junit] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:312)
[junit] at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:80)
[junit] at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:65)
[junit] at org.springframework.test.AbstractSpringContextTests.loadContextLocations(AbstractSpringContextTests.java:113)
[junit] at org.springframework.test.AbstractDependencyInjectionSpringContextTests.loadContextLocations(AbstractDependencyInjectionSpringContextTests.java:147)
[junit] at org.springframework.test.AbstractSpringContextTests.getContext(AbstractSpringContextTests.java:95)
[junit] at org.springframework.test.AbstractDependencyInjectionSpringContextTests.setUp(AbstractDependencyInjectionSpringContextTests.java:114)
Probably did something wrong?
Code:
<bean id="monitoredlokalDispoPositionenDao"
class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces">
<value>com.apgsga.vk.preisermittlung.db.LokalDispoDao</value>
</property>
<property name="target">
<ref local="lokalDispoPositionenDao"/>
</property>
<property name="proxyTargetClass">
<value>true</value>
</property>
<property name="interceptorNames">
<list>
<value>performanceMontitor</value>
</list>
</property>
</bean>