View | Details | Raw Unified | Return to bug 50222
Collapse All | Expand All

(-)java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java (+12 lines)
Lines 151-156 Link Here
151
    public void lifecycleEvent(LifecycleEvent event) {
151
    public void lifecycleEvent(LifecycleEvent event) {
152
        // Initialise these classes when Tomcat starts
152
        // Initialise these classes when Tomcat starts
153
        if (Lifecycle.BEFORE_INIT_EVENT.equals(event.getType())) {
153
        if (Lifecycle.BEFORE_INIT_EVENT.equals(event.getType())) {
154
155
            ClassLoader loader = Thread.currentThread().getContextClassLoader();
156
157
            try
158
            {
159
                // Use the system classloader as the victim for all this
160
                // ClassLoader pinning we're about to do.
161
                Thread.currentThread().setContextClassLoader(ClassLoader.getSystemClassLoader());
162
154
            /*
163
            /*
155
             * Several components end up calling:
164
             * Several components end up calling:
156
             * sun.awt.AppContext.getAppContext()
165
             * sun.awt.AppContext.getAppContext()
Lines 306-312 Link Here
306
                    log.error(sm.getString("jreLeakListener.xmlParseFail"), e);
315
                    log.error(sm.getString("jreLeakListener.xmlParseFail"), e);
307
                }
316
                }
308
            }
317
            }
318
            } finally {
319
                Thread.currentThread().setContextClassLoader(loader);
309
        }
320
        }
310
    }
321
    }
322
    }
311
323
312
}
324
}

Return to bug 50222