public class DatatypeConverterImplInitiator extends Object implements PreClassLoaderInitiator
DatatypeConverterImpl in the JAXB Reference Implementation shipped with JDK 1.6+ will
keep a static reference (DatatypeConverterImpl) to a concrete subclass of
DatatypeFactory, that is resolved when the class is loaded (which I believe happens if you
have custom bindings that reference the static methods in DatatypeConverter). It seems that if
for example you have a version of Xerces inside your application, the factory method may resolve org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl as the implementation to use (rather than
com.sun.org.apache.xerces.internal.jaxp.datatype.DatatypeFactoryImpl shipped with the JDK), which
means there will a reference from DatatypeConverterImpl to your classloader.
See http://java.jiderhamn.se/2012/02/26/classloader-leaks-v-common-mistakes-and-known-offenders/| Constructor and Description |
|---|
DatatypeConverterImplInitiator() |
| Modifier and Type | Method and Description |
|---|---|
void |
doOutsideClassLoader(ClassLoaderLeakPreventor preventor)
Perform action that needs to be done outside the leak susceptible classloader, i.e. in the system or other parent
classloader.
|
public void doOutsideClassLoader(ClassLoaderLeakPreventor preventor)
PreClassLoaderInitiatorThread.contextClassLoader of the current
thread when method is invoked.
Must NOT have modified Thread.contextClassLoader of the current thread when returning.doOutsideClassLoader in interface PreClassLoaderInitiatorCopyright © 2019. All rights reserved.