• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Name comp/env/jdbc not found in context "java:"

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I am using WSAD 4.0.2. I define a data source in the server jdbc/test that connects to an Oracle DB. What should I do to access this datasource as
"java:comp/env/jdbc/test"?
What ever I do I get the following error
javax.naming.NameNotFoundException: Name comp/env/jdbc not found in context "java:".
but the datasource is available if I access it via the jndi name "jdbc/test"
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have to define a resource reference and map that to the jdbc/test JNDI name you defined the datasource under. Read the EJB spec or Richard Monson-Haefel's book for an explanation of resource references.
Kyle
 
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Heya, resurfacing this thread:
So I saw this and found this info on how to create the resource references in web.xml, but i'm still having problems maybe somebody can help.
Global JNDI lookups works as usual but local is still continuing to fail.
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic