3 Replies Latest reply on Sep 27, 2012 2:08 AM by davsclaus

    Warning can't determine annotations of missing type $Proxy89

    lekkie_lomotayo

      I am trying to write create an aspect in my camel application with the following snippets:

       

      <ctx:component-scan base-package="com.interswitchng.techquest.paydirect.payment.notification.service.soap" />

            

           <ctx:annotation-config />

                 

           <aop:aspectj-autoproxy/>

       

           <aop:config>

                <aop:aspect ref="systemAspectAdviceApi">

                     <aop:pointcut id="transactionProcessorPointCut" expression="execution(@com.system.service.util.annotations.MonitorRequest * *(..))"/>

                     <aop:before pointcut-ref="transactionProcessorPointCut" method="publishTransactionCount"/>

                     <aop:pointcut id="transactionExceptionPointCut" expression="@within(com.system.service.util.annotations.MonitorTransactionException)"/>               

                     <aop:after-throwing pointcut-ref="transactionExceptionPointCut" method="publishExceptionCount"/>

                     <aop:around pointcut-ref="transactionProcessorPointCut" method="publishTransactionLatency"/>

                </aop:aspect>

           </aop:config>

       

      but I get the following excpetion:

       

      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'osgiDestinationRegistry': Post-processing of the FactoryBean's object failed; nested exception is org.aspectj.weaver.reflect.ReflectionWorld$ReflectionWorldException: warning can't determine annotations of missing type $Proxy100

      Xlint:cantFindType

           at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:165)[68:org.springframework.beans:3.0.5.RELEASE]

           at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:102)[68:org.springframework.beans:3.0.5.RELEASE]

           at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1429)[68:org.springframework.beans:3.0.5.RELEASE]

           at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:245)[68:org.springframework.beans:3.0.5.RELEASE]

           at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)[68:org.springframework.beans:3.0.5.RELEASE]

           at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:576)[68:org.springframework.beans:3.0.5.RELEASE]

           at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)[70:org.springframework.context:3.0.5.RELEASE]

           at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)[82:org.springframework.osgi.core:1.2.1]

           at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)[82:org.springframework.osgi.core:1.2.1]

           at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)[82:org.springframework.osgi.core:1.2.1]

           at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)[82:org.springframework.osgi.core:1.2.1]

           at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)[85:org.springframework.osgi.extender:1.2.1]

           at java.lang.Thread.run(Thread.java:662)[:1.6.0_31]

      Caused by: org.aspectj.weaver.reflect.ReflectionWorld$ReflectionWorldException: warning can't determine annotations of missing type $Proxy100

      Xlint:cantFindType

           at org.aspectj.weaver.reflect.ReflectionWorld$ExceptionBasedMessageHandler.handleMessage(ReflectionWorld.java:129)[395:aspectjtools165:1.6.5]

           at org.aspectj.weaver.Lint$Kind.signal(Lint.java:305)[395:aspectjtools165:1.6.5]

           at org.aspectj.weaver.MissingResolvedTypeWithKnownSignature.raiseCantFindType(MissingResolvedTypeWithKnownSignature.java:198)[395:aspectjtools165:1.6.5]

           at org.aspectj.weaver.MissingResolvedTypeWithKnownSignature.hasAnnotation(MissingResolvedTypeWithKnownSignature.java:152)[395:aspectjtools165:1.6.5]

           at org.aspectj.weaver.patterns.ExactAnnotationTypePattern.fastMatches(ExactAnnotationTypePattern.java:84)[395:aspectjtools165:1.6.5]

           at org.aspectj.weaver.patterns.WithinAnnotationPointcut.fastMatch(WithinAnnotationPointcut.java:80)[395:aspectjtools165:1.6.5]

           at org.aspectj.weaver.internal.tools.PointcutExpressionImpl.couldMatchJoinPointsInType(PointcutExpressionImpl.java:78)[395:aspectjtools165:1.6.5]

           at org.springframework.aop.aspectj.AspectJExpressionPointcut.matches(AspectJExpressionPointcut.java:238)[74:org.springframework.aop:3.0.5.RELEASE]

           at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:200)[74:org.springframework.aop:3.0.5.RELEASE]

           at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:254)[74:org.springframework.aop:3.0.5.RELEASE]

           at org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:286)[74:org.springframework.aop:3.0.5.RELEASE]

           at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findAdvisorsThatCanApply(AbstractAdvisorAutoProxyCreator.java:117)[74:org.springframework.aop:3.0.5.RELEASE]

           at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:87)[74:org.springframework.aop:3.0.5.RELEASE]

           at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:68)[74:org.springframework.aop:3.0.5.RELEASE]

           at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:359)[74:org.springframework.aop:3.0.5.RELEASE]

           at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:322)[74:org.springframework.aop:3.0.5.RELEASE]

           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:407)[68:org.springframework.beans:3.0.5.RELEASE]

           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.postProcessObjectFromFactoryBean(AbstractAutowireCapableBeanFactory.java:1561)[68:org.springframework.beans:3.0.5.RELEASE]

           at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:162)[68:org.springframework.beans:3.0.5.RELEASE]

           ... 12 more

        • 1. Re: Warning can't determine annotations of missing type $Proxy89
          davsclaus

          Do you use any osgi services (eg a bean referenced from the osgi service registry). As they would return a proxy for the bean.

           

          And since the spring framework fails with a proxy. It may indicate that.

          • 2. Re: Warning can't determine annotations of missing type $Proxy89
            lekkie_lomotayo

            Yes I did. I imported OSGi services from the registry.

             

            My AOP advice was imported as an OSGi service from the registry.

             

            <osgi:reference id="systemAspectAdviceApi" interface="com.system.service.util.api.SystemAspectAdviceApi"/>

             

            <aop:config>

                      <aop:aspect ref="systemAspectAdviceApi">

                           <aop:pointcut id="transactionProcessorPointCut" expression="execution(@com.system.service.util.annotations.MonitorRequest * *(..))"/>

                           <aop:before pointcut-ref="transactionProcessorPointCut" method="publishTransactionCount"/>

                           <aop:pointcut id="transactionExceptionPointCut" expression="@within(com.system.service.util.annotations.MonitorTransactionException)"/>               

                           <aop:after-throwing pointcut-ref="transactionExceptionPointCut" method="publishExceptionCount"/>

                           <aop:around pointcut-ref="transactionProcessorPointCut" method="publishTransactionLatency"/>

                      </aop:aspect>

                 </aop:config>

             

            Are there any work around this?

            • 3. Re: Warning can't determine annotations of missing type $Proxy89
              davsclaus

              I am not sure about a workaround. There may be a newer release of the projects that has a fix (eg spring / spring-aop etc.)

               

              And I would try googling about this issue osgi / aop as it would be a common issue.