I mis-typed to Struts version we are using.  It is 2.0.11.1.

I looked at the code history and interestingly enough, this fix does not appear 
to be in any 2.0.x release, including the latest 2.0.7 from 11/15/08.

However, the fix is included in release 2.1.0 from 10/15/07.

Does anyone have experience using an xWork version 2.1.x with Struts 2.0.11.1?

Thank you!
Ken


-----Original Message-----
From: Hoying, Ken [mailto:ken_hoy...@premierinc.com]
Sent: Wednesday, July 22, 2009 12:47 PM
To: user@struts.apache.org
Subject: Upgrading xWork??

We are running with Struts 2.0.1.1 (which uses xWork 2.0.4) and are noticing 
that we are getting hung threads sometimes on a HashMap call from 
com.opensymphony.xwork2.util.LocalizedTextUtil.

It looks like the xWork code is question needs to be synchronized and is 
causing the threads to lock due to corruption in the HashMap.  The problem code 
from xWork 2.0.4 is:

private static MessageFormat buildMessageFormat(String pattern, Locale locale) {
        MessageFormatKey key = new MessageFormatKey(pattern, locale);
        MessageFormat format = (MessageFormat) messageFormats.get(key);
        if (format == null) {
            format = new MessageFormat(pattern);
            format.setLocale(locale);
            format.applyPattern(pattern);
            messageFormats.put(key, format);
        }

        return format;
    }

I noticed that in later version of xWork this appears to have been fixed by the 
following change:

private static MessageFormat buildMessageFormat(String pattern, Locale locale) {
             MessageFormatKey key = new MessageFormatKey(pattern, locale);
             MessageFormat format = null;
             synchronized(messageFormats) {
                 format = (MessageFormat) messageFormats.get(key);
                 if (format == null) {
                     format = new MessageFormat(pattern);
                     format.setLocale(locale);
                     format.applyPattern(pattern);
                     messageFormats.put(key, format);
                 }
             }

             return format;
         }



So my question is, has anyone attempted to upgrade the xWork library to a later 
version in Struts 2.0.1.1?  And if so, what version did you use and what was 
your experience?

Thank you in advance!
Ken



-----------------------------------------
***Note:The information contained in this message may be privileged and 
confidential and protected from disclosure. If the reader of this message is 
not the intended recipient, or an employee or agent responsible for delivering 
this message to the intended recipient, you are hereby notified that any 
dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the Sender immediately by replying to the message and deleting it from your 
computer.  Thank you.  Premier Inc.

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

Reply via email to