• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • 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