Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 15544 invoked from network); 8 Aug 2006 20:22:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Aug 2006 20:22:01 -0000 Received: (qmail 43073 invoked by uid 500); 8 Aug 2006 20:21:49 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 43053 invoked by uid 500); 8 Aug 2006 20:21:49 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 43042 invoked by uid 500); 8 Aug 2006 20:21:49 -0000 Delivered-To: apmail-jakarta-tomcat-user@jakarta.apache.org Received: (qmail 43035 invoked by uid 99); 8 Aug 2006 20:21:49 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Aug 2006 13:21:49 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [204.130.255.172] (HELO mail.integraonline.com) (204.130.255.172) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 08 Aug 2006 13:21:46 -0700 Received: (qmail 7968 invoked by uid 5513); 8 Aug 2006 20:21:23 -0000 Received: from unknown (HELO rd2) (?pbs?jeryl.iat-cti.com@208.46.68.194) by 0 with SMTP; 8 Aug 2006 20:21:23 -0000 From: "Robert Harper" To: "Tomcat Users" Subject: User database and user attributes Date: Tue, 8 Aug 2006 14:26:23 -0600 Message-ID: MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_NextPart_000_0079_01C6BAF6.A0DA73B0" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_NextPart_000_0079_01C6BAF6.A0DA73B0 Content-Type: multipart/alternative; boundary="----=_NextPart_001_007A_01C6BAF6.A0DA73B0" ------=_NextPart_001_007A_01C6BAF6.A0DA73B0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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. ------=_NextPart_001_007A_01C6BAF6.A0DA73B0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

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.

 

------=_NextPart_001_007A_01C6BAF6.A0DA73B0-- ------=_NextPart_000_0079_01C6BAF6.A0DA73B0--