RE: User database and user attributes
Robert S. Harper Information Access Technology, Inc. -Original Message- From: Mikolaj Rydzewski [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 08, 2006 3:25 PM To: Tomcat Users List Subject: Re: User database and user attributes [snip] Use some kind of a database related realm: * http://tomcat.apache.org/tomcat-5.5-doc/realm-howto.html#JDBCRealm * http://tomcat.apache.org/tomcat-5.5-doc/realm-howto.html#DataSourceRealm Memory realm (tomcat-users.xml file) is a very simple one, following documentation: "*MemoryRealm* is a simple demonstration implementation of the Tomcat 5 |Realm| interface. It is not designed for production use." -- Mikolaj Rydzewski <[EMAIL PROTECTED]>http://ceti.pl/~miki/ PGP KeyID: 8b12ab02 There are three kinds of people: men, women and unix. [Robert Harper] I've been using the MBeanServer to access the tomcat-users database but there are not methods for retrieving the group or role for a user. I have been adding users and adding roles and groups to users just fine. The problem is when I have a user and I want to get the group assigned to that user, there is not a method exposed for that. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: User database and user attributes
Robert Harper wrote: I am using the Tomcat user database to hold information for users. What I need to do is retrieve the group a user is in from the database. My problem comes when I have a servlet add a new user, assign it to a roll and a group, then try to access the user from another servlet running in the same context. I often get exceptions thrown when I call the save() method on the user object stating that Tomcat cannot rename the tomcat-users.xml to tomcat-users.xml.old. The user info is still in memory and if enough time passes or the server is stopped, the data eventually gets flushed to disk. There are methods for finding the user, finding a roll, and finding a group, but I don’t see a method for finding a group for a given user using the MBeanServer(). I had been using the XML libraries to load the database and then search through it finding the user then getting the assigned roll but it only works when the new user information is flushed to disk. What would be the best way to do this? Use some kind of a database related realm: * http://tomcat.apache.org/tomcat-5.5-doc/realm-howto.html#JDBCRealm * http://tomcat.apache.org/tomcat-5.5-doc/realm-howto.html#DataSourceRealm Memory realm (tomcat-users.xml file) is a very simple one, following documentation: "*MemoryRealm* is a simple demonstration implementation of the Tomcat 5 |Realm| interface. It is not designed for production use." -- Mikolaj Rydzewski <[EMAIL PROTECTED]>http://ceti.pl/~miki/ PGP KeyID: 8b12ab02 There are three kinds of people: men, women and unix. smime.p7s Description: S/MIME Cryptographic Signature
User database and user attributes
I am using the Tomcat user database to hold information for users. What I need to do is retrieve the group a user is in from the database. My problem comes when I have a servlet add a new user, assign it to a roll and a group, then try to access the user from another servlet running in the same context. I often get exceptions thrown when I call the save() method on the user object stating that Tomcat cannot rename the tomcat-users.xml to tomcat-users.xml.old. The user info is still in memory and if enough time passes or the server is stopped, the data eventually gets flushed to disk. There are methods for finding the user, finding a roll, and finding a group, but I don’t see a method for finding a group for a given user using the MBeanServer(). I had been using the XML libraries to load the database and then search through it finding the user then getting the assigned roll but it only works when the new user information is flushed to disk. What would be the best way to do this? Robert S. Harper Senior Engineer Information Access Technology, Inc. 1100 East 6600 South, Suite 300 Salt Lake City Utah USA 84121-7411 (801)265-8800 Ext. 255 FAX (801)265-8880 This e-mail is intended only for the addressee and may contain confidential and/or privileged information. Any review, retransmission, or action taken upon this information by persons other than the intended recipient is prohibited by law. If you received this communication in error, please contact us immediately at 801-265-8800. Although this e-mail and any attachments are believed to be free of any virus or other defect, it is the responsibility of the recipient to ensure that anything received or opened is virus free. No responsibility is accepted by IAT for any loss or damage in the event that such a virus or defect exists.