[ACCEPTED]-javax.naming.NameNotFoundException: Name jdbc is not bound in this Context-tomcat6
Accepted answer
Your problem is that you need to prefix 2 your jndi string with java:/comp/env
So in 1 your case try:
DataSource ds = (DataSource)envContext.lookup("java:/comp/env/jdbc/myoracle");
That should solve the problem.
I also come across with this problem, but 2 in my case I've fixed by adding bellow line:
<ResourceLink global="jdbc/myoracle" name="jdbc/myoracle" type="oracle.jdbc.pool.OracleDataSource"/>
to 1 tomcat conf file -> context.xml
.
Try just "java:"
(DataSource) context.lookup("java:jdbc/myoracle");
0
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.