SAX2 driver class org.apache.xerces.parsers.SAXParser

I hope someone has come across this problem before and can help me here.
I got this error when execute a script embedded into a button. Script is doing a http request call and getting return back as XML. I then use ElementTree to parse that XML document into a string and put it in our database.

It works ok when I do this in the designer preview mode until I want to try to launch the client and test, the error message popped up

I saw another discussion here back in Oct’12 quite similar to this. I thought that the latest gateway I have should already handle that but looks like it’s not the case here.

Can anyone please shed some light here?



Can you show us your code?

I think what this means is that org.apache.xerces.parsers.SAXParser is on the designer’s classpath for whatever reason, but isn’t on the client’s classpath… the question is whether that’s correct or not.

Here it is
batchquery1.py (2.65 KB)

If this problem is likely to be the client’s classpath, can you tell me how to add that?

Hi!

I have exactly the same problem. I use Python ElementTree to parse XML files and everything works fine in designer but when I launch the project e.g. to staging mode, python cannot find ElementTree module.

I’ve verified this operation on two different computers, one with with windows xp & java 6 and the other with windows 7 & java 7. Both computers had Ignition 7.6.2 (b2368) installed.

Does anybody know how to solve this problem?

regards
-Heikki

Hi there, yes, I know how to solve this problem :smiley:

Add this code to the top of your script and it will work:

from org.python.core import imp
from java.lang import Thread
Thread.currentThread().setContextClassLoader(imp.getParentClassLoader())

Here is an explanation of the problem and solution:

This is a Classloader problem.

The expat.py module tries to load “org.python.apache.xerces.parsers.SAXParser” before it tries to load “org.apache.xerces.parsers.SAXParser” and fails.

Here’s the code I am talking about:

# Xerces
_mangled_xerces_parser_name = "org.python.apache.xerces.parsers.SAXParser"
_xerces_parser_name = "org.apache.xerces.parsers.SAXParser"
try:
    self._reader = XMLReaderFactory.createXMLReader(_mangled_xerces_parser_name)
except:
    self._reader = XMLReaderFactory.createXMLReader(_xerces_parser_name)

But both the client and designer can import “org.python.apache.xerces.parsers.SAXParser” just fine.

The problem is that the XMLReaderFactory.createXMLReader method in expat.py tries to load “org.python.apache.xerces.parsers.SAXParser” dynamically but looks in the wrong classloaders.

The reason this works in the designer is because in the designer the context classloader is set to a classloader that works. In the client the context classloader is set to null.

So you can get this to work in the client by setting the context classloader to the appropriate classloader.

11 Likes

Hi!

Thank you very much, now the parsing works fine also in the client.

regards
-Heikki

I know this post is a year old, but it solved a problem I had today.

This is such a great resource

Thanks Nick and heikkihe

Fixed the same issues for me 3 years later.

Yep, same issue and successful fix here!

Many years later… this still seems to be a bug in 8.1.1. Should I continue to use the workaround?

Jython 2.7.1 (default:0df7adb1b397, Jun 30 2017, 19:02:43) 
[OpenJDK 64-Bit Server VM (Azul Systems, Inc.)] on java11.0.7


>>> oc.submit()
Java Traceback:
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "<module:opcenter>", line 501, in submit
  File "<module:opcenter>", line 231, in submit
  File "<module:opcenter>", line 263, in xml
  File "<module:opcenter>", line 291, in dict
  File "<module:opcenter>", line 291, in dict
  File "C:\...\C0\pylib\xmltodict.py", line 295, in parse
    parser = expat.ParserCreate(
  File "C:\...\C0\pylib\xml\parsers\expat.py", line 59, in ParserCreate
    return XMLParser(encoding, namespace_separator)
  File "C:\...\C0\pylib\xml\parsers\expat.py", line 91, in __init__
    self._reader = XMLReaderFactory.createXMLReader(_xerces_parser_name)
java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser

	at java.xml/org.xml.sax.helpers.XMLReaderFactory.loadClass(Unknown Source)

	at java.xml/org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown Source)

	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

	at java.base/java.lang.reflect.Method.invoke(Unknown Source)

