You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Scott Dunbar <sc...@xigole.com> on 2003/01/17 23:55:01 UTC

DataSourceRealm and virtual hosts confusion

Hello,
I'm attempting to set up a DataSourceRealm within a virtual host.  What 
I would like to do is have every virtual host have it's own DataSource 
and have a "private" realm within the virtual host.  In this way each 
virtual host owner can manage their own users in a set of DB tables that 
they control.  I'm using the DataSourceRealm as opposed to the JDBCRealm 
because I had already set up the JNDI DataSource so I figured it would 
be easier to use it.

What I have discovered is that the realm within the virtual host *must* 
use a globally defined JNDI datasource.  If I try to use the  JNDI 
resource defined within the virtual host section I get a message telling 
me that "java" is not defined in the global namespace (a problem some 
other folks seem to have had).

My question is, am I misunderstanding something?  My JNDI based 
DataSource within the virtual host can be used within my code with no 
problem.  But either the DataSourceRealm is getting loaded before the 
JNDI resource and so it can't find the DataSource or it isn't using the 
correct scoping when looking up the JNDI DataSource.  I notice that the 
code in the DataSourceRealm.open() doesn't lookup the datasource the 
same way I do in my code.

Any help would be greatly appreciated.

-- 
scott dunbar                                    xigole systems, inc.
scott@xigole.com                                superior, co



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>