• 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

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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic