I have a requirement to setup 2 instances of same application (one for live and one for
testing) running on jboss 4.2.3.GA. I don't want to run multiple instances of Jboss
server since it requires changing all the listening ports, so i decided to move the
"hard-coded" actual jndi name from my ejb3 sessionbean (I'm using
@javax.annotation.Resource injection currently), i tried and failed to lookup the
datasource using:
(in sessionbean)
Context ic = new InitialContext();
ds = (DataSource) ic.lookup("java:comp/env/jdbc/ds_name");
(ejb-jar.xml)
<enterprise-beans>
<ejb-name>AdmResourceFacade</ejb-name>
com.tims.ac.service.AdmResourceFacade
<ejb-class>com.tims.ac.service.AdmResourceFacadeImpl</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<resource-ref>
<res-ref-name>jdbc/ds_name</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</enterprise-beans>
(in jboss.xml)
<enterprise-beans>
<ejb-name>AdmResourceFacade</ejb-name>
<resource-ref>
<res-ref-name>jdbc/ds_name</res-ref-name>
<jndi-name>java:/actual_ds_name</jndi-name>
</resource-ref>
</enterprise-beans>
i get javax.naming.NameNotFoundException: jdbc not bound when looking up the datasource,
please help.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4182352#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...