geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <>
Subject Re: JNDI context
Date Mon, 04 May 2009 23:08:13 GMT
This is a user list question.  If you have further questions on this  
subject pleas ask there and only there.
On May 4, 2009, at 8:19 AM, govinda wrote:

> How do I connect to a datasource thru code without context  
> "java:comp/env"
> Context envContext  = (Context)initContext.lookup("java:comp/env");
> I just want to connect to DB like this
> DataSource ds = (DataSource)initContext.lookup("jdbc/LiferayPool");

Any such jndi name is going to be container specific.  The java:comp/  
stuff is there specifically so you can use the same jndi name in every  
container, so you don't have to recompile your app for every container.

For information on the geronimo absolute jndi names, see

Basically what you should do is deploy your datasource, restart  
geronimo, and look in var/log/geronimo.log for the log message telling  
you what the jndi location is.

> Is it possible, if so where do I specify java jndi context  
> ("java:comp/env")
> outside the code?

As far as I understand what you are asking for in this sentence, it is  
not possible.

david jencks
> Thanks
> -- 
> View this message in context:
> Sent from the Apache Geronimo - Dev mailing list archive at  

View raw message