geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Miguel A Paraz <>
Subject JNDI for DataSources (was Re: unknown or ambigous connectionFactory)
Date Fri, 19 Aug 2005 15:22:55 GMT
On 8/19/05, IƱigo <> wrote:
> Ups, that's very true. Now the web application is deployed, but when I
> access the servlet I get a javax.Naming.NameNotFoundException:MySQL in
> the lookup. If the resource-link in geronimo-web.xml is MySQL, then the
> lookup should be java:comp/env/jdbc/MySQL, isn't it?

No, the JNDI lookup should be java:/comp/env/ + reference name, in
your case java:/comp/env/jdbc/DataSource

> Well, let's see if I have understood this, the resource-link in
> geronimo-web.xml should be the same as the value of atribute name in
> mysql-plan.xml?, or they aren't related at all and I haven't understood
> anything ;-)

Well, it's standard J2EE anyway and is defined somewhere :) that the
JNDI name is present only in the app-specific descriptor (such as
geronimo-web.xml), that descriptor is repeated in the local reference
web.xml, then programmatic JNDI access must use the local reference.

I got bitten here too when porting some code from JBoss. JBoss allows
a full java:/DataSource JNDI reference in code.

Here's a full discussion:

View raw message