Description
I read java.beans.XMLDecoder code and find that XMLDecoder(4) as follows:
public XMLDecoder(InputStream inputStream, Object owner, ExceptionListener listener, ClassLoader cl) {
this(inputStream, owner, listener);
defaultClassLoader = cl;
}
This constructor will first call XMLDecoder(3) which always use Thread.currentThread().getContextClassLoader() regardless of user's ClassLoader.
I think the solution is to set the deafultClassLoader first before use SAXParser to parse xml.