1 Reply Latest reply on Feb 24, 2003 6:34 PM by Joey Levi

    resource-ref not working in 3.2.0RC1 or 3.0.4

    Joey Levi Newbie

      Hello,

      I am attempting to map a datasource reference to the EJBs ENC. I have this in my ejb-jar.xml file:

      <resource-ref>
      <res-ref-name>jdbc/OrderDS</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>

      I have this in my jboss.xml file:


      <enterprise-beans>

      <ejb-name>HelloEJB</ejb-name>
      <jndi-name>HelloHome</jndi-name>
      <resource-ref>
      <res-ref-name>jdbc/OrderDS</res-ref-name>
      <resource-name>jdbc/EstoreXADB</resource-name>
      </resource-ref>

      </enterprise-beans>


      When I deploy the EJB to jBoss, jBoss links "java:com/env/jdbc/OrderDS" to "java:DefaultDS", not to my deployed datasource. If I remove the DefaultDS config file, then jBoss doesn't link my reference to anything. The DataSources look as though they are deployed when I check out the JNDI view in jmx-console. There are no exceptions in the jBoss startup either.

      Is this a bug with the software or simply a misconfiguration issue? What I have done is pretty straight-forward and works on other application servers.

      Oh yeah, I have also attempted to put "java:/jdbc/EstoreXADB" as the resource-name tag in jboss.xml.

      Thanks for any help!

      Joey

        • 1. Re: resource-ref not working in 3.2.0RC1 or 3.0.4
          Joey Levi Newbie

          Okay, I figured out the problem. I found some code out on the web that sets up a resource ref for a datasource in jBoss. I had to add the following to my jboss.xml file:



          <enterprise-beans>

          <ejb-name>HelloEJB</ejb-name>
          <jndi-name>HelloHome</jndi-name>
          <resource-ref>
          <res-ref-name>jdbc/OrderDS</res-ref-name>
          <resource-name>jdbc/EstoreXADB</resource-name>
          </resource-ref>

          </enterprise-beans>

          <resource-managers>
          <resource-manager res-class="javax.sql.DataSource">
          <res-name>jdbc/EstoreXADB</res-name>
          <res-jndi-name>java:/jdbc/EstoreXADB</res-jndi-name>
          </resource-manager>
          </resource-managers>



          So the resource-managers tag is the key.

          Joey