org.xml.sax.SAXException: org.xml.sax.SAXException: SAX2 driver class org.apache.xerces.parsers.SAXParser not found
java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser


	at org.python.core.Py.JavaError(Py.java:552)

	at org.python.core.Py.JavaError(Py.java:543)

	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:190)

	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:206)

	at org.python.core.PyObject.__call__(PyObject.java:480)

	at org.python.core.PyObject.__call__(PyObject.java:484)

	at xml.parsers.expat$py.__init__$3(C:/Users/rmclaughlin/.ignition/cache/gwnhigndev.allegro.msad_443/C0/pylib/xml/parsers/expat.py:139)

	at xml.parsers.expat$py.call_function(C:/Users/rmclaughlin/.ignition/cache/gwnhigndev.allegro.msad_443/C0/pylib/xml/parsers/expat.py)

	at org.python.core.PyTableCode.call(PyTableCode.java:171)

	at org.python.core.PyBaseCode.call(PyBaseCode.java:308)

	at org.python.core.PyBaseCode.call(PyBaseCode.java:199)

	at org.python.core.PyFunction.__call__(PyFunction.java:482)

	at org.python.core.PyMethod.instancemethod___call__(PyMethod.java:237)

	at org.python.core.PyMethod.__call__(PyMethod.java:228)

	at org.python.core.PyMethod.__call__(PyMethod.java:223)

	at org.python.core.Deriveds.dispatch__init__(Deriveds.java:19)

	at org.python.core.PyObjectDerived.dispatch__init__(PyObjectDerived.java:1112)

	at org.python.core.PyType.type___call__(PyType.java:1880)

	at org.python.core.PyType.__call__(PyType.java:1863)

	at org.python.core.PyObject.__call__(PyObject.java:497)

	at org.python.core.PyObject.__call__(PyObject.java:501)

	at xml.parsers.expat$py.ParserCreate$1(C:/Users/rmclaughlin/.ignition/cache/gwnhigndev.allegro.msad_443/C0/pylib/xml/parsers/expat.py:59)

	at xml.parsers.expat$py.call_function(C:/Users/rmclaughlin/.ignition/cache/gwnhigndev.allegro.msad_443/C0/pylib/xml/parsers/expat.py)

	at org.python.core.PyTableCode.call(PyTableCode.java:171)

	at org.python.core.PyBaseCode.call(PyBaseCode.java:154)

	at org.python.core.PyFunction.__call__(PyFunction.java:423)

	at xmltodict$py.parse$12(C:/Users/rmclaughlin/.ignition/cache/gwnhigndev.allegro.msad_443/C0/pylib/xmltodict.py:312)

	at xmltodict$py.call_function(C:/Users/rmclaughlin/.ignition/cache/gwnhigndev.allegro.msad_443/C0/pylib/xmltodict.py)

	at org.python.core.PyTableCode.call(PyTableCode.java:171)

	at org.python.core.PyBaseCode.call(PyBaseCode.java:308)

	at org.python.core.PyBaseCode.call(PyBaseCode.java:132)

	at org.python.core.PyFunction.__call__(PyFunction.java:413)

	at org.python.pycode._pyx73.dict$17(<module:opcenter>:293)

	at org.python.pycode._pyx73.call_function(<module:opcenter>)

	at org.python.core.PyTableCode.call(PyTableCode.java:171)

	at org.python.core.PyBaseCode.call(PyBaseCode.java:139)

	at org.python.core.PyFunction.__call__(PyFunction.java:413)

	at org.python.core.PyFunction.__call__(PyFunction.java:408)

	at org.python.core.PyProperty.property___get__(PyProperty.java:82)

	at org.python.core.PyProperty.__get__(PyProperty.java:71)

	at org.python.core.PyObject.object___findattr__(PyObject.java:3848)

	at org.python.core.PyObject.object___getattribute__(PyObject.java:3832)

	at org.python.core.PyObject$object___getattribute___exposer.__call__(Unknown Source)

	at org.python.core.Deriveds.__findattr_ex__(Deriveds.java:59)

	at org.python.core.PyObjectDerived.__findattr_ex__(PyObjectDerived.java:1036)

	at org.python.core.PyObject.__getattr__(PyObject.java:1025)

	at org.python.pycode._pyx73.xml$15(<module:opcenter>:282)

	at org.python.pycode._pyx73.call_function(<module:opcenter>)

	at org.python.core.PyTableCode.call(PyTableCode.java:171)

	at org.python.core.PyBaseCode.call(PyBaseCode.java:154)

	at org.python.core.PyFunction.__call__(PyFunction.java:423)

	at org.python.core.PyFunction.__call__(PyFunction.java:418)

	at org.python.core.PyProperty.property___set__(PyProperty.java:95)

	at org.python.core.PyProperty.__set__(PyProperty.java:87)

	at org.python.core.PyObject.object___setattr__(PyObject.java:3884)

	at org.python.core.PyObject.object___setattr__(PyObject.java:3874)

	at org.python.core.PyObject$object___setattr___exposer.__call__(Unknown Source)

	at org.python.core.PyObjectDerived.__setattr__(PyObjectDerived.java:1043)

	at org.python.pycode._pyx73.submit$10(<module:opcenter>:238)

	at org.python.pycode._pyx73.call_function(<module:opcenter>)

	at org.python.core.PyTableCode.call(PyTableCode.java:171)

	at org.python.core.PyBaseCode.call(PyBaseCode.java:139)

	at org.python.core.PyFunction.__call__(PyFunction.java:413)

	at org.python.core.PyMethod.__call__(PyMethod.java:126)

	at org.python.pycode._pyx73.submit$37(<module:opcenter>:512)

	at org.python.pycode._pyx73.call_function(<module:opcenter>)

	at org.python.core.PyTableCode.call(PyTableCode.java:171)

	at org.python.core.PyBaseCode.call(PyBaseCode.java:139)

	at org.python.core.PyFunction.__call__(PyFunction.java:413)

	at org.python.core.PyMethod.__call__(PyMethod.java:126)

	at org.python.pycode._pyx75.f$0(<input>:1)

	at org.python.pycode._pyx75.call_function(<input>)

	at org.python.core.PyTableCode.call(PyTableCode.java:171)

	at org.python.core.PyCode.call(PyCode.java:18)

	at org.python.core.Py.runCode(Py.java:1614)

	at org.python.core.Py.exec(Py.java:1658)

	at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:276)

	at org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter.java:131)

	at com.inductiveautomation.ignition.designer.gui.tools.jythonconsole.JythonConsole$ConsoleWorker.doInBackground(JythonConsole.java:605)

	at com.inductiveautomation.ignition.designer.gui.tools.jythonconsole.JythonConsole$ConsoleWorker.doInBackground(JythonConsole.java:593)

	at java.desktop/javax.swing.SwingWorker$1.call(Unknown Source)

	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)

	at java.desktop/javax.swing.SwingWorker.run(Unknown Source)

	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

	at java.base/java.lang.Thread.run(Unknown Source)

