0 Replies Latest reply on Nov 15, 2010 3:54 PM by Mark McMillan

    Getting NameAlreadyBoundException on EJB reference

    Mark McMillan Newbie

      Using 5.0.1 GA, trying to deploy a set of modules originally developed for WebLogic. I have created jboss.xml files for each module, but when I deploy them EJB references seem to cause NameAlreadyBoundException. I don't understand how this can be, a reference is not supposed to create a JNDI binding, just a reference to it. The log shows the following sequence:

       

      15:00:22,823 INFO  [EjbDeployer] installing bean: ejb/frapi.jar#ResultRequestRegistry,uid11872289
      15:00:22,823 INFO  [EjbDeployer]   with dependencies:
      15:00:22,823 INFO  [EjbDeployer]   and supplies:
      15:00:22,823 INFO  [EjbDeployer]        jndi:local/ResultRequestRegistry@12541377
      15:00:22,823 INFO  [EjbDeployer]        jndi:ResultRequestRegistry

      ...

      15:00:28,120 INFO  [EjbModule] Deploying ResultRequestRegistry

      ...

      15:00:30,808 ERROR [AbstractKernelController] Error installing to Start: name=jboss.j2ee:jndiName=ejb/com/engineous/system/sdk/frapi/ejb/ACSResultRetrieverHome,service=EJB state=Create mode=Manual requiredState=Installed
      javax.naming.NameAlreadyBoundException: ResultRequestRegistry
              at org.jnp.server.NamingServer.bind(NamingServer.java:209)
              at org.jnp.server.NamingServer.bind(NamingServer.java:167)
              at org.jnp.server.NamingServer.bind(NamingServer.java:167)
              at org.jnp.interfaces.NamingContext.bind(NamingContext.java:650)
              at org.jnp.interfaces.NamingContext.bind(NamingContext.java:611)
              at org.jboss.util.naming.Util.bind(Util.java:105)
              at org.jboss.util.naming.Util.bind(Util.java:91)
              at org.jboss.ejb.Container.setupEnvironment(Container.java:1276)
              at org.jboss.ejb.Container.startService(Container.java:901)
              at org.jboss.ejb.SessionContainer.startService(SessionContainer.java:396)

      ...

       

      The JBOSS.XML for this module is:

       

      <?xml version="1.0" encoding="UTF-8"?>
      <jboss>   
      <enterprise-beans>
        <entity>
          <ejb-name>ResultRequestRegistry</ejb-name>
          <resource-ref>
            <res-ref-name>Data</res-ref-name>
            <resource-name>fiper/jdbc/XADataSource</resource-name>
          </resource-ref>
          <ejb-ref>
            <ejb-ref-name>ejb/Job</ejb-ref-name>
            <jndi-name>Job</jndi-name>
          </ejb-ref>
          <local-jndi-name>ejb/com/engineous/system/sdk/frapi/ejb/ResultRequestRegistryLocalHome</local-jndi-name>
        </entity>
       
        <session>
          <ejb-name>FRAPIMessageCannon</ejb-name>
          <resource-ref>
             <res-ref-name>fiperTCF</res-ref-name>
             <resource-name>fiper/jms/connectionfactory</resource-name>
          </resource-ref>
          <local-jndi-name>ejb/com/engineous/system/sdk/frapi/ejb/FRAPIMessageCannonLocalHome</local-jndi-name>
        </session>
          
        <session>
          <ejb-name>ACSResultRetriever</ejb-name>
          <resource-ref>
            <res-ref-name>XAData</res-ref-name>
            <resource-name>fiper/jdbc/XADataSource</resource-name>
          </resource-ref>
          <resource-ref>
            <res-ref-name>NonXAData</res-ref-name>
            <resource-name>fiper/jdbc/nonXADataSource</resource-name>
          </resource-ref>
          <resource-ref>
            <res-ref-name>fiperTCF</res-ref-name>
            <resource-name>fiper/jms/connectionfactory</resource-name>
          </resource-ref>
          <ejb-ref>
            <ejb-ref-name>ejb/ResultRequestRegistry</ejb-ref-name>
            <jndi-name>ejb/com/engineous/system/sdk/frapi/ejb/ResultRequestRegistryLocalHome</jndi-name>   
          </ejb-ref>
          <ejb-ref>
            <ejb-ref-name>ejb/ManageACL</ejb-ref-name>
            <jndi-name>ManageACL</jndi-name>
          </ejb-ref>
          <jndi-name>ejb/com/engineous/system/sdk/frapi/ejb/ACSResultRetrieverHome</jndi-name>
          <local-jndi-name>ejb/com/engineous/system/sdk/frapi/ejb/ACSResultRetrieverLocalHome</local-jndi-name>
        </session>
      </enterprise-beans>
      </jboss>

       

      Note that the failure is on the ACSResultRetriever in processing of the <ejb-ref> (this error goes away if I comment out this reference).

       

      Maybe I am misunderstanding something basic, but the <ejb-ref> is supposed to define a reference to an EJB - how can that cause a NameAlreadyBoundException?

       

      Any help or thoughts on this would be most welcome!