3 Replies Latest reply on Aug 20, 2007 6:16 PM by pmuir

    Service objects with dependencies are deployed in different

    hsoldier

      Hello all,

      I have a very strange problem with our application using JBoss Seam 2.0.0.BETA1.

      We have two annotated service objects, CORBAOrb and AlarmConsumer. The latter one has a dependency on the first one (we used the @Depends annotation).

      As one would expect, the dependency is satisfied when the EAR file is deployed on to JBoss AS 4.2.0.GA. That makes me think that the annotations are correct and I do not have to include the source code here in my post.

      The following is the relevant extract from the server.log file. Everything works fine because the CORBAOrb MBean is started before the AlarmConsumer MBean, which depends on its services.

      2007-08-20 11:43:39,077 INFO [org.jboss.ejb3.JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.service.ServiceContainer
      2007-08-20 11:43:39,093 INFO [org.jboss.ejb3.JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=oam-ear-0.1.ear,jar=oam-ejb3-0.1.jar,name=AlarmConsumerMBean,service=EJB3 with dependencies:
      2007-08-20 11:43:39,093 INFO [org.jboss.ejb3.JmxKernelAbstraction] FWOAM:service=CORBAOrb
      2007-08-20 11:43:39,109 INFO [org.jboss.ejb3.JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.service.ServiceContainer
      2007-08-20 11:43:39,109 INFO [org.jboss.ejb3.JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=oam-ear-0.1.ear,jar=oam-ejb3-0.1.jar,name=CORBAOrbMBean,service=EJB3 with dependencies:
      
      2007-08-20 11:43:39,156 INFO [org.jboss.ejb3.EJBContainer] STARTED EJB: com.openet.oam.beans.mbeans.corba.CORBAOrbMBean ejbName: CORBAOrbMBean
      2007-08-20 11:43:39,156 INFO [com.openet.oam.beans.mbeans.corba.CORBAOrbMBean] CORBAOrb - Creating
      2007-08-20 11:43:39,171 INFO [com.openet.oam.corba.CorbaInterface] Name Service URL: corbaloc::10.0.3.1:22500/NameService
      2007-08-20 11:43:39,171 INFO [com.openet.oam.corba.CorbaInterface] Event Service URL: corbaloc::10.0.3.1:22501/DefaultEventChannelFactory
      2007-08-20 11:43:39,421 INFO [com.openet.oam.beans.mbeans.corba.CORBAOrbMBean] CORBAOrb - Starting
      
      2007-08-20 11:43:40,390 INFO [org.jboss.ejb3.EJBContainer] STARTED EJB: com.openet.oam.beans.mbeans.corba.alarms.AlarmConsumerMBean ejbName: AlarmConsumerMBean
      2007-08-20 11:43:40,390 INFO [com.openet.oam.beans.mbeans.corba.alarms.AlarmConsumerMBean] EventListener - creating channel consumer AlarmChannelConsumer
      2007-08-20 11:43:40,422 INFO [com.openet.oam.corba.CorbaInterface] initialiseEventChannel('AlarmChannel')
      2007-08-20 11:43:40,500 INFO [com.openet.oam.corba.CorbaInterface] Looking for EventChannel 'AlarmChannel'
      2007-08-20 11:43:40,531 INFO [com.openet.oam.corba.CorbaInterface] EventChannel 'AlarmChannel' resolved
      2007-08-20 11:43:40,531 INFO [com.openet.oam.beans.mbeans.corba.alarms.AlarmConsumerMBean] EventListener - starting channel consumer AlarmChannelConsumer
      2007-08-20 11:43:40,547 INFO [com.openet.oam.corba.CorbaInterface] initialiseConsumer()
      


      However if I run the code as a Seam TestNG integration test where our test extends SeamTest, the deployment order is different.

      I used the three jars coming with JBoss Seam 2.0.0.BETA1 in its lib directory: jboss-embedded-all.jar, hibernate-all.jar and thirdparty-all.jar.

      The following printout from TestNG shows that the same two MBeans are started in the wrong order, causing exceptions:

       [testng] INFO 20-08 16:54:35,564 [org.jboss.ejb3.MCKernelAbstraction.install():119] installing bean: jboss.j2ee:jar=test-classes,name=AlarmConsumerMBean,service=EJB3 with dependencies:
       [testng] INFO 20-08 16:54:35,564 [org.jboss.ejb3.MCKernelAbstraction.install():131] FWOAM:service=CORBAOrb
       [testng] INFO 20-08 16:54:35,564 [org.jboss.ejb3.MCKernelAbstraction.install():119] installing bean: jboss.j2ee:jar=test-classes,name=CORBAOrbMBean,service=EJB3 with dependencies:
      
       [testng] INFO 20-08 16:54:35,611 [org.jboss.ejb3.EJBContainer.start():580] STARTED EJB: com.openet.oam.beans.mbeans.corba.CORBAOrbMBean ejbName: CORBAOrbMBean
       [testng] INFO 20-08 16:54:35,611 [org.jboss.ejb3.MCKernelAbstraction.install():119] installing bean: FWOAM:service=CORBAOrb with dependencies:
      
       [testng] INFO 20-08 16:54:35,705 [org.jboss.ejb3.EJBContainer.start():580] STARTED EJB: com.openet.oam.beans.mbeans.corba.alarms.AlarmConsumerMBean ejbName: AlarmConsumerMBean
       [testng] INFO 20-08 16:54:35,705 [org.jboss.ejb3.MCKernelAbstraction.install():119] installing bean: FWOAM:service=AlarmConsumer with dependencies:
       [testng] INFO 20-08 16:54:35,705 [org.jboss.ejb3.MCKernelAbstraction.install():131] FWOAM:service=CORBAOrb
      
       [testng] INFO 20-08 16:54:35,814 [com.openet.oam.beans.mbeans.corba.alarms.AlarmConsumerMBean.create():65] EventListener - creating channel consumer AlarmChannelConsumer
       [testng] INFO 20-08 16:54:35,814 [com.openet.oam.beans.mbeans.corba.alarms.AlarmConsumerMBean.create():72] ERROR : null
       [testng] javax.management.MBeanException
       [testng] INFO 20-08 16:54:35,830 [com.openet.oam.beans.mbeans.corba.alarms.AlarmConsumerMBean.start():87] EventListener - starting channel consumer AlarmChannelConsumer
       [testng] INFO 20-08 16:54:35,830 [com.openet.oam.beans.mbeans.corba.alarms.AlarmConsumerMBean.start():102] ERROR : null
       [testng] javax.management.MBeanException
      
       [testng] INFO 20-08 16:54:35,846 [com.openet.oam.beans.mbeans.corba.CORBAOrbMBean.create():29] CORBAOrb - Creating
       [testng] INFO 20-08 16:54:35,846 [com.openet.oam.corba.CorbaInterface.<init>():62] Name Service URL: corbaloc::10.0.3.1:22500/NameService
       [testng] INFO 20-08 16:54:35,846 [com.openet.oam.corba.CorbaInterface.<init>():63] Event Service URL: corbaloc::10.0.3.1:22501/DefaultEventChannelFactory
       [testng] INFO 20-08 16:54:35,861 [com.openet.oam.beans.mbeans.corba.CORBAOrbMBean.start():41] CORBAOrb - Starting
      


      Did anyone experienced this problem before? Is this a known issue?

      As far I can see, the behaviour of the MCKernelAbstraction is different from the JmxKernelAbstraction.

      We tried to debug through the Embeddable EJB3 container but it is unclear what went into the jboss-embedded-all.jar file in terms of compiled source code (list of CVS or SVN projects, branches and tags/labels)? We checked out the 4.2.0.GA source code and also JBoss Microcontainer 2.0 but the lines did not match.

      Any help would be really appreciated.

      We think that Seam is a great enabling framework to write simple code and the idea that you can write integration tests for your Seam application when/while you are developing is brilliant!

      Only if we could get consistent behaviur between the fully-blown JBoss AS and the EJB3 Embeddable...

      Best regards:
      Peter