Announcement Announcement Module
Collapse
No announcement yet.
Application context creation fails when AOP around advice is added to spring context Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Application context creation fails when AOP around advice is added to spring context

    Hi

    I am stuck on a weird issue. I have added a new AOP point cut and an around advice in the spring xml file. After adding this, the application context creation fails saying that some of the bean creation failed. These beans are no where related to the my changes. But after adding my aop tags, looks like spring is trying to create these beans in a different way. If I comment out my aop.around advice, it works fine. Can anybody tell whats the root cause and possible ways to resolve it.

    My Spring configuration

    Code:
    <bean id="myAdvice" class="x.y.z.MyAdvice">
    	<property name="log" ref="myLog" />
    	<property name="myProperties">
    		<util:properties location="file:${myFileLocation}" />
    	</property>		
    </bean>
    	
    <aop:config>
    	<aop:aspect ref="myAdvice">
    		<aop:pointcut id="myExecution" expression="execution(* x.y.z.MyServiceImpl.add(..)) and args(arg1, arg2)"/>
             <aop:around pointcut-ref="myExecution" method="handleMyExecution"/>
    	</aop:aspect>
    </aop:config>
    Error

    Code:
    2012-07-17 13:52:25,493 ERROR context.ContextLoader - Context initialization failed
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'abcCRUDHandler' defined in class path resource [META-INF/abc/abc_base.xml]: Cannot resolve reference to bean 'abcQueryHandler' while setting bean property 'providers' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'abcQueryHandler': Post-processing of the FactoryBean's object failed; nested exception is org.aspectj.weaver.reflect.ReflectionWorld$ReflectionWorldException: warning can't determine superclass of missing type $Proxy274
     [Xlint:cantFindType]
            at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
    Spring version="3.0.0.RELEASE"
    Last edited by amannath; Jul 17th, 2012, 03:59 AM.

  • #2
    Check if the aspectj jars are there and the correct versions are there.

    Comment


    • #3
      I would also check that you have the correct -nodep version of CGLIB under your classpath...what happens if you provide an interface for the beans that are advised by your pointcut? Have you tried?

      Comment

      Working...
      X