Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 681323 Details for
Bug 899268
Port ASF BZ48694 to TC 6.0.24
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
BZ48903.patch
BZ48903.patch (text/plain), 10.48 KB, created by
Jean-Frederic Clere
on 2010-05-19 14:47:23 UTC
(
hide
)
Description:
BZ48903.patch
Filename:
MIME Type:
Creator:
Jean-Frederic Clere
Created:
2010-05-19 14:47:23 UTC
Size:
10.48 KB
patch
obsolete
>--- java/org/apache/catalina/loader/ResourceEntry.java (original) >+++ java/org/apache/catalina/loader/ResourceEntry.java Thu May 6 19:17:49 2010 >@@ -47,7 +47,7 @@ public class ResourceEntry { > /** > * Loaded class. > */ >- public Class loadedClass = null; >+ public volatile Class loadedClass = null; > > > /** > >--- java/org/apache/catalina/loader/WebappClassLoader.java (original) >+++ java/org/apache/catalina/loader/WebappClassLoader.java Thu May 6 19:17:49 2010 >@@ -1432,102 +1432,121 @@ public class WebappClassLoader > * > * @exception ClassNotFoundException if the class was not found > */ >- public Class loadClass(String name, boolean resolve) >+ public synchronized Class loadClass(String name, boolean resolve) > throws ClassNotFoundException { > >- synchronized (name.intern()) { >- if (log.isDebugEnabled()) >- log.debug("loadClass(" + name + ", " + resolve + ")"); >- Class clazz = null; >- >- // Log access to stopped classloader >- if (!started) { >- try { >- throw new IllegalStateException(); >- } catch (IllegalStateException e) { >- log.info(sm.getString("webappClassLoader.stopped", name), e); >- } >+ if (log.isDebugEnabled()) >+ log.debug("loadClass(" + name + ", " + resolve + ")"); >+ Class clazz = null; >+ >+ // Log access to stopped classloader >+ if (!started) { >+ try { >+ throw new IllegalStateException(); >+ } catch (IllegalStateException e) { >+ log.info(sm.getString("webappClassLoader.stopped", name), e); > } >- >- // (0) Check our previously loaded local class cache >- clazz = findLoadedClass0(name); >+ } >+ >+ // (0) Check our previously loaded local class cache >+ clazz = findLoadedClass0(name); >+ if (clazz != null) { >+ if (log.isDebugEnabled()) >+ log.debug(" Returning class from cache"); >+ if (resolve) >+ resolveClass(clazz); >+ return (clazz); >+ } >+ >+ // (0.1) Check our previously loaded class cache >+ clazz = findLoadedClass(name); >+ if (clazz != null) { >+ if (log.isDebugEnabled()) >+ log.debug(" Returning class from cache"); >+ if (resolve) >+ resolveClass(clazz); >+ return (clazz); >+ } >+ >+ // (0.2) Try loading the class with the system class loader, to prevent >+ // the webapp from overriding J2SE classes >+ try { >+ clazz = system.loadClass(name); > if (clazz != null) { >- if (log.isDebugEnabled()) >- log.debug(" Returning class from cache"); > if (resolve) > resolveClass(clazz); > return (clazz); > } >- >- // (0.1) Check our previously loaded class cache >- clazz = findLoadedClass(name); >- if (clazz != null) { >- if (log.isDebugEnabled()) >- log.debug(" Returning class from cache"); >- if (resolve) >- resolveClass(clazz); >- return (clazz); >+ } catch (ClassNotFoundException e) { >+ // Ignore >+ } >+ >+ // (0.5) Permission to access this class when using a SecurityManager >+ if (securityManager != null) { >+ int i = name.lastIndexOf('.'); >+ if (i >= 0) { >+ try { >+ securityManager.checkPackageAccess(name.substring(0,i)); >+ } catch (SecurityException se) { >+ String error = "Security Violation, attempt to use " + >+ "Restricted Class: " + name; >+ log.info(error, se); >+ throw new ClassNotFoundException(error, se); >+ } > } >- >- // (0.2) Try loading the class with the system class loader, to prevent >- // the webapp from overriding J2SE classes >+ } >+ >+ boolean delegateLoad = delegate || filter(name); >+ >+ // (1) Delegate to our parent if requested >+ if (delegateLoad) { >+ if (log.isDebugEnabled()) >+ log.debug(" Delegating to parent classloader1 " + parent); >+ ClassLoader loader = parent; >+ if (loader == null) >+ loader = system; > try { >- clazz = system.loadClass(name); >+ clazz = loader.loadClass(name); > if (clazz != null) { >+ if (log.isDebugEnabled()) >+ log.debug(" Loading class from parent"); > if (resolve) > resolveClass(clazz); > return (clazz); > } > } catch (ClassNotFoundException e) { >- // Ignore >- } >- >- // (0.5) Permission to access this class when using a SecurityManager >- if (securityManager != null) { >- int i = name.lastIndexOf('.'); >- if (i >= 0) { >- try { >- securityManager.checkPackageAccess(name.substring(0,i)); >- } catch (SecurityException se) { >- String error = "Security Violation, attempt to use " + >- "Restricted Class: " + name; >- log.info(error, se); >- throw new ClassNotFoundException(error, se); >- } >- } >+ ; > } >- >- boolean delegateLoad = delegate || filter(name); >- >- // (1) Delegate to our parent if requested >- if (delegateLoad) { >+ } >+ >+ // (2) Search local repositories >+ if (log.isDebugEnabled()) >+ log.debug(" Searching local repositories"); >+ try { >+ clazz = findClass(name); >+ if (clazz != null) { > if (log.isDebugEnabled()) >- log.debug(" Delegating to parent classloader1 " + parent); >- ClassLoader loader = parent; >- if (loader == null) >- loader = system; >- try { >- clazz = loader.loadClass(name); >- if (clazz != null) { >- if (log.isDebugEnabled()) >- log.debug(" Loading class from parent"); >- if (resolve) >- resolveClass(clazz); >- return (clazz); >- } >- } catch (ClassNotFoundException e) { >- ; >- } >+ log.debug(" Loading class from local repository"); >+ if (resolve) >+ resolveClass(clazz); >+ return (clazz); > } >- >- // (2) Search local repositories >+ } catch (ClassNotFoundException e) { >+ ; >+ } >+ >+ // (3) Delegate to parent unconditionally >+ if (!delegateLoad) { > if (log.isDebugEnabled()) >- log.debug(" Searching local repositories"); >+ log.debug(" Delegating to parent classloader at end: " + parent); >+ ClassLoader loader = parent; >+ if (loader == null) >+ loader = system; > try { >- clazz = findClass(name); >+ clazz = loader.loadClass(name); > if (clazz != null) { > if (log.isDebugEnabled()) >- log.debug(" Loading class from local repository"); >+ log.debug(" Loading class from parent"); > if (resolve) > resolveClass(clazz); > return (clazz); >@@ -1535,30 +1554,10 @@ public class WebappClassLoader > } catch (ClassNotFoundException e) { > ; > } >- >- // (3) Delegate to parent unconditionally >- if (!delegateLoad) { >- if (log.isDebugEnabled()) >- log.debug(" Delegating to parent classloader at end: " + parent); >- ClassLoader loader = parent; >- if (loader == null) >- loader = system; >- try { >- clazz = loader.loadClass(name); >- if (clazz != null) { >- if (log.isDebugEnabled()) >- log.debug(" Loading class from parent"); >- if (resolve) >- resolveClass(clazz); >- return (clazz); >- } >- } catch (ClassNotFoundException e) { >- ; >- } >- } >- >- throw new ClassNotFoundException(name); > } >+ >+ throw new ClassNotFoundException(name); >+ > } > > >--- java/org/apache/jasper/servlet/JasperLoader.java (original) >+++ java/org/apache/jasper/servlet/JasperLoader.java Thu May 6 19:17:49 2010 >@@ -91,7 +91,7 @@ public class JasperLoader extends URLCla > * > * @exception ClassNotFoundException if the class was not found > */ >- public Class loadClass(final String name, boolean resolve) >+ public synchronized Class loadClass(final String name, boolean resolve) > throws ClassNotFoundException { > > Class clazz = null; >@@ -169,4 +169,4 @@ public class JasperLoader extends URLCla > public final PermissionCollection getPermissions(CodeSource codeSource) { > return permissionCollection; > } >-} >\ No newline at end of file >+} > >--- webapps/docs/changelog.xml (original) >+++ webapps/docs/changelog.xml Thu May 6 19:17:49 2010 >@@ -47,6 +47,9 @@ > address via the HTTP WWW-Authenticate header when using BASIC or DIGEST > authentication. (markt) > </fix> >+ <fix> >+ <bug>48903</bug>: Fix deadlock in webapp class loader. (rjung) >+ </fix> > <add> > Include context name when reporting memory leaks to aid root cause > identification. (markt) > >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 899268
: 681323