7 Replies Latest reply on Feb 12, 2009 10:47 AM by peterj

    Bug? Multiple interfaces in the implementation causes Deploy

    dsteinwe

      Hi,

      i have declared a mbean like that example:

      MyServiceMBean.java

      @Service(objectName="MyApplication:service=MyService")
      @Management(MyManagementInterface.class)
      public class MyServiceMBean implements MyManagementInterface {
      
       public void printOut(String text) {
       System.out.println("Given text: " + text);
       }
      
      }


      MyManagementInterface.java:
      public interface MyManagementInterface {
       public void printOut(String text);
      }


      Works so far fine. BUT if I write following in "MyServiceMBean.java":
      public class MyServiceMBean implements MyManagementInterface, org.quartz.TriggerListener {
      ...
      }


      I get a deployment exception:
      org.jboss.deployers.spi.DeploymentException: Error deploying xyz.jar: Error creating ejb container MyServiceMBean: Bean Class xyz.MyServiceMBean has no local, webservice, or remote interfaces defined and does not implement at least one business interface: MyServiceMBean


      I was a little bit confused about this message. Extending
      MyManagementInterface
      from
      org.quartz.TriggerListener
      works fine but trashes the management interface in the jmx-console. Adding
      @Local(MyManagementInterface.class)
      to the MBean the deployment works fine and keeps the management interface clean.

      But is the annotation really neccessary? Is this behaviour intended?

      Cheers Dieter.

        • 1. Re: Bug? Multiple interfaces in the implementation causes De
          jaikiran

          Which version of JBossAS?

          Is this behaviour intended?


          I don't think so.

          Can you please post the entire exception logs from the console?

          • 2. Re: Bug? Multiple interfaces in the implementation causes De
            dsteinwe

            I use JBoss 5.0.1GA because in this version are some bugs fixed in the jmx-console webapp.

            I get following exception log:

            10:01:39,781 ERROR [AbstractKernelController] Error installing to Real: name=vfszip:/D:/jboss/jboss-5.0.1.GA/server/default/deploy/ccontrol.ear state=PreReal mode=Manual requiredState=Real
            org.jboss.deployers.spi.DeploymentException: Error deploying mis_ccontrol-service.jar: Error creating ejb container StaffImportScanner: Bean Class com.isios.mis.ccontrol.base.service.StaffImportScanner has no local, webservice, or remote interfaces defined and does not implement at least one business interface: StaffImportScanner
             at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:201)
             at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:103)
             at org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer.internalDeploy(AbstractVFSRealDeployer.java:45)
             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: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.hotdeploy.HDScanner.scan(HDScanner.java:290)
             at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
             at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
             at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
             at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
             at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
             at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
             at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
             at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
             at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
             at java.lang.Thread.run(Thread.java:619)
            Caused by: org.jboss.deployers.spi.DeploymentException: Error creating ejb container StaffImportScanner: Bean Class com.isios.mis.ccontrol.base.service.StaffImportScanner has no local, webservice, or remote interfaces defined and does not implement at least one business interface: StaffImportScanner
             at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:682)
             at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:628)
             at org.jboss.ejb3.Ejb3Deployment.deployUrl(Ejb3Deployment.java:610)
             at org.jboss.ejb3.Ejb3Deployment.deploy(Ejb3Deployment.java:573)
             at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:488)
             at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:187)
             ... 28 more
            Caused by: java.lang.RuntimeException: Bean Class com.isios.mis.ccontrol.base.service.StaffImportScanner has no local, webservice, or remote interfaces defined and does not implement at least one business interface: StaffImportScanner
             at org.jboss.ejb3.proxy.factory.ProxyFactoryHelper.getLocalAndBusinessLocalInterfaces(ProxyFactoryHelper.java:255)
             at org.jboss.ejb3.proxy.factory.ProxyFactoryHelper.getLocalBusinessInterfaces(ProxyFactoryHelper.java:550)
             at org.jboss.ejb3.session.SessionContainer.resolveBusinessInterfaces(SessionContainer.java:161)
             at org.jboss.ejb3.service.ServiceContainer.resolveBusinessInterfaces(ServiceContainer.java:265)
             at org.jboss.ejb3.EJBContainer.instantiated(EJBContainer.java:1564)
             at org.jboss.ejb3.session.SessionContainer.instantiated(SessionContainer.java:151)
             at org.jboss.ejb3.service.ServiceContainer.instantiated(ServiceContainer.java:259)
             at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:676)
             ... 33 more
            10:01:39,796 WARN [HDScanner] Failed to process changes
            org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
            
            *** CONTEXTS MISSING DEPENDENCIES: Name -> Dependency{Required State:Actual State}
            
            com.isios.ccontrol:service=StaffImportScanner
             -> <UNKNOWN com.isios.ccontrol:service=StaffImportScanner>{Described:** UNRESOLVED Demands 'jboss.j2ee:ear=ccontrol.ear,jar=mis_ccontrol-service.jar,name=StaffImportScanner,service=EJB3' **}
            
            com.isios.mis.ccontrol:service=PrivilegeSynchronizer
             -> <UNKNOWN com.isios.mis.ccontrol:service=PrivilegeSynchronizer>{Described:** UNRESOLVED Demands 'jboss.j2ee:ear=ccontrol.ear,jar=mis_ccontrol-service.jar,name=PrivilegeSynchronizer,service=EJB3' **}
            
            com.isios.mis.ccontrol:service=PropertiesLoaderService
             -> <UNKNOWN com.isios.mis.ccontrol:service=PropertiesLoaderService>{Described:** UNRESOLVED Demands 'jboss.j2ee:ear=ccontrol.ear,jar=mis_ccontrol-bootstrap.jar,name=PropertiesLoader,service=EJB3' **}
            
            
            *** CONTEXTS IN ERROR: Name -> Error
            
            vfszip:/D:/jboss/jboss-5.0.1.GA/server/default/deploy/ccontrol.ear -> java.lang.RuntimeException: Bean Class com.isios.mis.ccontrol.base.service.StaffImportScanner has no local, webservice, or remote interfaces defined and does not implement at least one business interface: StaffImportScanner
            
            <UNKNOWN com.isios.mis.ccontrol:service=PropertiesLoaderService> -> ** UNRESOLVED Demands 'jboss.j2ee:ear=ccontrol.ear,jar=mis_ccontrol-bootstrap.jar,name=PropertiesLoader,service=EJB3' **
            
            <UNKNOWN com.isios.ccontrol:service=StaffImportScanner> -> ** UNRESOLVED Demands 'jboss.j2ee:ear=ccontrol.ear,jar=mis_ccontrol-service.jar,name=StaffImportScanner,service=EJB3' **
            
            <UNKNOWN com.isios.mis.ccontrol:service=PrivilegeSynchronizer> -> ** UNRESOLVED Demands 'jboss.j2ee:ear=ccontrol.ear,jar=mis_ccontrol-service.jar,name=PrivilegeSynchronizer,service=EJB3' **
            
            
             at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:863)
             at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:665)
             at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:293)
             at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
             at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
             at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
             at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
             at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
             at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
             at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
             at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
             at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
             at java.lang.Thread.run(Thread.java:619)
            
            


            Don't be confused about the class & archive names. The real names my project differs a little bit from the first posting.

            The real code is:
            @Service(objectName=StaffImportScanner.OBJECT_NAME)
            @Management(StaffImportScannerService.class)
            public class StaffImportScanner implements StaffImportScannerService, TriggerListener {
            ...
            }
            


            TriggerListener is an interface from the quartz framework. StaffImportScannerService is an own defined interface that I want to expose.

            Cheers Dieter.

            • 3. Re: Bug? Multiple interfaces in the implementation causes De
              jaikiran

               

              @Service(objectName=StaffImportScanner.OBJECT_NAME)
              @Management(StaffImportScannerService.class)
              public class StaffImportScanner implements StaffImportScannerService, TriggerListener {
              ...
              }
              




              TriggerListener is an interface from the quartz framework. StaffImportScannerService is an own defined interface that I want to expose.


              @Service is an extension to EJB3 session beans. So the @Service should have either a remote or local business interface defined. If you don't specify the local or remote business interface (either through xml or through annotation), then the server tries to discover this information. So if you have something like:
              @Service(objectName=StaffImportScanner.OBJECT_NAME)
              @Management(StaffImportScannerService.class)
              public class StaffImportScanner implements StaffImportScannerService


              The server will consider the StaffImportScannerService as the @Local business interface (even though you haven't explicitly specified that). This works when the bean class implements just one interface. If the class implements more than one interface, then there is no way to infer which one of the interfaces is expected to be the business interface of the bean. And hence the error. In such cases, the bean developer is expected to explicitly specify either the @Local or @Remote interface (through annotation or xml). Here's how you can do it through annotation:



              @Service(objectName=StaffImportScanner.OBJECT_NAME)
              @Management(StaffImportScannerService.class)
              @Remote (StaffImportScannerService.class)
              public class StaffImportScanner implements StaffImportScannerService, TriggerListener {
              ...
              }
              
              


              It's upto you to decide whether you want @Remote or @Local.


              • 4. Re: Bug? Multiple interfaces in the implementation causes De
                peterj

                 

                I use JBoss 5.0.1GA


                Did you get the source from subversion and build it yourself? I ask because 5.0.1.GA is not out yet. However, I'm not sure if the exact version has any bearing on the issue.

                • 5. Re: Bug? Multiple interfaces in the implementation causes De
                  dsteinwe

                  @jaikiran

                  Thanks for your information. Now, it's clear that it is an intend behaviour and of course it makes sense.

                  @PeterJ
                  Yes, I have checked out the branch "Branch_5_0" installed ant and maven. After that you can build 5.0.1. BTW, can take > 1h.

                  @All
                  I have found some docs about the @Service annotation here:
                  http://docs.jboss.org/ejb3/app-server/reference/build/reference/en/html/jboss_extensions.html
                  Chapter "5.1. @Service EJBs" contains all relevant information about the annotation and explains the behaviour.

                  • 6. Re: Bug? Multiple interfaces in the implementation causes De
                    jaikiran

                     

                    "dsteinwe" wrote:

                    @All
                    I have found some docs about the @Service annotation here:
                    http://docs.jboss.org/ejb3/app-server/reference/build/reference/en/html/jboss_extensions.html
                    Chapter "5.1. @Service EJBs" contains all relevant information about the annotation and explains the behaviour.


                    That one's for JBossAS-4.x. Most of it remains the same for JBossAS-5 except for the package names for the annotations. So for AS5, this is the updated version http://www.jboss.org/file-access/default/members/jbossejb3/freezone/docs/tutorial/1.0.0/html/Service_POJOs.html

                    1 of 1 people found this helpful
                    • 7. Re: Bug? Multiple interfaces in the implementation causes De
                      peterj

                      I would not trust Branch_5_0 until Ales is finished fixing issues with VFS. You really should try this on the 5.0.0.GA download.