wood burning stoves 2.0*
The moose likes JBoss/WildFly and the fly likes cant i look up datasource connection using environment variables Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "cant i look up datasource connection using environment variables" Watch "cant i look up datasource connection using environment variables" New topic
Author

cant i look up datasource connection using environment variables

maha laxmi
Ranch Hand

Joined: Sep 23, 2005
Posts: 68
as i said in my previous post we are migrating from oracle app server to jboss4.0.3;

in the existing beans(EJB) we used to look up for datasource connection ctx.lookUp("java:comp/env/jdbc/DB");

when i deploy existing ejb's in jboss i am getting NamingnotFound Exception when i look up datasource connection;but when i look up like this ctx.lookUp("java:jdbc/DB");i am getting database connection.

in oracle-ds.xml i mentioned JNDI name as jdbc/DB;

in jboss.xml also i metioned <res-ref-name>jdbc/DB</res-ref-name>
<resource-name>jdbc/DB</resource-name>

in all our existing beans we used look up ctx.lookUp("java:comp/env/jdbc/DB") like this;

should i change all beans to like this ctx.lookUp("java:jdbc/DB");
 
 
subject: cant i look up datasource connection using environment variables
 
Similar Threads
JBOSS connection pooling
how to connect different datasources using multiple datasource using ENC
how to connect multiple datasource using ENC in jboss
struts 1.3 Data base connection pool
Spring Hibernate JNDI look up question?