-
1. Re: Decouple coded name from JNDI-Name (JBoss3.0 / Postgres)
tbfmicke Jul 14, 2002 7:06 PM (in response to stefankuhn)Do something like this in your ejb-jar.xml.
<ejb-name>YourEJBName</ejb-name>
..........
<resource-ref>
DataSource for Contacts
<res-ref-name>jdbc/UKontaktDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
And then in the jboss.xml
<?xml version="1.0"?>
<!DOCTYPE jboss PUBLIC
"-//JBoss//DTD JBOSS 3.0//EN"
"http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd">
<enterprise-beans>
<ejb-name>YourEJBName</ejb-name>
<resource-ref>
<res-ref-name>jdbc/UKontaktDB</res-ref-name>
<resource-name>java:/jdbc/UKontakt</resource-name>
</resource-ref>
</enterprise-beans> -
2. Re: Decouple coded name from JNDI-Name (JBoss3.0 / Postgres)
stefankuhn Jul 15, 2002 2:45 PM (in response to stefankuhn)Hej Micke!
(ok i'l continue in english ;-)
Thanks a lot for your help!
Your solution works fine.
After posting my question i tried some other solutions.
This one works too:
No changes wer made in the jboss.xml. This file only gives my session bean an JNDI name as:
<ejb-name>LogInEJB</ejb-name>
<jndi-name>ejb/Login</jndi-name>
In the file ejb-jar.xml you only have to state the JNDI name for the used coded name as ...:
<ejb-name>YourEJBName</ejb-name>
...
<resource-ref>
<res-ref-name>jdbc/UKontaktDB</res-ref-name>
<jndi-name>jdbc/UKontakt</jndi-name> <!-- ... as in this line -->
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
...
Here is a fragment of the postgres-service.xml just in order to make this explanation complete
...
<!--embedded mbean-->
<!-- ========== Set the JndiName ======================= -->
jdbc/UKontakt <!-- The JNDI name used in the ejb-jar.xml! -->
Best regards
Stefan Kühn