You need to map your logical reference in your EJB code to the JNDI name by
making an entry similar to this in jboss.xml:

  <resource-managers>
    <resource-manager>
      <res-jndi-name>OracleDB</res-jndi-name>
      <res-name>jdbc/OracleDB</res-name>
    </resource-manager>
  </resource-managers>

----- Original Message -----
From: "Faisal Ahmad" <[EMAIL PROTECTED]>
To: "JBoss User (E-mail)" <[EMAIL PROTECTED]>
Sent: Wednesday, April 11, 2001 10:24 AM
Subject: [JBoss-user] Resource Reference Method Confusion


> I have a session bean which needs to access the DataSource directly.
> I have defined the datasource as OracleDB in the jboss.jcml and also
> specified OracleDB as the datasource in jboss.xml .
> When the jboss starts it binds this datasource to Java:/OracleDB.
> In my session bean I do a jndi lookup for "java:/OracleDB" and get the
> datasource.
> So thats that, every thing works.
> I dont have to even specify any <resource-ref> elements in ejb-jar.xml
>
> BUT
>
> when I make a <resource-ref> entry in the ejb-jar.xml for the session bean
> like this
>
> <session>
> <resource-ref>
> <res-ref-name>OracleDB</res-ref-name>
> <res-type>javax.sql.DataSource</res-type>
> <res-auth>Container</res-auth>
> </resource-ref>
> :
> :
> </session>
>
> and try to a jndi lookup for the datasource in the bean with
> "java:comp/env/OracleDB"
> instead of getting the OracleDB datasource (or throwing an exception) it
> gives me the DefaultDS.
>
> Am I making a mistake or missing something ?
>
> Thanks
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user
>


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to