tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Salonen, Aki" <Aki.Salo...@wincor-nixdorf.com>
Subject Accessing Tomcat 4.03 JNDI service from LoginModule
Date Fri, 31 May 2002 09:53:00 GMT
Hi!

I'm following problem:

I have JAAS LoginModule that uses JNDI to lookup DataSource object.
My LoginModule and LoginConfiguration implementation classes are located
in Tomcat's classpath. 

I tried first to put JAAS related classes under [TOMCAT-HOME]/common/lib,
but that caused exception:"Unable to load LoginConfiguration".

I'm using JAAS authentication directly from a servlet, so I'm using no
Tomcat realms in authentication.
Servlet just calls:

	LoginContext lc = new LoginContext( jaasApplName,
customUserPasswordCallbackHandler );
	lc.login( );

Everything works fine until LoginModule tries to lookup datasource
after obtaining InitialContext with 

		InitialContext initCtx = new InitialContext( );
		DataSource ds = (javax.sql.DataSource) initCtx.lookup(
dataSourceName );

I got exception with message : "Name MIPCoreDS is not bound in this
context.".

MIPCoreDS is configured in Tomcats configuration file server.xml under
<GlobalNamingResources> tag. 

Should this be visible for JAAS Login module or not?
When servlet's make same lookup under Tomcat, datasource is found fine.
It seems that loginModules have no visibility to JNDI objects configured
under Tomcat. 
Is this right?

Any help is appreciated.

Best Regards,

Aki








--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message