9 Replies Latest reply on Nov 8, 2011 5:12 AM by ngermain

    Set up mapped name in XML

    gvalenc Newbie

      I am trying to avoid using the mapped-name attribute in @Resource annotation on my SLSB and provide it in the deployment descriptor, either ejb-jar.xml or jboss.xml. However, I've tried setting mapped-name in either XML file and I still get "mapped-name is required for...", in this case trying to define it for a JMS Queue. In ejb-jar.xml, I tried putting it in a resource-env-ref. In jboss.xml, tried putting it in resource-ref. Even with both at the same time, it fails. Is there an expected way to get this to work? How about resource-managers? Do I need those and/or do they have to do with this?

        • 1. Re: Set up mapped name in XML
          gvalenc Newbie

          Forgot to mention I'm on AS 5.0.1, Java 1.5.

          • 2. Re: Set up mapped name in XML
            jaikiran pai Master

            Please post the relevant code (which includes the @Resource, if any) and the relevant deployment descriptors and also the entire exception stacktrace.

             

            Also, please upgrade to JBoss AS 5.1.0.

            • 3. Re: Set up mapped name in XML
              gvalenc Newbie

              Unfortunately can't paste the code completely as its for our product. I basically have @Resource(name = "****CF"), where the resource is a JMS Connection Factory andthis is my edited jboss.xml:

               

               

              Here is the edited stack trace:

               

              10:12:55,859 ERROR [AbstractKernelController] Error installing to Real: name=vfszip:/C:/jboss-5.0.1.GA/server/default/deploy/RES.ear/ state=PreReal mode=Manual requiredState=Real
              org.jboss.deployers.spi.DeploymentException: Error deploying res_director.jar: mapped-name is required for jms/res/DirectorCF of deployment RESDirectorBean
              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:698)
              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:432)
              at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:295)
              at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:88)
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:165)
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:189)
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:678)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:703)
              at java.lang.Thread.run(Thread.java:811)
              Caused by:
              java.lang.RuntimeException: mapped-name is required for jms/res/DirectorCF of deployment RESDirectorBean
              at org.jboss.injection.ResourceHandler.loadXmlResourceRefs(ResourceHandler.java:178)
              at org.jboss.injection.ResourceHandler.loadXml(ResourceHandler.java:335)
              at org.jboss.ejb3.EJBContainer.processMetadata(EJBContainer.java:588)
              at org.jboss.ejb3.Ejb3Deployment.processEJBContainerMetadata(Ejb3Deployment.java:415)
              at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:523)
              at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:194)

              10:12:55,859 ERROR [AbstractKernelController] Error installing to Real: name=vfszip:/C:/jboss-5.0.1.GA/server/default/deploy/***.ear/ state=PreReal mode=Manual requiredState=Real

              org.jboss.deployers.spi.DeploymentException: Error deploying ****.jar: mapped-name is required for ****CF of deployment ****Bean

              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:698)

              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:432)

              at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:295)

              at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)

              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:88)

              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:165)

              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:189)

              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:678)

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:703)

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

              Caused by:

              java.lang.RuntimeException: mapped-name is required for ****CF of deployment ****Bean

              at org.jboss.injection.ResourceHandler.loadXmlResourceRefs(ResourceHandler.java:178)

              at org.jboss.injection.ResourceHandler.loadXml(ResourceHandler.java:335)

              at org.jboss.ejb3.EJBContainer.processMetadata(EJBContainer.java:588)

              at org.jboss.ejb3.Ejb3Deployment.processEJBContainerMetadata(Ejb3Deployment.java:415)

              at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:523)

              at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:194)

               

              I tried using mapped-name instead of jndi-name in the resource-ref, but no difference.

               

              My ejb-jar.xml is here. I tried adding a mapped-name tag to the session tag, but same exception.

               

               

              It looks like mapped-name only works if I add it to the annotation. Is this intentional? Where should I expect to be able to set the mapped-name in XML?

              • 4. Re: Set up mapped name in XML
                gvalenc Newbie

                Sorry, wasn't sure how to use this wiki thing. Here is the edited jboss.xml again:

                 

                {code:xml}

                <?xml version="1.0"?>
                <jboss xmlns:xs="http://www.jboss.org/j2ee/schema" xs:schemaLocation="http://www.jboss.org/j2ee/schema jboss_5_0.xsd"
                       version="5.0">
                   <enterprise-beans>
                      <session>
                         <ejb-name>****</ejb-name>
                         <jndi-name>****Remote</jndi-name>
                         <local-jndi-name>****Local</local-jndi-name>
                         <!-- JMS resources -->
                         <resource-ref>
                            <res-ref-name>****CF</res-ref-name>
                            <jndi-name>java:/JmsXA</jndi-name>
                         </resource-ref>
                      </session>
                   </enterprise-beans>
                </jboss>

                <?xml version="1.0"?>

                <jboss xmlns:xs="http://www.jboss.org/j2ee/schema" xs:schemaLocation="http://www.jboss.org/j2ee/schema jboss_5_0.xsd"

                       version="5.0">

                   <enterprise-beans>

                      <session>

                         <ejb-name>****</ejb-name>

                         <jndi-name>****Remote</jndi-name>

                         <local-jndi-name>****Local</local-jndi-name>

                         <!-- JMS resources -->

                         <resource-ref>

                            <res-ref-name>****CF</res-ref-name>

                            <jndi-name>java:/JmsXA</jndi-name>

                         </resource-ref>

                      </session>

                   </enterprise-beans>

                </jboss>

                {code}

                 

                And edited ejb-jar.xml:

                 

                {code:xml}

                <?xml version="1.0" encoding="UTF-8"?>

                <ejb-jar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee"

                         xmlns:ejb="http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"

                         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"

                         version="3.0">

                 

                   <description>****</description>

                   <display-name>****</display-name>

                      <enterprise-beans>

                         <session>

                            <ejb-name>****</ejb-name>

                            <ejb-class>****Bean</ejb-class>

                         </session>

                      </enterprise-beans>

                </ejb-jar>

                {code}

                • 5. Re: Set up mapped name in XML
                  gvalenc Newbie

                  Just tried with 5.1.0 GA and got basically the same:

                   

                   

                  10:52:38,156 ERROR [AbstractKernelController] Error installing to Real: name=vfszip:/C:/jboss-5.1.0.GA/server/default/deploy/RES.ear/ state=PreReal mode=Manual requiredState=Real
                  org.jboss.deployers.spi.DeploymentException: Error deploying res_director.jar: Exception while processing container metadata for EJB: RESDirectorBean in unit: res_director.jar
                  at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:196)
                  at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:99)
                  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:1631)
                  at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
                  at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
                  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:702)
                  at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
                  at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
                  at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
                  at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:361)
                  at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
                  at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
                  at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
                  at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
                  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.system.server.profileservice.repository.AbstractProfileService.activateProfile(AbstractProfileService.java:306)
                  at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:271)
                  at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
                  at org.jboss.Main.boot(Main.java:221)
                  at org.jboss.Main$1.run(Main.java:556)
                  at java.lang.Thread.run(Thread.java:811)
                  Caused by:
                  java.lang.Exception: Exception while processing container metadata for EJB: RESDirectorBean in unit: res_director.jar
                  at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:549)
                  at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:189)
                  ... 34 more
                  Caused by:
                  java.lang.RuntimeException: mapped-name is required for jms/res/DirectorCF of deployment RESDirectorBean
                  at org.jboss.injection.ResourceHandler.loadXmlResourceRefs(ResourceHandler.java:178)
                  at org.jboss.injection.ResourceHandler.loadXml(ResourceHandler.java:335)
                  at org.jboss.ejb3.EJBContainer.processMetadata(EJBContainer.java:588)
                  at org.jboss.ejb3.Ejb3Deployment.processEJBContainerMetadata(Ejb3Deployment.java:418)
                  at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:527)
                  ... 35 more

                  10:52:38,156 ERROR [AbstractKernelController] Error installing to Real: name=vfszip:/C:/jboss-5.1.0.GA/server/default/deploy/***.ear/ state=PreReal mode=Manual requiredState=Real

                  org.jboss.deployers.spi.DeploymentException: Error deploying ****.jar: Exception while processing container metadata for EJB: ****Bean in unit: ****.jar

                  at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:196)

                  at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:99)

                  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:1631)

                  at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)

                  at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)

                  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:702)

                  at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)

                  at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)

                  at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)

                  at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:361)

                  at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)

                  at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)

                  at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)

                  at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)

                  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.system.server.profileservice.repository.AbstractProfileService.activateProfile(AbstractProfileService.java:306)

                  at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:271)

                  at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)

                  at org.jboss.Main.boot(Main.java:221)

                  at org.jboss.Main$1.run(Main.java:556)

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

                  Caused by:

                  java.lang.Exception: Exception while processing container metadata for EJB: ****Bean in unit: ****.jar

                  at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:549)

                  at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:189)

                  ... 34 more

                  Caused by:

                  java.lang.RuntimeException: mapped-name is required for ****CF of deployment ****Bean

                  at org.jboss.injection.ResourceHandler.loadXmlResourceRefs(ResourceHandler.java:178)

                  at org.jboss.injection.ResourceHandler.loadXml(ResourceHandler.java:335)

                  at org.jboss.ejb3.EJBContainer.processMetadata(EJBContainer.java:588)

                  at org.jboss.ejb3.Ejb3Deployment.processEJBContainerMetadata(Ejb3Deployment.java:418)

                  at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:527)

                  ... 35 more

                  • 6. Re: Set up mapped name in XML
                    jaikiran pai Master

                    Hmm, that should have worked (assuming that the ejb-name in the ejb-jar.xml, jboss.xml and the bean class name all match). Try this in the jboss.xml - instead of jndi-name, try using mapped-name:

                     

                    <mapped-name>java:/JmsXA</mapped-name>

                    1 of 1 people found this helpful
                    • 7. Re: Set up mapped name in XML
                      gvalenc Newbie

                      I checked the bean name in all 3, and there was a discrepancy. They all match now, but I still get the exception with mapped-name for a queue. Should I be using a resource-ref for a JMS Destination? It's not complaining about a resource-ref for a JMS Connection Factory which appears before the queue one, so I guess the CF entry is being successfully processed?

                       

                      {code:xml}

                               <resource-ref>

                                  <res-ref-name>abc/MyCF</res-ref-name>

                                  <mapped-name>java:/JmsXA</mapped-name>

                               </resource-ref>

                      <resource-ref>
                                  <res-ref-name>res/ReceiverQueue</res-ref-name>
                                  <mapped-name>/vbr/res/jms/ReceiverQueue</mapped-name>
                               </resource-ref>

                               <resource-ref>

                                  <res-ref-name>abc/MyQueue</res-ref-name>

                                  <mapped-name>/123/abc/jms/MyQueue</mapped-name>

                               </resource-ref>

                      {code}

                      • 8. Re: Set up mapped name in XML
                        gvalenc Newbie

                        Yep, I needed to use resource-env-ref for the queue. Here's the jboss.xml that works:

                         

                        {code:xml}

                        <?xml version="1.0"?>
                        <jboss xmlns:xs="http://www.jboss.org/j2ee/schema" xs:schemaLocation="http://www.jboss.org/j2ee/schema jboss_5_0.xsd"
                               version="5.0">
                            
                           <enterprise-beans>
                              <session>
                                 <ejb-name>RESDirector</ejb-name>
                                 <jndi-name>vbr/res/remote/IRESDirector</jndi-name>
                                 <local-jndi-name>vbr/res/local/IRESDirector</local-jndi-name>
                                 <!-- JMS resources. Using JmsXA to support transacted JMS. -->
                                 <resource-ref>
                                    <res-ref-name>res/DirectorCF</res-ref-name>
                                    <mapped-name>java:/JmsXA</mapped-name>
                                 </resource-ref>
                                 <resource-env-ref>
                                    <resource-env-ref-name>res/ReceiverQueue</resource-env-ref-name>
                                    <mapped-name>/vbr/res/jms/ReceiverQueue</mapped-name>
                                 </resource-env-ref>
                                 <resource-env-ref>
                                    <resource-env-ref-name>res/RESDLQ</resource-env-ref-name>
                                    <mapped-name>/vbr/res/jms/RESDLQ</mapped-name>
                                 </resource-env-ref>
                              </session>
                           </enterprise-beans>
                        </jboss>

                        <?xml version="1.0"?>

                        <jboss xmlns:xs="http://www.jboss.org/j2ee/schema" xs:schemaLocation="http://www.jboss.org/j2ee/schema jboss_5_0.xsd"

                               version="5.0">

                         

                           <enterprise-beans>

                              <session>

                                 <ejb-name>ABCBean</ejb-name>

                                 <jndi-name>123/abc/remote/IABCBean</jndi-name>

                                 <local-jndi-name>123/abc/local/IABCBean</local-jndi-name>

                                 <!-- JMS resources. Using JmsXA to support transacted JMS. -->

                                 <resource-ref>

                                    <res-ref-name>abc/MyCF</res-ref-name>

                                    <mapped-name>java:/JmsXA</mapped-name>

                                 </resource-ref>

                                 <resource-env-ref>

                                    <resource-env-ref-name>abc/MyQueue</resource-env-ref-name>

                                    <mapped-name>/123/abc/jms/MyQueue</mapped-name>

                                 </resource-env-ref>

                                 <resource-env-ref>

                                    <resource-env-ref-name>abc/ABCDLQ</resource-env-ref-name>

                                    <mapped-name>/123/abc/jms/ABCDLQ</mapped-name>

                                 </resource-env-ref>

                              </session>

                           </enterprise-beans>

                        </jboss>

                        {code}

                         

                        And corresonding ejb-jar.xml:

                         

                        {code:xml}

                         

                        <?xml version="1.0" encoding="UTF-8"?>

                        <ejb-jar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee"

                                 xmlns:ejb="http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"

                                 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"

                                 version="3.0">

                         

                           <description>ABC Bean</description>

                           <display-name>ABC Bean</display-name>

                              <enterprise-beans>

                                 <session>

                                    <ejb-name>ABCBean</ejb-name>

                                    <ejb-class>com.test.ABCBean</ejb-class>

                                 </session>

                              </enterprise-beans>

                        </ejb-jar>

                        {code}

                         

                         

                        Thanks for the help!

                         

                        BTW, since I now moved to JBoss 5.1, would updating the XSD to the 5_1.xsd tie me to that particular version of JBoss? Would it be safe to stay with 5_0.xsd?

                        • 9. Re: Set up mapped name in XML
                          ngermain Newbie

                          May we use instead a message-destination-ref to inject Topic and Queue.

                          In my Java code, i use minimal injection using local references in my JmsEventDispatcherBean with name attribute :

                           

                           

                            @Resource(name = "jms/local-ref-connection-factory")

                            private ConnectionFactory _connectionFactory;

                           

                            @Resource(name = "jms/queue/local-ref-demo-queue")

                            private Queue _queue;

                           

                            @Resource(name = "jms/queue/local-ref-demo-topic")

                            private Topic _topic;

                           

                           

                          I do not declare any ejb-jar.xml, but I specify bindings in jboss.xml :

                           

                          <jboss>

                           

                            <enterprise-beans>

                           

                              <session>

                                <ejb-name>JmsEventDispatcherBean</ejb-name>

                           

                                <!-- Bind the local connection factory reference to XA connection factory -->

                                <resource-ref>

                                  <res-ref-name>jms/local-ref-connection-factory</res-ref-name>

                                  <res-type>javax.jms.XAConnectionFactory</res-type>

                                  <jndi-name>java:/JmsXA</jndi-name>

                                </resource-ref>

                           

                                <!-- Bind the local queue reference to jndi name -->

                                <message-destination-ref>

                                  <message-destination-ref-name>jms/queue/local-ref-demo-queue</message-destination-ref-name>

                                  <jndi-name>jms/queue/public-jndi-demo-queue</jndi-name>

                                </message-destination-ref>

                           

                                <!-- Bind the local topic reference to jndi name -->

                                <message-destination-ref>

                                  <message-destination-ref-name>jms/topic/local-ref-demo-topic</message-destination-ref-name>

                                  <jndi-name>jms/queue/public-jndi-demo-topic</jndi-name>

                                </message-destination-ref>

                           

                              </session>

                           

                            </enterprise-beans>

                           

                          </jboss>