Apache TomcatGeneral discussion of the Apache Tomcat servlet container. For discussions specific to the Professional Apache Tomcat book, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Apache Tomcat section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
I am trying to lookup Database object using JNDI and have the following error.
javax.naming.NameNotFoundException: Name java:comp is not bound in
I have configured DataSource in the context and I can see that listed in xml file of my application context( the file in /conf/localhost directory). I have added resource reference in web.xml of my application.
I have used the following code im my servlet
Context initCtx = new IntialContext();
Context envCtx = (Context)initCtx.looup("java:comp/env");