2 Replies Latest reply on May 11, 2007 4:13 PM by alesj

    AnnotationBeanConfigurerAspect issue

    wspiteri

      I have two EAR's deployed into my JBOSS server, each containing a single Stateless Session Bean. The SLSB in EAR 2 calls the other SLSB in EAR1 via use of Springs LocalStatelessSessionProxyBean.

      The AnnotationBeanFactoryConfigurerAspect as defined in the Spring manual is a Singleton, and the manual states the you should use a separate Classloader per spring-aspects.jar. In both of my EAR's I therefore have spring-aspects.jar in the lib folder, and I DO NOT have one in the server lib folder.

      The issue I am now facing is that when SLSB 2 calls SLSB 1, the AnnotationBeanFactoryConfigurerAspect loses all knowledge of the beans defined in application 2. Therefore for all the aop:spring-configured beans in application 2, I get a NoSuchBeanDefinitionException.

      I am certain when EJB B invokes EJB A which inturn invokes its onEJBCreate method the bean definitions get refreshed due to a new set of applicationContexts being loaded. Once the call returns from that invocation, the AnnotationBeanFactoryConfigurerAspect no longer understands my application B's beans and therefore the exception occurs.

      The other strange point to note is if I manually create EJB A first via a separate call, then invoke EJB B the AnnotationBeanFactoryConfigurerAspect is OK for application B.

      Any help would be greatly appreciated.

        • 1. Re: AnnotationBeanConfigurerAspect issue
          wspiteri

          My previous post had a slight mistake. The name of the class is AnnotationBeanConfigurerAspect.

          Also The relevant section in the spring manual i was referring to was (6.8.1.2. Working with multiple application contexts), if this may help anybody make sense of my issue.

          • 2. Re: AnnotationBeanConfigurerAspect issue
            alesj

            Not what JBoss + Spring integration is about - see Sticky at the top of the start forum page.
            More of a Spring forum type question.
            I will eventually move your question out of this forum.