• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help With Connection Pool

 
Ranch Hand
Posts: 240
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello;

I am trying to get a connection pool running in my application. I get the error:

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

Not sure what is going on here. Am I not getting a reference to the datasource in the correct way? Have I configured one of the files wrong? Any tips would be awesome.

Here is all my code.

server.xml (this context appears in the host tag)



Web.xml



Servlet Code:


[ August 24, 2005: Message edited by: Luke Shannon ]
 
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know if it is just a typo, but you have an extra "j" in the URL:



What server (Tomcat?) and version are you running under?

Cheers,
[ August 24, 2005: Message edited by: Tom Blough ]
 
Luke Shannon
Ranch Hand
Posts: 240
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tom;

Testing this under Tomcat 5, but it might have to run in Tomcat 4 (not sure how hard it will be to upgrade the server yet).

I found this tutorial:

http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html

Based on that I made the following changes to my servlet method:




Everything work fine now :-)

Thanks,

Luke
 
You may have just won ten million dollars! Or, maybe a tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic