Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-3798

EJB Interceptors Initialised Before Dependent Services Started

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • No Release
    • JBossAS-4.0.4.GA, JBossAS-4.0.5.GA
    • EJB2
    • None
    • Workaround Exists
    • Hide

      This an be easily worked around by adding your MBean as a dependency
      on the EJBDeployer.

      In ejb.deployer after
      <mbean code="org.jboss.ejb.EJBDeployer" name="jboss.ejb:service=EJBDeployer" xmbean-dd="">
      add
      <depends>jboss.jca:service=CachedConnectionManager</depends>

      Show
      This an be easily worked around by adding your MBean as a dependency on the EJBDeployer. In ejb.deployer after <mbean code="org.jboss.ejb.EJBDeployer" name="jboss.ejb:service=EJBDeployer" xmbean-dd=""> add <depends>jboss.jca:service=CachedConnectionManager</depends>

      The interceptors for an EJB are initialised in the create step of EJB deployment, this means that they can be initialised before the services the EJB depends on have been started.

      This can be reproduced by deploying a sar that contains a jar that contains a MDB and then starting JBoss, the CachedConnectionInterceptor is initialised before the CachedConnectionManager is available and the following warning is logged: -

      12:27:54,179 WARN [EjbModule] Could not load the org.jboss.resource.connectionmanager.CachedConnectionInterceptor interceptor for this container
      javax.management.InstanceNotFoundException: jboss.jca:service=CachedConnectionManager is not registered.
      at org.jboss.mx.server.registry.BasicMBeanRegistry.get(BasicMBeanRegistry.java:523)
      at org.jboss.mx.server.MBeanServerImpl.getAttribute(MBeanServerImpl.java:550)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.<init>(CachedConnectionInterceptor.java:78)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
      at java.lang.Class.newInstance0(Class.java:350)
      at java.lang.Class.newInstance(Class.java:303)
      at org.jboss.ejb.EjbModule.addInterceptors(EjbModule.java:930)
      at org.jboss.ejb.EjbModule.initializeContainer(EjbModule.java:816)
      at org.jboss.ejb.EjbModule.createMessageDrivenContainer(EjbModule.java:602)
      at org.jboss.ejb.EjbModule.createContainer(EjbModule.java:569)
      at org.jboss.ejb.EjbModule.createService(EjbModule.java:342)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:260)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:243)

              Unassigned Unassigned
              darran.lofthouse@redhat.com Darran Lofthouse
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: