[ http://issues.apache.org/struts/browse/STR-723?page=all ] Don Brown closed STR-723: -------------------------
Resolution: Fixed > PropertyMessageResources loading resources from the wrong ClassLoader > --------------------------------------------------------------------- > > Key: STR-723 > URL: http://issues.apache.org/struts/browse/STR-723 > Project: Struts Action 1 > Type: Bug > Components: Action > Versions: 1.1 Beta 1 > Environment: Operating System: other > Platform: All > Reporter: James Farley > Fix For: 1.1 Family > Attachments: PropertyMessageResources.java.diff > > At my company, we have decided to deploy the Struts JAR into Tomcat's shared > classloader (the lib/ directory in the 4.0.x series) due to a number of > classes > that we will be sharing. Everything works fine *except* for the loading of > the > application's resource file. The reason is this: the > PropertyMessageResources > source explicitly attempts to load the resources via the ClassLoader > associated > with the class, not the thread. > This means if your ApplicationResources are deployed in a webapp, but the > struts.jar is in the shared directory, the code will *not* be able to find > the > properties file. The fix is to use the context ClassLoader associated with > the > current thread of execution. This way, the struts.jar will be able to find > the > resources file whether it is deployed in a WAR or is shared globally in an > application server. The patch is attached to the bug. > (As an aside - why does the PropertyMessageResources go through all the > explicit trouble of loading the file itself, when it could just use the > ResourceBundle.getBundle() method?) -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]