below are clips from the Spring XML configuration files and the stack trace:
service XML file
Code:
<bean
id="installingSoftwareService" class="matrix.v.dataaccess.services.activity.InstallingSoftwareServiceImpl">
<!-- adding lazy-init="true" fixes the advice problem -->
<property name="installingSoftwareDAO" ref="installingSoftwareDAO"/>
</bean>
AOP XML file
Code:
<aop:config>
<aop:aspect ref="statusControllerAOP">
<aop:pointcut id="persist" expression="execution(matrix.v.dataaccess.pojo.activity.InstallingSoftware matrix.v.dataaccess.services.activity.InstallingSoftwareService.setInstallingSoftware(..))"/>
<aop:after-returning pointcut-ref="persist" method="afterCompleting" returning="installingSoftware" arg-names="installingSoftware"/>
</aop:aspect>
</aop:config>
<aop:config>
<aop:aspect ref="statusControllerAOP">
<aop:pointcut id="transitory" expression="execution(matrix.v.dataaccess.pojo.activity.InstallingSoftware matrix.v.dataaccess.services.activity.InstallingSoftwareService.setInstallingSoftware(..)) and args(installingSoftware)"/>
<aop:before pointcut-ref="transitory" method="beforePersisting" arg-names="installingSoftware"/>
<aop:before pointcut-ref="transitory" method="beforeCompleting" arg-names="installingSoftware"/>
</aop:aspect>
</aop:config>
<bean id="statusControllerAOP" class="matrix.v.dataaccess.aop.activity.StatusController">
<property name="activityPrecedenceService" ref="activityPrecedenceService"/>
<property name="installingSoftwareService" ref="installingSoftwareService"/>
<property name="hostedSoftwareService" ref="hostedSoftwareService"/>
<property name="softwarePackageService" ref="softwarePackageService"/>
<property name="environmentService" ref="environmentService"/>
</bean>
stack trace
Code:
org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'installingSoftwareService': Bean with name 'installingSoftwareService' has been injected into other beans [statusControllerAOP] in its raw version as part of a circular reference, but has eventually been wrapped (for example as part of auto-proxy creation). 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.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:435)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:254)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:144)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:251)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:163)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:284)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:91)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:75)
at matrix.v.dataaccess.utilities.SpringUtil.<init>(SpringUtil.java:13)
at matrix.v.dataaccess.utilities.SpringUtil.getInstance(SpringUtil.java:18)
at matrix.v.dataaccess.services.activity.InstallingSoftwareServiceTest.setUp(InstallingSoftwareServiceTest.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.junit.internal.runners.BeforeAndAfterRunner.invokeMethod(BeforeAndAfterRunner.java:74)
at org.junit.internal.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRunner.java:50)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:33)
at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71)
at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
hope this helps. just let me know if i need to supply more info (using spring 2.0.3, java 150_04 from Bea, hibernate 3.2, and testing on windows XP).