users@glassfish.java.net

The ever-lasting question of JNDI namespace and names ...

From: <glassfish_at_javadesktop.org>
Date: Thu, 01 Nov 2007 18:15:17 PST

Gurus,

I am sure a similar question is asked a million times. But I am confused. Here is the problem.

I am trying to port an application from JBoss to GlassFish. The application has several components
(JSP pages, e.g.) that do a lookup like this (the so-called [i] boiler-plate code[/i]:
[code]
InitialContext ic = new InitialContext();
DataSource ds = (DataSource) ic.lookup([b]"java:/bank"[/b]);
Connection cn = ds.getConnection();
[/code]

Now, my problem is I have never seen a JNDI name like: [b] java:/bank[/b]!

This poses a problem in defining the JDBC-Resource and backing Connection Pool, because I just
can't define a JDBC-Resource with this name. I also tried using resource-ref element and different
mapping in sun-web.xml (which I created anew) of the application, but that didn't help.

Can you help?

Regards,
Kedar
[Message sent by forum member 'km' (km)]

http://forums.java.net/jive/thread.jspa?messageID=243403