1 Reply Latest reply on Mar 6, 2006 4:08 PM by Michael Newcomb

    Service POJO with EJB3 Session Beans

    fiorenzo pizza Newbie

      I'm using jboss-4.0.4RC1 with EJB-3.0_RC5-PFD.
      I have a problem with an MBean (EJB3 style) that would have to interact with some Session Beans. All this components are in the same ear archive.

      @Service(objectName = "ServiceManagerJMX:service=attivatore")
      @Management(Attivatore.class)
      @Local(AttivatoreLocal.class)
      
      public class AttivatoreMBean implements Attivatore {
       String repositoryAddress;
       String deployDir;
       String serviceDir;
      
      @Depends("jboss.j2ee:jar=ServiceManagementejb3.jar,name=ServiceManagement/RepositoryMngrBean/local,service=EJB3,type=RepositoryMngrLocal")
       @EJB(mappedName = "ServiceManagement/RepositoryMngrBean/local")
       RepositoryMngr repositoryMngr;
       @Depends("jboss.j2ee:name=ServiceManagement/PersistenceMngrBean/local,service=EJB3,type=PersistenceMngrLocal")
       @EJB(mappedName = "ServiceManagement/PersistenceMngrBean/local")
       PersistenceMngrLocal persistenceMngr;
      
      @Depends("jboss.j2ee:jar=ServiceManagementejb3.jar,name=ServiceManagement/ServiceMngrBean/local,service=EJB3,type=ServiceMngrLocal")
       @EJB(mappedName = "ServiceManagement/ServiceMngrBean/local")
       ServiceMngr serviceMngr;
      
      public void start() throws Exception {
       repositoryMngr.update();
       if (serviceMngr.bootBindings()) {
       System.out.println("success");
       } else {
       System.out.println("don't work");
       }
       }
      


      At deploy time, the console shows:


      16:35:09,528 INFO [EARDeployer] Init J2EE application: file:/usr/jboss/jboss-4.0.4RC1/server/default/deploy/ServiceManagement.ear/
      16:35:09,567 INFO [Ejb3AnnotationHandler] found EJB3: ejbName=RepositoryMngrBean, class=it.swimm.middleware.repository.localRepository.ejb3.RepositoryMngrBean, type=STATELESS
      16:35:09,577 INFO [Ejb3AnnotationHandler] found EJB3: ejbName=PersistenceMngrBean, class=it.swimm.middleware.repository.localRepository.persistence.ejb3.PersistenceMngrBean, type=STATELESS
      16:35:09,587 INFO [Ejb3AnnotationHandler] found EJB3: ejbName=ServiceMngrBean, class=it.swimm.middleware.repository.servicesMngmt.ejb3.ServiceMngrBean, type=STATELESS
      16:35:09,591 INFO [Ejb3Deployment] EJB3 deployment time took: 36
      16:35:09,604 INFO [Ejb3AnnotationHandler] found EJB3: ejbName=AttivatoreMBean, class=it.swimm.middleware.repository.activator.jmx.AttivatoreMBean, type=SERVICE
      16:35:09,606 INFO [Ejb3Deployment] EJB3 deployment time took: 8
      16:35:09,619 FATAL [PersistenceXmlLoader] repositoryLocal JTA
      16:35:09,619 INFO [Ejb3Deployment] EJB3 deployment time took: 6
      16:35:09,635 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:service=EJB3,ear=ServiceManagement.ear,jar=ServiceManagementejb3.jar,name=RepositoryMngrBean with dependencies:
      16:35:09,747 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:service=EJB3,ear=ServiceManagement.ear,jar=ServiceManagementejb3.jar,name=PersistenceMngrBean with dependencies:
      16:35:09,747 INFO [JmxKernelAbstraction] persistence.units:ear=ServiceManagement.ear.ear,unitName=repositoryLocal
      16:35:09,752 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:service=EJB3,ear=ServiceManagement.ear,jar=ServiceManagementejb3.jar,name=ServiceMngrBean with dependencies:
      16:35:09,841 INFO [EJB3Deployer] Deployed: file:/usr/jboss/jboss-4.0.4RC1/server/default/deploy/ServiceManagement.ear/ServiceManagementejb3.jar
      16:35:09,846 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:service=EJB3,ear=ServiceManagement.ear,jar=ServiceManagementjmx.jar,name=AttivatoreMBean with dependencies:
      16:35:09,846 INFO [JmxKernelAbstraction] jboss.j2ee:jar=ServiceManagementejb3.jar,name=ServiceManagement/RepositoryMngrBean/local,service=EJB3,type=RepositoryMngrLocal
      16:35:09,846 INFO [JmxKernelAbstraction] jboss.j2ee:name=ServiceManagement/PersistenceMngrBean/local,service=EJB3,type=PersistenceMngrLocal
      16:35:09,846 INFO [JmxKernelAbstraction] jboss.j2ee:jar=ServiceManagementejb3.jar,name=ServiceManagement/ServiceMngrBean/local,service=EJB3,type=ServiceMngrLocal
      


      The service ("ServiceManagerJMX:service=attivatore" ) became an EJB3 component, instead of JMX service and then i can't manage his properties.

      Is it a Bug?

      Tanks in advance.

      Fiorenzo