rpms/struts11/devel struts-1.1.bz157205.patch, NONE, 1.1 struts11.spec, 1.7, 1.8

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Mon May 9 16:41:08 UTC 2005


Author: gbenson

Update of /cvs/dist/rpms/struts11/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv18974

Modified Files:
	struts11.spec 
Added Files:
	struts-1.1.bz157205.patch 
Log Message:
Work around a classloader issue (#157205)

struts-1.1.bz157205.patch:
 MessageResourcesFactory.java |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

--- NEW FILE struts-1.1.bz157205.patch ---
RequestUtils.applicationClass() uses the context classloader to find
the class, but for some reason it sometimes seems to be set to what
looks like the normal system classloader.  Possibly its something to
do with the fact that MessageResourcesFactory.createFactory() is
called from MessageResources.getMessageResources() which is usually
called from <clinit> methods.  Or, it could be because RequestUtils
itself calls getMessageResources(), so createFactory() reenters
itself.

--- jakarta-struts-1.1-src/src/share/org/apache/struts/util/MessageResourcesFactory.java.orig	2003-06-30 05:51:19.000000000 +0100
+++ jakarta-struts-1.1-src/src/share/org/apache/struts/util/MessageResourcesFactory.java	2005-05-09 13:36:32.000000000 +0100
@@ -188,8 +188,12 @@
 
         // Construct a new instance of the specified factory class
         try {
-            if (clazz == null)
-                clazz = RequestUtils.applicationClass(factoryClass);
+            if (clazz == null) {
+                // XXX should use context class loader but it's wrong
+                ClassLoader classLoader =
+                    MessageResourcesFactory.class.getClassLoader();
+                clazz = classLoader.loadClass(factoryClass);
+            }
             MessageResourcesFactory factory =
                 (MessageResourcesFactory) clazz.newInstance();
             return (factory);


Index: struts11.spec
===================================================================
RCS file: /cvs/dist/rpms/struts11/devel/struts11.spec,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- struts11.spec	6 May 2005 17:03:24 -0000	1.7
+++ struts11.spec	9 May 2005 16:41:06 -0000	1.8
@@ -2,11 +2,11 @@
 %define name		struts11
 %define full_name	jakarta-%{unvname}
 %define version		1.1
-%define release		1jpp_5fc
+%define release		1jpp_6fc
 %define tomcat3appsdir	%{_localstatedir}/tomcat3/webapps
 %define tomcat4appsdir	%{_localstatedir}/lib/tomcat4/webapps
-%define tomcat5appsdir  %{_localstatedir}/lib/tomcat5/webapps
-%define tomcat5ctxdir   %{_sysconfdir}/tomcat5/Catalina/localhost
+%define tomcat5appsdir	%{_localstatedir}/lib/tomcat5/webapps
+%define tomcat5ctxdir	%{_sysconfdir}/tomcat5/Catalina/localhost
 %define section		free
 %define webapps		blank example template-example exercise-taglib upload
 %define webapplibs commons-beanutils commons-digester commons-fileupload commons-validator oro struts
@@ -31,6 +31,7 @@
 Source3:	tomcat5-context-allowlinking.xml
 Patch0:		%{unvname}-%{version}.build.patch
 Patch1:		%{unvname}-%{version}.servlet24.patch
+Patch2:		%{unvname}-%{version}.bz157205.patch
 Url:		http://jakarta.apache.org/%{unvname}
 Requires:	servletapi5
 Requires:	jdbc-stdext
@@ -135,6 +136,7 @@
 %setup -n %{full_name}-%{version}-src -q
 %patch0
 %patch1 -p1
+%patch2 -p1 -b .orig
 # remove all binary libs
 find . -name "*.jar" -exec rm -f {} \;
 
@@ -475,6 +477,9 @@
 
 
 %changelog
+* Mon May  9 2005 Gary Benson <gbenson at redhat.com> - 0:1.1-1jpp_6fc
+- Work around a classloader issue (#157205).
+
 * Fri May  6 2005 Gary Benson <gbenson at redhat.com> - 0:1.1-1jpp_5fc
 - BC-compile.
 




More information about the fedora-cvs-commits mailing list