• 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

JNDI lookup problem, this is a nightmare....

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello i am new to JNDI so i am really dadly confused about it.

I am using WebSphere 6.0(local running in Rational Software Architect), to test a Oracle 10g DB(Remote) connection. to do that I made a servlet that when i start it try to connect and send an insert and a select to the DB

my problem.

I configured the DS in WebSphere in

JDBC providers > Oracle JDBC Driver > Data sources

This is my DS
Name JNDI name Description
TEST_DS jdbc/TEST_DS New JDBC Datasource

it's working because I tested with the built-in WebSphere AS tester.

but I can't get my Servlet to Lookup this DS, I have been trying for more than 10 hours, i would really like some help, I've read every Tutorial online but nothing can help me.

Deployment descriptor.


this is the last attemp to make it work.
Code of Servlet


my error



Is there anything else to config to make this thing work ?
I am going mad here, because there is no way to make it work...

[ November 17, 2008: Message edited by: Cristiano Fontes ]

[ November 17, 2008: Message edited by: Cristiano Fontes ]

[ November 17, 2008: Message edited by: Cristiano Fontes ]
[ November 17, 2008: Message edited by: Cristiano Fontes ]
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I think you are missing a (WebSphere) specific deployment descriptor where you map the resource TEST_DS with an object in the JNDI tree using a jndi-name.

Try looking it up directly from the global JNDI instead of the web-application's ENC. Try this:

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I could solve this issue by just writing "TESTDS" as my data source and the runtime data source claases were appending the java:conv/env by itself.
reply
    Bookmark Topic Watch Topic
  • New Topic