geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kaupo <>
Subject jndi datasource access problem
Date Mon, 02 Mar 2009 15:30:49 GMT

I have configured a datasource in my application, but i have problems
accessing it when when I connect to my application through a webservice and
try to use it!
I get the following error:
"java.lang.NullPointerException: You have accessed the java:comp jndi
context on a thread that has not initialized it"

The code that is use:
InitialContext ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/MyDataSource");
con = ds.getConnection();

I read here  that one can access the
resources by using the "jca:{groupId}/{artifactId}/{j2eeType}/{name}"
notation, but I'm having a hard time figuring out the j2eeType part.

How do I know what to put instead of j2eeType?
View this message in context:
Sent from the Apache Geronimo - Users mailing list archive at

View raw message