Message12011

Author webpentest
Recipients webpentest
Date 2018-06-21.00:11:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1529539910.43.0.56676864532.issue2693@psf.upfronthosting.co.za>
In-reply-to
Content
I am developing an extension for a java program that embeds jython as a scripting environment. When trying to use xml parsing routines from inside the python script, I run into the following exception:

java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser


The issue is similar to http://bugs.jython.org/issue1537

After some investigations (see the whole discussion in https://support.portswigger.net/customer/en/portal/questions/17349567-saxparser-dependency-delimma), I think I've found the root cause. Namely, SAX's XMLReaderFactory.createXMLReader does not honor the class loader inheritance and uses current thread's classloader. In my case this classloader does not contain jython's jar, so that createXMLReader cannot find both org.python.apache.xerces.parsers.SAXParser and org.apache.xerces.parsers.SAXParser classes. 

I have a workaround that employs switching current Thread's classloader to the classloader that has jython's jar. But maybe there is a way to fix this issue inside jython itself?
History
Date User Action Args
2018-06-21 00:11:50webpentestsetrecipients: + webpentest
2018-06-21 00:11:50webpentestsetmessageid: <1529539910.43.0.56676864532.issue2693@psf.upfronthosting.co.za>
2018-06-21 00:11:50webpentestlinkissue2693 messages
2018-06-21 00:11:48webpentestcreate