Hi,
Tomcat-users.xml is a plain file: you can edit it manually or using a
programmatic file I/O API.  Alternatively, you can use JMX to invoke
operations on the MemoryUserDatabase(Factory) classes: for that you code
should be within a privileged context (it's a context attribute) and the
common classloader repository.

Yoav Shapira
Millennium Research Informatics


>-----Original Message-----
>From: Robert Harper [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, June 16, 2004 11:00 AM
>To: Tomcat Users
>Subject: Tomcat UserDatabase
>
>Is there an accepted way for an application to directly
access/manipulate
>the
>tomcat-users.xml database? I would like to automate the process of
adding
>users
>from my servlet but I am having a hard time finding
documentation/samples
>of how
>to do this. It may just be that I don't know how to grant access to
this
>resource to my app. I have added a line like
>
>
>
>grant codeBase
"file:${catalina.home}/webapps/my_appt/WEB-INF/classes/-" {
>
>        permission java.security.AllPermission;
>
>};
>
>
>
>to the catalina.policy file. My code compiles but I get a
>
>
>
>java.lang.NoClassDefFoundError:
org/apache/catalina/realm/UserDatabaseRealm
>
>
>
>error that I assume is due to an access restriction.
>
>
>
>Any ideas? Thanks in advance.
>
>
>
>Robert
>
>




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to