Caused by: org.xml.sax.SAXException: SAX2 driver class org.apache.xerces.parsers.SAXParser not found
java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser

	at java.xml/org.xml.sax.helpers.XMLReaderFactory.loadClass(Unknown Source)

	at java.xml/org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown Source)

	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

	at java.base/java.lang.reflect.Method.invoke(Unknown Source)

	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:188)

	... 83 more

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

	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)

	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)

	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)

	at java.xml/org.xml.sax.helpers.NewInstance.newInstance(Unknown Source)

	... 90 more

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "<module:opcenter>", line 501, in submit
  File "<module:opcenter>", line 231, in submit
  File "<module:opcenter>", line 263, in xml
  File "<module:opcenter>", line 291, in dict
  File "<module:opcenter>", line 291, in dict
  File "C:\...\C0\pylib\xmltodict.py", line 295, in parse
    parser = expat.ParserCreate(
  File "C:\...\C0\pylib\xml\parsers\expat.py", line 59, in ParserCreate
    return XMLParser(encoding, namespace_separator)
  File "C:\...\C0\pylib\xml\parsers\expat.py", line 91, in __init__
    self._reader = XMLReaderFactory.createXMLReader(_xerces_parser_name)
java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser

	at java.xml/org.xml.sax.helpers.XMLReaderFactory.loadClass(Unknown Source)

	at java.xml/org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown Source)

	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

	at java.base/java.lang.reflect.Method.invoke(Unknown Source)

org.xml.sax.SAXException: org.xml.sax.SAXException: SAX2 driver class org.apache.xerces.parsers.SAXParser not found
java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
>>> 

PS - It is very intermittent… maybe 1/100 executions of the same code. Annoying to debug none the less

This is very likely an internal Jython bug; without consistent reproduction it would be very hard for us to fix.

Didn’t think of searching jython bugs…

Looks like this one… Issue 2693: SAXParser, classloader and dynamically loading jython - Jython tracker

I've had a conversation with IA Support about this error recently and they mentioned there are 3 current bug tickets related to this error. They suggested looking for a workaround since one of those tickets date back to 7.7 days.

I've used SAXParser in previous 7.8 and 7.9 gateways without issues and since version 8, it just about fails every time the script runs in the Client but works in the Designer.

