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?
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]