1 2 Previous Next 19 Replies Latest reply on Jul 31, 2009 4:04 AM by dimonv

    Service POJO JNDI Binding Problem

      Hi there,

      I am using POJO Services to initialize different parts of an application that is deployed in JBoss AS 5. I got the Service POJOs as such working just fine, but now I have a problem making some of them accessible to "unmanaged" code that is deployed in the same AS instance.
      From what I could find online the only way to do that is to add a JNDI binding aspect to the service POJO.

      My first question would be, is that really the way to do it? Or is there a better way for local client code to obtain a reference to the service?

      I used the SimpleBean AOP example from the microcontainer documentation as a template but when I deploy this in AS I get an error during server startup complaining that there is already an AspectManager bean installed:

      org.jboss.deployers.spi.DeploymentException: Error deploying: AspectManager
       at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
       at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:125)
       at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:51)
       at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
       at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
       at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
       at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
       at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:304)
       at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:205)
       at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405)
       at org.jboss.Main.boot(Main.java:209)
       at org.jboss.Main$1.run(Main.java:547)
       at java.lang.Thread.run(Unknown Source)
      Caused by: java.lang.IllegalStateException: AspectManager is already installed.
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:716)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
       at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:121)
       ... 24 more
      



      I removed the following section from the deployment descriptor:

      <bean name="AspectManager" class="org.jboss.aop.AspectManager">
       <constructor factoryClass="org.jboss.aop.AspectManager"
       factoryMethod="instance" />
      </bean>
      



      But that yields a different error on server startup:

      java.lang.RuntimeException: Error configuring property: manager for JndiAspect
       at org.jboss.kernel.plugins.dependency.ConfigureAction.dispatchSetProperty(ConfigureAction.java:112)
       at org.jboss.kernel.plugins.dependency.ConfigureAction.setAttributes(ConfigureAction.java:85)
       at org.jboss.kernel.plugins.dependency.ConfigureAction.installActionInternal(ConfigureAction.java:44)
       at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
       at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
       at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
      ...
      Caused by: java.lang.IllegalArgumentException: Wrong arguments. setManager for target org.jboss.aop.microcontainer.beans.Aspect@db09a3 expected=[org.jboss.aop.AspectManager] actual=[org.jboss.aop.deployers.AspectManagerJDK5]
       at org.jboss.reflect.plugins.introspection.ReflectionUtils.handleErrors(ReflectionUtils.java:395)
       at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:69)
       at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
       at org.jboss.beans.info.plugins.DefaultPropertyInfo.set(DefaultPropertyInfo.java:143)
       at org.jboss.beans.info.plugins.BeanInfoUtil.set(BeanInfoUtil.java:177)
      11:22:14,044 ERROR [AbstractKernelController] Error installing to Configured: name=JndiIntroduction state=Instantiated
      java.lang.RuntimeException: Error configuring property: manager for JndiIntroduction
       at org.jboss.kernel.plugins.dependency.ConfigureAction.dispatchSetProperty(ConfigureAction.java:112)
       at org.jboss.kernel.plugins.dependency.ConfigureAction.setAttributes(ConfigureAction.java:85)
       at org.jboss.kernel.plugins.dependency.ConfigureAction.installActionInternal(ConfigureAction.java:44)
       at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
       at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
      ...
      Caused by: java.lang.IllegalArgumentException: Wrong arguments. setManager for target org.jboss.aop.microcontainer.beans.IntroductionBinding@13730e0 expected=[org.jboss.aop.AspectManager] actual=[org.jboss.aop.deployers.AspectManagerJDK5]
       at org.jboss.reflect.plugins.introspection.ReflectionUtils.handleErrors(ReflectionUtils.java:395)
       at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:69)
       at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
       at org.jboss.beans.info.plugins.DefaultPropertyInfo.set(DefaultPropertyInfo.java:143)
       at org.jboss.beans.info.plugins.BeanInfoUtil.set(BeanInfoUtil.java:177)
      ...
      


      I read that org.jboss.aop.deployers.AspectManagerJDK5 is what has to be used with AS 5.

      Any help on how to do service lookup differently or how to solve the above problem is greatly appreciated!


      Thanks
      Ralf

        • 1. Re: Service POJO JNDI Binding Problem
          alesj

           

          "ralfsteppacher" wrote:

          Any help on how to do service lookup differently

          Read my reply here - the first part:
          - http://www.jboss.com/index.html?module=bb&op=viewtopic&t=148288

          Or add more details of what you're trying to do.

          "ralfsteppacher" wrote:

          how to solve the above problem is greatly appreciated!

          I guess you need this -- see AspectManager bean.
           <!--
           Valid values for the AspectManager bean for use with enableTransformer=true are:
           * org.jboss.aop.deployers.AspectManagerJDK5 - works with the -javaagent:pluggable-instrumentor.jar switch
           * org.jboss.aop.deployers.AspectManagerJRockit - works with JRockit and the -Xmanagement:class=org.jboss.aop.hook.JRockitPluggableClassPreProcessor switch
           -->
           <bean name="AspectManagerJDK5" class="org.jboss.aop.deployers.AspectManagerJDK5">
           <constructor>
           <parameter><![CDATA[
           <aop>
           <aspect name="mainDeployer" class="org.jboss.profileservice.aop.MainDeployerAspect"/>
           <bind pointcut="execution(* $instanceof{org.jboss.deployers.spi.deployment.MainDeployer}->process(..))">
           <advice name="process" aspect="mainDeployer"/>
           </bind>
           <aspect name="persist" class="org.jboss.profileservice.aop.PersistAspect"/>
           <bind pointcut="execution(* $instanceof{org.jboss.managed.api.ManagedProperty}->setValue(..))">
           <advice name="setValue" aspect="persist"/>
           </bind>
           </aop>]]>
           </parameter>
           </constructor>
          
           <property name="jbossIntegration"><inject bean="AOPJBossIntegration"/></property>
          
           <property name="enableLoadtimeWeaving">false</property>
           <!-- only relevant when EnableLoadtimeWeaving is true.
           When transformer is on, every loaded class gets
           transformed. If AOP can't find the class, then it
           throws an exception. Sometimes, classes may not have
           all the classes they reference. So, the Suppressing
           is needed. (i.e. Jboss cache in the default configuration -->
           <property name="suppressTransformationErrors">true</property>
           <property name="prune">true</property>
           <property name="include">org.jboss.test., org.jboss.injbossaop.</property>
           <property name="exclude">org.jboss.</property>
           <!-- This avoids instrumentation of hibernate cglib enhanced proxies
           <property name="ignore">*$$EnhancerByCGLIB$$*</property> -->
           <property name="optimized">true</property>
           <property name="verbose">false</property>
           <!--
           Available choices for this attribute are:
           org.jboss.aop.instrument.ClassicInstrumentor (default)
           org.jboss.aop.instrument.GeneratedAdvisorInstrumentor
           <property name="instrumentor">org.jboss.aop.instrument.ClassicInstrumentor</property>
           -->
           </bean>
          
           <!-- Simplify name usage -->
           <bean name="AspectManager">
           <constructor factoryMethod="getAspectManager"><factory bean="AspectManagerJDK5"/></constructor>
           </bean>
          


          • 2. Re: Service POJO JNDI Binding Problem
            alesj

             

            "alesj" wrote:
            "ralfsteppacher" wrote:

            Any help on how to do service lookup differently

            Read my reply here - the first part:
            - http://www.jboss.com/index.html?module=bb&op=viewtopic&t=148288

            Or add more details of what you're trying to do.

            You could also add them as mbeans - @JMX usage.
            And then accessing them via all bunch of existing invokers.

            • 3. Re: Service POJO JNDI Binding Problem

              First of all, thanks for the quick response.

              "alesj" wrote:

              Read my reply here - the first part:
              - http://www.jboss.com/index.html?module=bb&op=viewtopic&t=148288

              Or add more details of what you're trying to do.


              Can you be a bit more specific where in the source tree of webbeans-ri-int I need to look?

              More information about what I try to do:
              I have created several service POJOs that basically replace static initializers, setting implementations, strategies, etc. One of the services also manages the Hibernate configuration for me, such that modules that are deployed can add properties and mapped entities at runtime and subsequent requests for sessions are aware of those.
              At runtime I want to make the Hibernate configuration available to application code that is not a service, i.e. the deployed application. For that I need a way to get a handle on the service, to call a business method like getHibernateConfig() on the service.

              I was quite surprised that apparently there is no simple and straightforward way for local client code to call a method on a serivice, which indicates to me that I might not have understood the pojo service concept.


              "alesj" wrote:

              I guess you need this -- see AspectManager bean.


              I replaced the section in <JBOSS_HOME>/server/default/conf/aop.xml which was exactly the same as what you sent but for the bean name and the "name simplification". This makes JBoss AS fail to start. If I put the XML into the right place, I can post the (rather long) stack traces.

              Could you be more specific about what I should look at in AspectManager?


              Thanks
              Ralf

              • 4. Re: Service POJO JNDI Binding Problem

                 

                "alesj" wrote:

                You could also add them as mbeans - @JMX usage.
                And then accessing them via all bunch of existing invokers.


                I thought the direction is to go all POJO?


                Ralf

                • 5. Re: Service POJO JNDI Binding Problem
                  alesj

                   

                  "ralfsteppacher" wrote:
                  I thought the direction is to go all POJO?

                  Yup, at some point. :-)
                  But for the moment it's still there.

                  But yeah, let's try to find a better way to get a hold of your services.

                  • 6. Re: Service POJO JNDI Binding Problem
                    alesj

                     

                    "ralfsteppacher" wrote:

                    Can you be a bit more specific where in the source tree of webbeans-ri-int I need to look?

                    The jbossas integration part.
                    There is a package with the 'vdf' name, check it's contents.

                    "ralfsteppacher" wrote:

                    I was quite surprised that apparently there is no simple and straightforward way for local client code to call a method on a service, which indicates to me that I might not have understood the pojo service concept.

                    Why? That's two different layers.
                    It's up to the integration layers to provide some nice hooks.

                    e.g. for web (ServletContext) see my 'vdf' package
                    e.g. afaik EJB3 has some hooks into MC, as its internal architecture is MC based

                    But that's pretty much the same question as how do other non-MC-managed services get a hold of TransactionManager.
                    --> sort of spec based jndi namespace

                    "ralfsteppacher" wrote:

                    Could you be more specific about what I should look at in AspectManager?

                    What exactly fails - just the root cause?

                    This was just an example of how you get the real AspectManager out of JDK5 based wrapper.
                    It might be just a name conflict or something trivial.

                    • 7. Re: Service POJO JNDI Binding Problem

                       

                      "alesj" wrote:

                      What exactly fails - just the root cause?


                      With the modified aop.xml I get several exceptions on server start-up :

                      java.lang.RuntimeException: Error configuring property: manager for JMXRegistrationAdvice$AspectBinding
                       at org.jboss.kernel.plugins.dependency.ConfigureAction.dispatchSetProperty(ConfigureAction.java:112)
                       at org.jboss.kernel.plugins.dependency.ConfigureAction.setAttributes(ConfigureAction.java:85)
                      ...
                      Caused by: java.lang.IllegalArgumentException: No such property aspectManager for bean org.jboss.aop.AspectManager available [typedefs, annotationIntroductions, call, classMetaDataLoaders, set, bindings, interceptorStacks, sortedPrecedenceDefEntries, annotationOverrides, precedenceDefs, execution, interfaceIntroductions, dynamicCFlows, interceptorFactories, perVMAspects, pointcutInfos, construction, managerFQN, advisors, includedInvisibleAnnotations, ignore, declares, get, withincode, ignoreExpressions, subscribedSubDomains, classMetaData, class, arrayReplacements, exclude, aspectDefinitions, include, dynamicAOPStrategy, lifecycleBindings, pointcuts, cflowStacks, bindingCollection, within]
                       at org.jboss.beans.info.plugins.AbstractBeanInfo.getProperty(AbstractBeanInfo.java:147)
                       at org.jboss.beans.info.plugins.BeanInfoUtil.getNestedTarget(BeanInfoUtil.java:77)
                      ...
                      


                      The summary before the Vm shut down again is

                      AOPDeploymentAopMetaDataDeployer -> java.lang.RuntimeException: Error configuring property: aspectManager for AOPDeploymentAopMetaDataDeployer
                      AspectManagerJMXRegistrar -> java.lang.RuntimeException: Error configuring property: aspectManager for AspectManagerJMXRegistrar
                      JMXStartStopAdvice$AspectBinding -> java.lang.RuntimeException: Error configuring property: manager for JMXStartStopAdvice$AspectBinding
                      JMXCreateDestroyAdvice$AspectBinding -> java.lang.RuntimeException: Error configuring property: manager for JMXCreateDestroyAdvice$AspectBinding
                      JMXRegistrationAdvice$AspectBinding -> java.lang.RuntimeException: Error configuring property: manager for JMXRegistrationAdvice$AspectBinding
                      AOPClassLoaderDeployer -> java.lang.RuntimeException: Error configuring property: aspectManager for AOPClassLoaderDeployer
                      BeansDeploymentAopMetaDataDeployer -> java.lang.RuntimeException: Error configuring property: aspectManager for BeansDeploymentAopMetaDataDeployer
                      



                      Ralf


                      • 8. Re: Service POJO JNDI Binding Problem
                        alesj

                         

                        "ralfsteppacher" wrote:

                        With the modified aop.xml I get several exceptions on server start-up :

                        java.lang.RuntimeException: Error configuring property: manager for JMXRegistrationAdvice$AspectBinding
                         at org.jboss.kernel.plugins.dependency.ConfigureAction.dispatchSetProperty(ConfigureAction.java:112)
                         at org.jboss.kernel.plugins.dependency.ConfigureAction.setAttributes(ConfigureAction.java:85)
                        ...
                        Caused by: java.lang.IllegalArgumentException: No such property aspectManager for bean org.jboss.aop.AspectManager available [typedefs, annotationIntroductions, call, classMetaDataLoaders, set, bindings, interceptorStacks, sortedPrecedenceDefEntries, annotationOverrides, precedenceDefs, execution, interfaceIntroductions, dynamicCFlows, interceptorFactories, perVMAspects, pointcutInfos, construction, managerFQN, advisors, includedInvisibleAnnotations, ignore, declares, get, withincode, ignoreExpressions, subscribedSubDomains, classMetaData, class, arrayReplacements, exclude, aspectDefinitions, include, dynamicAOPStrategy, lifecycleBindings, pointcuts, cflowStacks, bindingCollection, within]
                         at org.jboss.beans.info.plugins.AbstractBeanInfo.getProperty(AbstractBeanInfo.java:147)
                         at org.jboss.beans.info.plugins.BeanInfoUtil.getNestedTarget(BeanInfoUtil.java:77)
                        ...
                        


                        This means that the bean you have here
                        is already org.jboss.aop.AspectManager instance.

                        Post the JNDIBinding/Interceptor code.

                        • 9. Re: Service POJO JNDI Binding Problem

                           

                          "alesj" wrote:

                          Post the JNDIBinding/Interceptor code.


                          This is my jboss-beans.xml:

                           <!-- Commented out because it led to the initial error where JBoss AS complained
                           that a bean with the name AspectManager was already deployed. -->
                           <!--bean name="AspectManager" class="org.jboss.aop.AspectManager">
                           <constructor factoryClass="org.jboss.aop.AspectManager"
                           factoryMethod="instance" />
                           </bean-->
                          
                           <!-- Define the jndi binding advice -->
                           <beanfactory name="JndiAdvice"
                           class="org.jboss.aop.microcontainer.aspects.jndi.JndiIntroduction">
                           <property name="env">
                           <map class="java.util.Properties" keyClass="java.lang.String"
                           valueClass="java.lang.String">
                           <entry>
                           <key>java.naming.factory.initial</key>
                           <value>
                           org.jboss.example.microcontainer.aspects.EnvInitialContextFactory
                           </value>
                           </entry>
                           </map>
                           </property>
                           </beanfactory>
                          
                           <bean name="JndiAspect" class="org.jboss.aop.microcontainer.beans.Aspect">
                           <property name="advice">
                           <inject bean="JndiAdvice" />
                           </property>
                           <property name="manager">
                           <inject bean="AspectManager" />
                           </property>
                           </bean>
                          
                           <!--
                           Introduce the KernelControllerContextAware interface to the
                           JndiBinding annotation
                           -->
                           <bean name="JndiIntroduction"
                           class="org.jboss.aop.microcontainer.beans.IntroductionBinding">
                           <property name="classes">
                           @org.jboss.aop.microcontainer.aspects.jndi.JndiBinding</property>
                           <property name="interfaces">
                           <list elementClass="java.lang.String">
                           <value>org.jboss.kernel.spi.dependency.KernelControllerContextAware
                           </value>
                           </list>
                           </property>
                           <property name="manager">
                           <inject bean="AspectManager" />
                           </property>
                           </bean>
                          
                           <!--
                           Apply the jndi binding to all KernelControllerContextAware interface
                           callbacks
                           -->
                           <bean name="JndiBinding" class="org.jboss.aop.microcontainer.beans.AspectBinding">
                           <property name="pointcut">execution(*
                           $instanceof{org.jboss.kernel.spi.dependency.KernelControllerContextAware}->$implements{org.jboss.kernel.spi.dependency.KernelControllerContextAware}(..))
                           </property>
                           <property name="aspect">
                           <inject bean="JndiAspect" property="definition" />
                           </property>
                           <property name="manager">
                           <inject bean="AspectManager" />
                           </property>
                           </bean>
                          
                           <bean name="HibernateConfigService" class="ch.abraxas.base.infra.HibernateConfigService">
                           <annotation>@org.jboss.aop.microcontainer.aspects.jndi.JndiBinding(name="hibernate/HibernateConfigService")</annotation>
                           </bean>
                          




                          • 10. Re: Service POJO JNDI Binding Problem
                            alesj

                            1) you should use real naming factory, not the one from example

                            2) I don't think you need AspectManager
                            Just simply change the name in advice/aspect/interceptor with AspectManagerJDK5

                            But afaik this was simplified.
                            Let me check the MC test code ...

                            • 11. Re: Service POJO JNDI Binding Problem

                               

                              "alesj" wrote:
                              1) you should use real naming factory, not the one from example


                              Ups. It is now set to org.jnp.interfaces.NamingContextFactory (from jndi.properties)

                              "alesj" wrote:
                              2) I don't think you need AspectManager
                              Just simply change the name in advice/aspect/interceptor with AspectManagerJDK5


                              Yes, aop.xml in the default server conf directory creates a bean with the name AspectManager and type org.jboss.aop.deployers.AspectManagerJDK5.
                              Wich brings us back to square 1.
                              org.jboss.aop.microcontainer.beans.Aspect and org.jboss.aop.microcontainer.beans.IntroductionBinding expect an org.jboss.aop.AspectManager to be injected. However, the injected Aspectmanager is of type org.jboss.aop.deployers.AspectManagerJDK5 (as defined in aop.xml).

                              java.lang.RuntimeException: Error configuring property: manager for JndiAspect
                              Caused by: java.lang.IllegalArgumentException: Wrong arguments. setManager for target org.jboss.aop.microcontainer.beans.Aspect@a43bbd expected=[org.jboss.aop.AspectManager] actual=[org.jboss.aop.deployers.AspectManagerJDK5]
                              
                              java.lang.RuntimeException: Error configuring property: manager for JndiIntroduction
                              Caused by: java.lang.IllegalArgumentException: Wrong arguments. setManager for target org.jboss.aop.microcontainer.beans.IntroductionBinding@96ea7d expected=[org.jboss.aop.AspectManager] actual=[org.jboss.aop.deployers.AspectManagerJDK5]
                              




                              • 12. Re: Service POJO JNDI Binding Problem
                                alesj

                                 

                                "ralfsteppacher" wrote:

                                Yes, aop.xml in the default server conf directory creates a bean with the name AspectManager and type org.jboss.aop.deployers.AspectManagerJDK5.
                                Wich brings us back to square 1.
                                org.jboss.aop.microcontainer.beans.Aspect and org.jboss.aop.microcontainer.beans.IntroductionBinding expect an org.jboss.aop.AspectManager to be injected. However, the injected Aspectmanager is of type org.jboss.aop.deployers.AspectManagerJDK5 (as defined in aop.xml).

                                java.lang.RuntimeException: Error configuring property: manager for JndiAspect
                                Caused by: java.lang.IllegalArgumentException: Wrong arguments. setManager for target org.jboss.aop.microcontainer.beans.Aspect@a43bbd expected=[org.jboss.aop.AspectManager] actual=[org.jboss.aop.deployers.AspectManagerJDK5]
                                
                                java.lang.RuntimeException: Error configuring property: manager for JndiIntroduction
                                Caused by: java.lang.IllegalArgumentException: Wrong arguments. setManager for target org.jboss.aop.microcontainer.beans.IntroductionBinding@96ea7d expected=[org.jboss.aop.AspectManager] actual=[org.jboss.aop.deployers.AspectManagerJDK5]
                                


                                Hmmm ... there is some misunderstanding here.

                                Either aspect/advice/inteceptor beans expect
                                - AspectManagerJDK5 + it has getAspectManager() method
                                - direct AspectManager bean

                                Try using my first suggestion with creating real AspectManager bean.
                                Name it 'RealAspectManager' and then use this name in aspect/advice/interceptor.


                                • 13. Re: Service POJO JNDI Binding Problem

                                   

                                  "alesj" wrote:

                                  Try using my first suggestion with creating real AspectManager bean.
                                  Name it 'RealAspectManager' and then use this name in aspect/advice/interceptor.


                                  No luck. This is the summary after server start-up:
                                  16:59:18,472 ERROR [ProfileServiceBootstrap] Failed to load profile: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
                                  
                                  *** CONTEXTS MISSING DEPENDENCIES: Name -> Dependency{Required State:Actual State}
                                  
                                  JndiBinding
                                   -> JndiAspect{Configured:**ERROR**}
                                  
                                  ModuleConfService
                                   -> HibernateConfigService{Configured:**ERROR**}
                                  
                                  ServiceLifeCycleDelegate
                                   -> ModuleConfService{Configured:Instantiated}
                                  
                                  
                                  *** CONTEXTS IN ERROR: Name -> Error
                                  
                                  JndiAspect -> java.lang.IllegalArgumentException: Null name | **ERROR**
                                  
                                  HibernateConfigService -> java.lang.VerifyError: Cannot inherit from final class | **ERROR**
                                  


                                  Do you want me to post the full stacktrace?

                                  My aop.xml now looks like this:
                                   <bean name="AOPJBossIntegration" class="org.jboss.aop.asintegration.jboss5.JBoss5Integration"/>
                                  
                                   <bean name="DefaultAspectManager" class="org.jboss.aop.microcontainer.beans.metadata.DefaultAspectManager">
                                   <property name="managerBean">AspectManager</property>
                                   <property name="managerProperty">aspectManager</property>
                                   </bean>
                                  
                                   <bean name="AspectManager" class="org.jboss.aop.deployers.AspectManagerJDK5">
                                   <constructor>
                                  ...
                                   </bean>
                                  
                                   <!-- Simplify name usage -->
                                   <bean name="RealAspectManager">
                                   <constructor factoryMethod="getAspectManager"><factory bean="AspectManager"/></constructor>
                                   </bean>
                                  


                                  My jboss-beans.xml points to RealAspectManager for injection.

                                  • 14. Re: Service POJO JNDI Binding Problem
                                    alesj

                                    And you have this then?

                                    <bean name="JndiAspect" class="org.jboss.aop.microcontainer.beans.Aspect">
                                     <property name="advice">
                                     <inject bean="JndiAdvice" />
                                     </property>
                                     <property name="manager">
                                     <inject bean="RealAspectManager" />
                                     </property>
                                     </bean>
                                    

                                    See manager property.

                                    1 2 Previous Next