Nick's workaround is great.
I found this link yesterday for another work around:

2 Likes

This still seems to work for the same bug in 8.1.5.
Thanks @nmudge

The workaround should no longer be necessary in 8.1.5; we made a change in how the Jython interpreter is loaded that should fix this ‘at the source’:
https://inductiveautomation.com/downloads/releasenotes/8.1.5#16892

2 Likes

So, should this be fixed in all scopes now? I’ll test some more next week for sure when we update to 8.1.6.

So far as we’re aware, anyways… :crossed_fingers:

Hate to be the bearer of bad news… in 8.1.6, still occurring, in the designer script console, seemingly random, but fairly consistent every dozen or so calls, I get the following… Good news, I have not noticed any issues in Perspective sessions after removing the Thread/Classloader snippet.

Java Traceback:
Traceback (most recent call last):
  File "<input>", line 4, in <module>
  File "<module:opcenter>", line 1832, in __init__
  File "<module:opcenter>", line 1846, in cdo
  File "<module:opcenter>", line 430, in cdo_metadata
  File "<module:opcenter>", line 361, in submit_and_return
  File "<module:opcenter>", line 311, in submit
  File "<module:opcenter>", line 591, in xml
  File "<module:opcenter>", line 652, in dict
  File "<module:opcenter>", line 652, in dict
  File "C:\...\C0\pylib\xmltodict.py", line 295, in parse
    parser = expat.ParserCreate(
  File "C:\...\C0\pylib\xml\parsers\expat.py", line 59, in ParserCreate
    return XMLParser(encoding, namespace_separator)
  File "C:\...\C0\pylib\xml\parsers\expat.py", line 91, in __init__
    self._reader = XMLReaderFactory.createXMLReader(_xerces_parser_name)
java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser

	at java.xml/org.xml.sax.helpers.XMLReaderFactory.loadClass(Unknown Source)

	at java.xml/org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown Source)

	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

	at java.base/java.lang.reflect.Method.invoke(Unknown Source)

