2 Replies Latest reply on Apr 8, 2010 4:04 AM by Csaba Szucs

    how to deploy a service bean through jboss.xml DD XML

    Csaba Szucs Newbie

      Hello Guys,

       

      I have a singleton service bean something like this:

       

      public class MyService implements MyServiceLocal, MyServiceRemote, MyServiceManagement {

      ...

      }

       

      If I have the following annotations before the class definition, everything is fine during deployment:

      @Service
      @Local(MyServiceLocal.class)

      @Remote(MyServiceRemote.class)
      @Management(MyServiceManagement.class)

       

      But, I wouldn't like to pollute my service class with annotations (an extra dependency), so I would like to deploy my service bean through a deployment descriptor XML file called jboss.xml under META-INF:

       

      <?xml version="1.0"?>
      <jboss xmlns="http://www.jboss.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
       xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss_5_0.xsd" version="3.0">
         <enterprise-beans>
            <service>
               <ejb-name>MyServiceBeanEJB</ejb-name>         
               <business-local>test.MyServiceLocal</business-local>
               <business-remote>test.MyServiceRemote</business-remote>
               <ejb-class>test.MyService</ejb-class>         
               <management>test.MyServiceManagement</management>
               <jndi-name>MyService/remote</jndi-name>
               <local-jndi-name>MyService/local</local-jndi-name>
            </service>
         </enterprise-beans>
      </jboss>

       

      JBoss AS: 5.1.0GA

      OS: WinXP SP3

       

      During deployment I get the following exception /MyServiceBean is actually called BirtReportingSystem in this case/:

       

      Could you help me in how I can deploy my service bean through deployment descriptor jboss.xml.

      Many thanks in advance!

       

      Csaba

       

      11:50:23,684 INFO  [Ejb3DependenciesDeployer] Encountered deployment AbstractVFS

      DeploymentContext@12455111{vfszip:/D:/casdev/opt/jboss-5.1.0.GA/server/default/d

      eploy/BIRTReportEngine.ear/BIRTReportEngine.jar/}

      11:50:23,684 INFO  [Ejb3DependenciesDeployer] Encountered deployment AbstractVFS

      DeploymentContext@12455111{vfszip:/D:/casdev/opt/jboss-5.1.0.GA/server/default/d

      eploy/BIRTReportEngine.ear/BIRTReportEngine.jar/}

      11:50:23,684 INFO  [Ejb3DependenciesDeployer] Encountered deployment AbstractVFS

      DeploymentContext@12455111{vfszip:/D:/casdev/opt/jboss-5.1.0.GA/server/default/d

      eploy/BIRTReportEngine.ear/BIRTReportEngine.jar/}

      11:50:23,809 INFO  [JBossASKernel] Created KernelDeployment for: js.jar

      11:50:23,809 INFO  [JBossASKernel] installing bean: jboss.j2ee:ear=BIRTReportEng

      ine.jar,jar=js.jar,name=js,service=EJB3

      11:50:23,809 INFO  [JBossASKernel]   with dependencies:

      11:50:23,809 INFO  [JBossASKernel]   and demands:

      11:50:23,809 INFO  [JBossASKernel]   and supplies:

      11:50:23,809 INFO  [JBossASKernel] Added bean(jboss.j2ee:ear=BIRTReportEngine.ja

      r,jar=js.jar,name=js,service=EJB3) to KernelDeployment of: js.jar

      11:50:23,903 INFO  [JBossASKernel] Created KernelDeployment for: BIRTReportEngin

      e.jar

      11:50:23,903 INFO  [JBossASKernel] installing bean: jboss.j2ee:ear=BIRTReportEng

      ine.ear,jar=BIRTReportEngine.jar,name=BirtReportingSystemEJB,service=EJB3

      11:50:23,903 INFO  [JBossASKernel]   with dependencies:

      11:50:23,918 INFO  [JBossASKernel]   and demands:

      11:50:23,918 INFO  [JBossASKernel]      jboss.ejb:service=EJBTimerService

      11:50:23,918 INFO  [JBossASKernel]   and supplies:

      11:50:23,918 INFO  [JBossASKernel]      jndi:BIRTReportEngine/BirtReportingSyste

      m/remote

      11:50:23,918 INFO  [JBossASKernel]      Class:com.continental.plm.birtreportengi

      ne.core.IBirtReportingSystemRemote

      11:50:23,918 INFO  [JBossASKernel]      jndi:BIRTReportEngine/BirtReportingSyste

      m/local

      11:50:23,918 INFO  [JBossASKernel]      jndi:BIRTReportEngine/BirtReportingSyste

      mEJB/com.continental.plm.birtreportengine.core.IBirtReportingSystemRemote

      11:50:23,918 INFO  [JBossASKernel]      Class:com.continental.plm.birtreportengi

      ne.core.IBirtReportingSystemManagement

      11:50:23,918 INFO  [JBossASKernel] Added bean(jboss.j2ee:ear=BIRTReportEngine.ea

      r,jar=BIRTReportEngine.jar,name=BirtReportingSystemEJB,service=EJB3) to KernelDe

      ployment of: BIRTReportEngine.jar

      11:50:36,934 INFO  [JBossASKernel] installing bean: jboss.j2ee:ear=BIRTReportEng

      ine.ear,jar=BIRTReportEngine.jar,name=BirtReportingSystemEJB,service=EJB3,type=M

      anagementInterface

      11:50:36,934 INFO  [JBossASKernel]   with dependencies:

      11:50:36,934 INFO  [JBossASKernel]   and demands:

      11:50:36,934 INFO  [JBossASKernel]      jboss.ejb:service=EJBTimerService

      11:50:36,934 INFO  [JBossASKernel]      jboss.j2ee:ear=BIRTReportEngine.ear,jar=

      BIRTReportEngine.jar,name=BirtReportingSystemEJB,service=EJB3

      11:50:36,934 INFO  [JBossASKernel]   and supplies:

      11:50:36,950 INFO  [JBossASKernel]      jndi:BIRTReportEngine/BirtReportingSyste

      m/remote

      11:50:36,950 INFO  [JBossASKernel]      Class:com.continental.plm.birtreportengi

      ne.core.IBirtReportingSystemRemote

      11:50:36,950 INFO  [JBossASKernel]      jndi:BIRTReportEngine/BirtReportingSyste

      m/local

      11:50:36,950 INFO  [JBossASKernel]      jndi:BIRTReportEngine/BirtReportingSyste

      mEJB/com.continental.plm.birtreportengine.core.IBirtReportingSystemRemote

      11:50:36,950 INFO  [JBossASKernel]      Class:com.continental.plm.birtreportengi

      ne.core.IBirtReportingSystemManagement

      11:50:36,965 INFO  [JBossASKernel] Installing bean(jboss.j2ee:ear=BIRTReportEngi

      ne.ear,jar=BIRTReportEngine.jar,name=BirtReportingSystemEJB,service=EJB3,type=Ma

      nagementInterface) into kernel

      11:50:36,965 INFO  [EJBContainer] STARTED EJB: com.continental.plm.birtreporteng

      ine.core.BirtReportingSystem ejbName: BirtReportingSystemEJB

      11:50:37,059 ERROR [AbstractKernelController] Error installing to Start: name=jb

      oss.j2ee:ear=BIRTReportEngine.ear,jar=BIRTReportEngine.jar,name=BirtReportingSys

      temEJB,service=EJB3 state=Create

      java.lang.IllegalArgumentException: Specified instance of org.jboss.metadata.ejb

      .jboss.JBossServiceBeanMetaData is not resolvable, required type ResolveableJndi

      NameJbossEnterpriseBeanMetadata must be implemented

              at org.jboss.metadata.ejb.jboss.jndipolicy.spi.JbossEnterpriseBeanJndiNa

      meResolver.ensureResolvable(JbossEnterpriseBeanJndiNameResolver.java:81)

              at org.jboss.metadata.ejb.jboss.jndipolicy.spi.JbossEnterpriseBeanJndiNa

      meResolver.resolveJndiName(JbossEnterpriseBeanJndiNameResolver.java:49)

              at org.jboss.ejb3.proxy.impl.jndiregistrar.JndiSessionRegistrarBase.crea

      teJndiReferenceBindingSet(JndiSessionRegistrarBase.java:576)

              at org.jboss.ejb3.proxy.impl.jndiregistrar.JndiSessionRegistrarBase.bind

      Ejb(JndiSessionRegistrarBase.java:148)

              at org.jboss.ejb3.session.SessionContainer.lockedStart(SessionContainer.

      java:210)

              at org.jboss.ejb3.service.ServiceContainer.lockedStart(ServiceContainer.

      java:252)

              at org.jboss.ejb3.EJBContainer.start(EJBContainer.java:884)

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

      java:39)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

      sorImpl.java:25)

              at java.lang.reflect.Method.invoke(Method.java:597)

              at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(Reflec

      tionUtils.java:59)

              at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(

      ReflectMethodInfoImpl.java:150)

              at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethod

      JoinPoint.java:66)

              at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$Joi

      npointDispatchWrapper.execute(KernelControllerContextAction.java:241)

              at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(Executio

      nWrapper.java:47)

              at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dis

      patchExecutionWrapper(KernelControllerContextAction.java:109)

              at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dis

      patchJoinPoint(KernelControllerContextAction.java:70)

              at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInte

      rnal(LifecycleAction.java:221)

              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.sim

      pleInstallAction(SimpleControllerContextAction.java:62)

              at org.jboss.dependency.plugins.action.AccessControllerContextAction.ins

      tall(AccessControllerContextAction.java:71)

              at org.jboss.dependency.plugins.AbstractControllerContextActions.install

      (AbstractControllerContextActions.java:51)

              at org.jboss.dependency.plugins.AbstractControllerContext.install(Abstra

      ctControllerContext.java:348)

              at org.jboss.dependency.plugins.AbstractController.install(AbstractContr

      oller.java:1631)

              at org.jboss.dependency.plugins.AbstractController.incrementState(Abstra

      ctController.java:934)

              at org.jboss.dependency.plugins.AbstractController.resolveContexts(Abstr

      actController.java:1082)

              at org.jboss.dependency.plugins.AbstractController.resolveContexts(Abstr

      actController.java:984)

              at org.jboss.dependency.plugins.AbstractController.install(AbstractContr

      oller.java:774)

              at org.jboss.dependency.plugins.AbstractController.install(AbstractContr

      oller.java:540)

              at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(B

      eanMetaDataDeployer.java:121)

              at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(B

      eanMetaDataDeployer.java:51)

              at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.i

      nternalDeploy(AbstractSimpleRealDeployer.java:62)

              at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(

      AbstractRealDeployer.java:50)

              at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(Deployer

      Wrapper.java:171)

              at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(Deployer

      sImpl.java:1439)

              at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFi

      rst(DeployersImpl.java:1157)

              at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFi

      rst(DeployersImpl.java:1178)

              at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFi

      rst(DeployersImpl.java:1210)

              at org.jboss.deployers.plugins.deployers.DeployersImpl.install(Deployers

      Impl.java:1098)

              at org.jboss.dependency.plugins.AbstractControllerContext.install(Abstra

      ctControllerContext.java:348)

              at org.jboss.dependency.plugins.AbstractController.install(AbstractContr

      oller.java:1631)

              at org.jboss.dependency.plugins.AbstractController.incrementState(Abstra

      ctController.java:934)

              at org.jboss.dependency.plugins.AbstractController.resolveContexts(Abstr

      actController.java:1082)

              at org.jboss.dependency.plugins.AbstractController.resolveContexts(Abstr

      actController.java:984)

              at org.jboss.dependency.plugins.AbstractController.change(AbstractContro

      ller.java:822)

              at org.jboss.dependency.plugins.AbstractController.change(AbstractContro

      ller.java:553)

              at org.jboss.deployers.plugins.deployers.DeployersImpl.process(Deployers

      Impl.java:781)

              at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeploye

      rImpl.java:702)

              at org.jboss.system.server.profileservice.repository.MainDeployerAdapter

      .process(MainDeployerAdapter.java:117)

              at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDSca

      nner.java:362)

              at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScan

      ner.java:255)

              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:44

      1)

              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(ThreadPoolExec

      utor.java:886)

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor

      .java:908)

              at java.lang.Thread.run(Thread.java:619)

      11:50:37,762 INFO  [ClientENCInjectionContainer] STARTED CLIENT ENC CONTAINER: j

      s

      11:50:37,825 WARN  [HDScanner] Failed to process changes

      org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incompl

      ete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

       

      DEPLOYMENTS IN ERROR:

        Deployment "jboss.j2ee:ear=BIRTReportEngine.ear,jar=BIRTReportEngine.jar,name=

      BirtReportingSystemEJB,service=EJB3" is in error due to the following reason(s):

      java.lang.IllegalArgumentException: Specified instance of org.jboss.metadata.ej

      b.jboss.JBossServiceBeanMetaData is not resolvable, required type ResolveableJnd

      iNameJbossEnterpriseBeanMetadata must be implemented

       

              at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(Dep

      loyersImpl.java:993)

              at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(Dep

      loyersImpl.java:939)

              at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainD

      eployerImpl.java:873)

              at org.jboss.system.server.profileservice.repository.MainDeployerAdapter

      .checkComplete(MainDeployerAdapter.java:128)

              at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDSca

      nner.java:369)

              at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScan

      ner.java:255)

              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:44

      1)

              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(ThreadPoolExec

      utor.java:886)

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor

      .java:908)

              at java.lang.Thread.run(Thread.java:619)