You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Phil Wilson <p....@bath.ac.uk> on 2006/03/09 12:08:28 UTC

Context-specific datasources

Hello,

Much like the recent "Testing DataSourceRealms" thread[1], I'm trying to set up a web
application with the authentication specified in the application's <Context .. > section,
using a MemoryUserDatabase.

In my web.xml I have:

    <resource-env-ref>
      <resource-env-ref-name>UserDatabase</resource-env-ref-name>
      <resource-env-ref-type>
        org.apache.catalina.UserDatabase
      </resource-env-ref-type>
    </resource-env-ref>

In my server.xml I have:

<Context path="/myapp" docBase="C:/myapp" privileged="true">

    <Resource name="UserDatabase" auth="Container"
      type="org.apache.catalina.UserDatabase"
      factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
      pathname="conf/tomcat-users.xml" />

    <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
dataSourceName="UserDatabase"/>

</Context>


When I move the Resource into <GlobalNamingResources> and the Realm into the <Engine> it
works perfectly, so what am I missing?

Any help gratefully appreciated.

Thanks,

Phil Wilson

#1 http://marc.theaimsgroup.com/?t=114142775300001&r=1&w=2

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