org.xml.sax.SAXException: org.xml.sax.SAXException: SAX2 driver class org.apache.xerces.parsers.SAXParser not found
java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser


	at org.python.core.Py.JavaError(Py.java:552)

	at org.python.core.Py.JavaError(Py.java:543)

	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:190)

	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:206)

	at org.python.core.PyObject.__call__(PyObject.java:480)

	at org.python.core.PyObject.__call__(PyObject.java:484)

	at xml.parsers.expat$py.__init__$3(C:/.../C0/pylib/xml/parsers/expat.py:139)

	at xml.parsers.expat$py.call_function(C:/.../C0/pylib/xml/parsers/expat.py)

	at org.python.core.PyTableCode.call(PyTableCode.java:171)

	at org.python.core.PyBaseCode.call(PyBaseCode.java:308)

	at org.python.core.PyBaseCode.call(PyBaseCode.java:199)

	at org.python.core.PyFunction.__call__(PyFunction.java:482)

	at org.python.core.PyMethod.instancemethod___call__(PyMethod.java:237)

	at org.python.core.PyMethod.__call__(PyMethod.java:228)

	at org.python.core.PyMethod.__call__(PyMethod.java:223)

	at org.python.core.Deriveds.dispatch__init__(Deriveds.java:19)

	at org.python.core.PyObjectDerived.dispatch__init__(PyObjectDerived.java:1112)

	at org.python.core.PyType.type___call__(PyType.java:1880)

	at org.python.core.PyType.__call__(PyType.java:1863)

	at org.python.core.PyObject.__call__(PyObject.java:497)

	at org.python.core.PyObject.__call__(PyObject.java:501)

	at xml.parsers.expat$py.ParserCreate$1(C:/.../C0/pylib/xml/parsers/expat.py:59)

	at xml.parsers.expat$py.call_function(C:/.../C0/pylib/xml/parsers/expat.py)

	at org.python.core.PyTableCode.call(PyTableCode.java:171)

	at org.python.core.PyBaseCode.call(PyBaseCode.java:154)

	at org.python.core.PyFunction.__call__(PyFunction.java:423)

	at xmltodict$py.parse$12(C:/.../C0/pylib/xmltodict.py:312)

	at xmltodict$py.call_function(C:/.../C0/pylib/xmltodict.py)

	at org.python.core.PyTableCode.call(PyTableCode.java:171)

	at org.python.core.PyBaseCode.call(PyBaseCode.java:308)

	at org.python.core.PyFunction.function___call__(PyFunction.java:471)

	at org.python.core.PyFunction.__call__(PyFunction.java:466)

	at org.python.pycode._pyx236.dict$29(<module:opcenter>:654)

	at org.python.pycode._pyx236.call_function(<module:opcenter>)

	at org.python.core.PyTableCode.call(PyTableCode.java:171)

	at org.python.core.PyBaseCode.call(PyBaseCode.java:139)

	at org.python.core.PyFunction.__call__(PyFunction.java:413)

	at org.python.core.PyFunction.__call__(PyFunction.java:408)

	at org.python.core.PyProperty.property___get__(PyProperty.java:82)

	at org.python.core.PyProperty.__get__(PyProperty.java:71)

	at org.python.core.PyObject.object___findattr__(PyObject.java:3848)

	at org.python.core.PyObject.object___getattribute__(PyObject.java:3832)

	at org.python.core.PyObject$object___getattribute___exposer.__call__(Unknown Source)

	at org.python.core.Deriveds.__findattr_ex__(Deriveds.java:59)

	at org.python.core.PyObjectDerived.__findattr_ex__(PyObjectDerived.java:1036)

	at org.python.core.PyObject.__getattr__(PyObject.java:1025)

	at org.python.pycode._pyx236.xml$27(<module:opcenter>:639)

	at org.python.pycode._pyx236.call_function(<module:opcenter>)

	at org.python.core.PyTableCode.call(PyTableCode.java:171)

	at org.python.core.PyBaseCode.call(PyBaseCode.java:154)

	at org.python.core.PyFunction.__call__(PyFunction.java:423)

	at org.python.core.PyFunction.__call__(PyFunction.java:418)

	at org.python.core.PyProperty.property___set__(PyProperty.java:95)

	at org.python.core.PyProperty.__set__(PyProperty.java:87)

	at org.python.core.PyObject.object___setattr__(PyObject.java:3884)

	at org.python.core.PyObject.object___setattr__(PyObject.java:3874)

	at org.python.core.PyObject$object___setattr___exposer.__call__(Unknown Source)

	at org.python.core.PyObjectDerived.__setattr__(PyObjectDerived.java:1043)

	at org.python.pycode._pyx236.submit$11(<module:opcenter>:356)

	at org.python.pycode._pyx236.call_function(<module:opcenter>)

	at org.python.core.PyTableCode.call(PyTableCode.java:171)

	at org.python.core.PyBaseCode.call(PyBaseCode.java:139)

	at org.python.core.PyFunction.__call__(PyFunction.java:413)

	at org.python.core.PyMethod.__call__(PyMethod.java:126)

	at org.python.pycode._pyx236.submit_and_return$12(<module:opcenter>:368)

	at org.python.pycode._pyx236.call_function(<module:opcenter>)

	at org.python.core.PyTableCode.call(PyTableCode.java:171)

	at org.python.core.PyBaseCode.call(PyBaseCode.java:139)

	at org.python.core.PyFunction.__call__(PyFunction.java:413)

	at org.python.core.PyMethod.__call__(PyMethod.java:126)

	at org.python.pycode._pyx236.cdo_metadata$14(<module:opcenter>:465)

	at org.python.pycode._pyx236.call_function(<module:opcenter>)

	at org.python.core.PyTableCode.call(PyTableCode.java:171)

	at org.python.core.PyBaseCode.call(PyBaseCode.java:308)

	at org.python.core.PyBaseCode.call(PyBaseCode.java:146)

	at org.python.core.PyFunction.__call__(PyFunction.java:423)

	at org.python.core.PyMethod.__call__(PyMethod.java:141)

	at org.python.pycode._pyx236.cdo$101(<module:opcenter>:1852)

	at org.python.pycode._pyx236.call_function(<module:opcenter>)

	at org.python.core.PyTableCode.call(PyTableCode.java:171)

	at org.python.core.PyBaseCode.call(PyBaseCode.java:154)

	at org.python.core.PyFunction.__call__(PyFunction.java:423)

	at org.python.core.PyFunction.__call__(PyFunction.java:418)

	at org.python.core.PyProperty.property___set__(PyProperty.java:95)

	at org.python.core.PyProperty.__set__(PyProperty.java:87)

	at org.python.core.PyObject.object___setattr__(PyObject.java:3884)

	at org.python.core.PyObject.object___setattr__(PyObject.java:3874)

	at org.python.core.PyObject$object___setattr___exposer.__call__(Unknown Source)

	at org.python.core.PyObjectDerived.__setattr__(PyObjectDerived.java:1043)

	at org.python.pycode._pyx236.__init__$99(<module:opcenter>:1832)

	at org.python.pycode._pyx236.call_function(<module:opcenter>)

	at org.python.core.PyTableCode.call(PyTableCode.java:171)

	at org.python.core.PyBaseCode.call(PyBaseCode.java:308)

	at org.python.core.PyBaseCode.call(PyBaseCode.java:199)

	at org.python.core.PyFunction.__call__(PyFunction.java:482)

	at org.python.core.PyMethod.instancemethod___call__(PyMethod.java:237)

	at org.python.core.PyMethod.__call__(PyMethod.java:228)

	at org.python.core.PyMethod.__call__(PyMethod.java:223)

	at org.python.core.Deriveds.dispatch__init__(Deriveds.java:19)

	at org.python.core.PyObjectDerived.dispatch__init__(PyObjectDerived.java:1112)

	at org.python.core.PyType.type___call__(PyType.java:1880)

	at org.python.core.PyType.__call__(PyType.java:1863)

	at org.python.core.PyObject.__call__(PyObject.java:480)

	at org.python.core.PyObject.__call__(PyObject.java:484)

	at org.python.pycode._pyx238.f$0(<input>:4)

	at org.python.pycode._pyx238.call_function(<input>)

	at org.python.core.PyTableCode.call(PyTableCode.java:171)

	at org.python.core.PyCode.call(PyCode.java:18)

	at org.python.core.Py.runCode(Py.java:1614)

	at org.python.core.Py.exec(Py.java:1658)

	at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:276)

	at org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter.java:131)

	at com.inductiveautomation.ignition.designer.gui.tools.jythonconsole.JythonConsole$ConsoleWorker.doInBackground(JythonConsole.java:605)

	at com.inductiveautomation.ignition.designer.gui.tools.jythonconsole.JythonConsole$ConsoleWorker.doInBackground(JythonConsole.java:593)

	at java.desktop/javax.swing.SwingWorker$1.call(Unknown Source)

	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)

	at java.desktop/javax.swing.SwingWorker.run(Unknown Source)

	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

	at java.base/java.lang.Thread.run(Unknown Source)

