tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mikolaj Rydzewski <m...@ceti.pl>
Subject How to access JNDI resources on Tomcat level
Date Thu, 25 Sep 2008 15:46:18 GMT
Hi all,

I'm using Tomcat 5.5 with JNDI DataSources. It works with no problem.

Now, I want to setup Josso single sign on system (www.josso.org) and 
force it to use JNDI DataSources as well. With no luck.

Problem lies (I suppose), that josso system is not only a webapp, but 
also a Tomcat's Valve and Realm. If one want to expose JNDI resource to 
a webapp he needs to use ResourceLink in context.xml and resource-ref in 
web.xml. How can I expose such JNDI resource to Valve and Realm?

Josso code simply calls

InitialContext ic = new InitialContext();
_datasource = (DataSource) ic.lookup( _dsJndiName );

to obtain reference.

I have tried to use jdbc/db (that's my resource name defined in global 
resources in server.xml), java:jdbc/db or java:comp/env/jdbc/db with no 
luck. The same error message "Error During Lookup Name jdbc is not bound 
in this Context" every time.

So - is there any 'special' way to obtain reference to JNDI resources 
from within a Realm?

-- 
Mikolaj Rydzewski <miki@ceti.pl>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message