On 29/01/2021 08:49, Karim Kanso wrote:
> I have been trying to create a context xml file for a webapp so that
> it encapsulates all needed server side configuration for
> authentication to work. That is, it contains both the <Realm> and
> <Resource> elements.
> 
> I dont understand why the following definition of a context does not
> work (although does work when the <Resource> element is moved into
> server.xml):
> 
> $ cat conf/Catalina/localhost/tomcatapp.xml
> <?xml version="1.0" encoding="UTF-8"?>
> <Context>
>  <Resource
>      name="MyUserDatabase"
>      auth="Container"
>      type="org.apache.catalina.UserDatabase"
>      factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
>      pathname="conf/myapp-users.xml"
>      />
>  <Realm
>      className="org.apache.catalina.realm.UserDatabaseRealm"
>      resourceName="MyUserDatabase"
>      />
> </Context>
> 
> This gives the error:
> 
> javax.naming.NameNotFoundException: Name [MyUserDatabase] is not bound
> in this Context. Unable to find [MyUserDatabase].
> 
> The documentation shows that the <Resource> element is valid within a
> <Context>. Is it possible to do this?

http://tomcat.apache.org/tomcat-9.0-doc/config/realm.html

Search for "localDataSource"

Mark

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

Reply via email to