Caused by: org.xml.sax.SAXException: SAX2 driver class org.apache.xerces.parsers.SAXParser not found
java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser

	at java.xml/org.xml.sax.helpers.XMLReaderFactory.loadClass(Unknown Source)

	at java.xml/org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown Source)

	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

	at java.base/java.lang.reflect.Method.invoke(Unknown Source)

	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:188)

	... 117 more

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

	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)

	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)

	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)

	at java.xml/org.xml.sax.helpers.NewInstance.newInstance(Unknown Source)

	... 124 more

Traceback (most recent call last):
  File "<input>", line 4, in <module>
  File "<module:opcenter>", line 1832, in __init__
  File "<module:opcenter>", line 1846, in cdo
  File "<module:opcenter>", line 430, in cdo_metadata
  File "<module:opcenter>", line 361, in submit_and_return
  File "<module:opcenter>", line 311, in submit
  File "<module:opcenter>", line 591, in xml
  File "<module:opcenter>", line 652, in dict
  File "<module:opcenter>", line 652, in dict
  File "C:\...\C0\pylib\xmltodict.py", line 295, in parse
    parser = expat.ParserCreate(
  File "C:\...\C0\pylib\xml\parsers\expat.py", line 59, in ParserCreate
    return XMLParser(encoding, namespace_separator)
  File "C:\...\C0\pylib\xml\parsers\expat.py", line 91, in __init__
    self._reader = XMLReaderFactory.createXMLReader(_xerces_parser_name)
java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser

	at java.xml/org.xml.sax.helpers.XMLReaderFactory.loadClass(Unknown Source)

	at java.xml/org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown Source)

	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

	at java.base/java.lang.reflect.Method.invoke(Unknown Source)

org.xml.sax.SAXException: org.xml.sax.SAXException: SAX2 driver class org.apache.xerces.parsers.SAXParser not found
java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser

Interesting. Can you try boiling that replication down a little? Is it just the script console - you can’t repeat in Vision, for instance? Does a minimal SSCCE like this do it (I can’t replicate it, so I’m trying to isolate the missing factor)?

import xml.etree.ElementTree as ET

ET.fromstring(system.file.readFileAsString("C:\Users\pgriffith\Downloads\simple_script_sfc.xml"))