Is the integrated tomcat6 making use of contebnts of web.xml and context.xml
myeclipse Version: 9.1
Build id: 9.1-20110701
I am using Myeclipse Integrated Sandbox Tomcat 6
and I would like to setup a jndi name that can be retrieved as below.
ic = new InitialContext();
//ds = (DataSource) ic.lookup(“java:/MySqlDSBL”);
ds = (DataSource) ic.lookup(“MySqlDSBL”);
Under WebRoot/WEB-INF
I have context.xml
<Resource name=”MySqlDSBL” auth=”Container” type=”javax.sql.DataSource”
maxActive=”100″ maxIdle=”30″ maxWait=”10000″
username=”barry” password=”XX” driverClassName=”com.mysql.jdbc.Driver”
url=”jdbc:mysql://127.0.0.1:3306/mydatabase”/>
I also have web.xml
<resource-ref>
<description>My DB</description>
<res-ref-name>MySqlDSBL</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
I keep getting
javax.naming.NameNotFoundException: Name MySqlDSBL is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
thanks
Barry