Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java Open Source > Apache Tomcat
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Apache Tomcat General 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 .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old August 9th, 2005, 07:45 AM
Authorized User
 
Join Date: Apr 2005
Location: , , India.
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Default Naming Exception in Tomcat5.x

Hi,

I am trying to lookup Database object using JNDI and have the following error.

javax.naming.NameNotFoundException: Name java:comp is not bound in
this Context



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");


The last line throws the error mentioned above.

Still it throws the NameNotFoundException.

Please advise.

eNJay.
Reply With Quote
  #2 (permalink)  
Old August 9th, 2005, 06:07 PM
Friend of Wrox
 
Join Date: Jul 2004
Location: , , .
Posts: 204
Thanks: 0
Thanked 0 Times in 0 Posts
Default

initCtx.looup, dont you mean
initCtx.lookup :-)

Reply With Quote
  #3 (permalink)  
Old August 9th, 2005, 06:16 PM
Friend of Wrox
 
Join Date: Jul 2004
Location: , , .
Posts: 204
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If this was a typo in your post, then have a look at the tomcat documentation, it has the best tutorial on jndi ive found, quite short, wont take long to check what youve done.

Reply With Quote
  #4 (permalink)  
Old August 12th, 2005, 06:55 AM
Authorized User
 
Join Date: Apr 2005
Location: , , India.
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Thank you for the reply.

Sorry for the typo.

I found that useNaming was set to false in xml file of the context. Setting it to True has resolved the issue.

Regards,
eNJay
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Configuring tomcat5.0 with IIS 5.1 skiiqbal Apache Tomcat 1 June 25th, 2006 08:51 AM
puzzled with tomcat5.5.9 Edward King Apache Tomcat 1 September 21st, 2005 03:00 AM
Why Tomcat5.5.9 can't work? Edward King Apache Tomcat 1 August 12th, 2005 07:03 AM
Tomcat3.3.2 to Tomcat5.0.24 amith_pj Apache Tomcat 2 July 10th, 2005 05:23 AM
Tomcat3.3.2 to Tomcat5.0.24 amith_pj Servlets 1 August 11th, 2004 02:12 AM



All times are GMT -4. The time now is 07:00 PM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.