# Apache POI returns java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException

**URL:** <https://forum.inductiveautomation.com/t/apache-poi-returns-java-lang-noclassdeffounderror-javax-xml-bind-jaxbexception/83113>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [December 13, 2023, 9:52pm UTC](https://forum.inductiveautomation.com/t/apache-poi-returns-java-lang-noclassdeffounderror-javax-xml-bind-jaxbexception/83113 "2023-12-13T21:52:23Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [December 13, 2023, 9:52pm UTC](https://forum.inductiveautomation.com/t/apache-poi-returns-java-lang-noclassdeffounderror-javax-xml-bind-jaxbexception/83113/1 "2023-12-13T21:52:24Z")

</div>

v8.1.25

I'm trying to build a proof of concept for breaking a Powerpoint file into images of the slides.

Unfortunately, when I try to draw the graphic, it throws the exception listed in the title. I'm thinking it was something deprecated and removed in Java 11, but I'm willing to be wrong.

I'd upload the generic 'Welcome to Powerpoint' file, but .pptx is not on the allowed extension list.

```python
from java.awt import Color
from java.awt.geom import Rectangle2D
from java.awt.image import BufferedImage
from java.io import File;
from java.io import FileInputStream
from java.io import FileOutputStream
from org.apache.poi.xslf.usermodel import XMLSlideShow
from javax.imageio import ImageIO

filePath = "C:/Test/test.pptx"

pathList = filePath.split('/')
fileNameList = pathList[-1].split('.')
baseImagePath = '{}/{}_{}.{}'.format('/'.join(pathList[:-1]), '.'.join(fileNameList[:-1]), '{:02d}', 'png')

ppt = XMLSlideShow(FileInputStream(filePath))

pageSize = ppt.pageSize
slides = ppt.slides

for ndx, slide in enumerate(slides):
	image = BufferedImage(pageSize.width, pageSize.height,BufferedImage.TYPE_INT_RGB)
	imagePath = baseImagePath.format(ndx+1)
	
	graphics = image.graphics
	graphics.setPaint(Color.white)
	graphics.fill(Rectangle2D.Float(0, 0, pageSize.width, pageSize.height))
	slide.draw(graphics)
	
	fileOut = FileOutputStream(imagePath)
	ImageIO.write(image, 'png', fileOut)
	fileOut.close()

```

```plaintext
Java Traceback:
Traceback (most recent call last):
  File "<input>", line 29, in <module>
	at org.apache.poi.xslf.usermodel.XSLFSimpleShape.getGeometry(XSLFSimpleShape.java:729)
	at org.apache.poi.sl.draw.DrawSimpleShape.computeOutlines(DrawSimpleShape.java:381)
	at org.apache.poi.sl.draw.DrawSimpleShape.draw(DrawSimpleShape.java:74)
	at org.apache.poi.sl.draw.DrawSheet.draw(DrawSheet.java:71)
	at org.apache.poi.sl.draw.DrawSheet.draw(DrawSheet.java:50)
	at org.apache.poi.sl.draw.DrawSheet.draw(DrawSheet.java:50)
	at org.apache.poi.sl.draw.DrawSlide.draw(DrawSlide.java:41)
	at org.apache.poi.xslf.usermodel.XSLFSlide.draw(XSLFSlide.java:373)
	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)
java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
	at org.python.core.Py.JavaError(Py.java:547)
	at org.python.core.Py.JavaError(Py.java:538)
	at org.python.core.PyReflectedFunction. __call__ (PyReflectedFunction.java:192)
	at org.python.core.PyReflectedFunction. __call__ (PyReflectedFunction.java:208)
	at org.python.core.PyObject. __call__ (PyObject.java:477)
	at org.python.core.PyObject. __call__ (PyObject.java:481)
	at org.python.core.PyMethod. __call__ (PyMethod.java:141)
	at org.python.pycode._pyx356.f$0(<input>:22)
	at org.python.pycode._pyx356.call_function(<input>)
	at org.python.core.PyTableCode.call(PyTableCode.java:173)
	at org.python.core.PyCode.call(PyCode.java:18)
	at org.python.core.Py.runCode(Py.java:1687)
	at org.python.core.Py.exec(Py.java:1731)
	at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:277)
	at org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter.java:130)
	at com.inductiveautomation.ignition.designer.gui.tools.jythonconsole.JythonConsole$ConsoleWorker.doInBackground(JythonConsole.java:611)
	at com.inductiveautomation.ignition.designer.gui.tools.jythonconsole.JythonConsole$ConsoleWorker.doInBackground(JythonConsole.java:599)
	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: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
	at org.apache.poi.xslf.usermodel.XSLFSimpleShape.getGeometry(XSLFSimpleShape.java:729)
	at org.apache.poi.sl.draw.DrawSimpleShape.computeOutlines(DrawSimpleShape.java:381)
	at org.apache.poi.sl.draw.DrawSimpleShape.draw(DrawSimpleShape.java:74)
	at org.apache.poi.sl.draw.DrawSheet.draw(DrawSheet.java:71)
	at org.apache.poi.sl.draw.DrawSheet.draw(DrawSheet.java:50)
	at org.apache.poi.sl.draw.DrawSheet.draw(DrawSheet.java:50)
	at org.apache.poi.sl.draw.DrawSlide.draw(DrawSlide.java:41)
	at org.apache.poi.xslf.usermodel.XSLFSlide.draw(XSLFSlide.java:373)
	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:190)
	... 20 more
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
	at java.base/java.net.URLClassLoader.findClass(Unknown Source)
	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
	... 33 more
Traceback (most recent call last):
  File "<input>", line 29, in <module>
	at org.apache.poi.xslf.usermodel.XSLFSimpleShape.getGeometry(XSLFSimpleShape.java:729)
	at org.apache.poi.sl.draw.DrawSimpleShape.computeOutlines(DrawSimpleShape.java:381)
	at org.apache.poi.sl.draw.DrawSimpleShape.draw(DrawSimpleShape.java:74)
	at org.apache.poi.sl.draw.DrawSheet.draw(DrawSheet.java:71)
	at org.apache.poi.sl.draw.DrawSheet.draw(DrawSheet.java:50)
	at org.apache.poi.sl.draw.DrawSheet.draw(DrawSheet.java:50)
	at org.apache.poi.sl.draw.DrawSlide.draw(DrawSlide.java:41)
	at org.apache.poi.xslf.usermodel.XSLFSlide.draw(XSLFSlide.java:373)
	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)
java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException

```

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [December 13, 2023, 9:53pm UTC](https://forum.inductiveautomation.com/t/apache-poi-returns-java-lang-noclassdeffounderror-javax-xml-bind-jaxbexception/83113/2 "2023-12-13T21:53:56Z")

</div>

Anything change if you execute this in Gateway scope instead?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [December 13, 2023, 9:57pm UTC](https://forum.inductiveautomation.com/t/apache-poi-returns-java-lang-noclassdeffounderror-javax-xml-bind-jaxbexception/83113/3 "2023-12-13T21:57:18Z")

</div>

Is that JAXB exception something something Java EE?  
Weird that it works at all, if that's the case, but I don't really know.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [December 13, 2023, 10:12pm UTC](https://forum.inductiveautomation.com/t/apache-poi-returns-java-lang-noclassdeffounderror-javax-xml-bind-jaxbexception/83113/4 "2023-12-13T22:12:23Z")

</div>

He's calling code that is trying to load an XML file via JAXB, and the assumption that JAXB would just "be there" stopped being valid in Java 11.

Java 11+ you need to include the JAXB libraries separately. It looks like we may include them in the Gateway, but not in the Client/Designer.

This is ultimately a failure of the POI library, or our version of it, in that it needs to declare explicit dependencies on a JAXB API and implementation. Later versions may already do that.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [December 14, 2023, 11:40am UTC](https://forum.inductiveautomation.com/t/apache-poi-returns-java-lang-noclassdeffounderror-javax-xml-bind-jaxbexception/83113/5 "2023-12-14T11:40:10Z")

</div>

> [@Kevin.Herron](#):
>
> This is ultimately a failure of the POI library

I would agree here. It does look they got got rid of the JAXB dependency in POI v5. Is v5 anywhere on the roadmap?

In the meantime, I'll try to take it through the gateway scope and see if that helps.

---

<div class="post-metadata">

**Author:** ![jspecht](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jspecht/32/6465_2.png) [@jspecht](https://forum.inductiveautomation.com/u/jspecht)\
**Post date:** [December 14, 2023, 2:22pm UTC](https://forum.inductiveautomation.com/t/apache-poi-returns-java-lang-noclassdeffounderror-javax-xml-bind-jaxbexception/83113/6 "2023-12-14T14:22:06Z")

</div>

> [@JordanCClark](#):
>
> Is v5 anywhere on the roadmap?

It's not formally on a roadmap but there is a ticket (IGN-5969) seeking to upgrade POI all the way to the latest v5 to eliminate some CVEs. So this might happen in the near future...

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [December 14, 2023, 2:24pm UTC](https://forum.inductiveautomation.com/t/apache-poi-returns-java-lang-noclassdeffounderror-javax-xml-bind-jaxbexception/83113/7 "2023-12-14T14:24:27Z")

</div>

Thanks Joel, I'm going to back-burner this for now, as work is starting to get in the way. 😉

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [February 7, 2024, 7:29pm UTC](https://forum.inductiveautomation.com/t/apache-poi-returns-java-lang-noclassdeffounderror-javax-xml-bind-jaxbexception/83113/8 "2024-02-07T19:29:29Z")

</div>

Apache POI is now upgraded to 5.2.5. It will be in the 8.1 nightlies tonight.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [February 21, 2024, 5:10pm UTC](https://forum.inductiveautomation.com/t/apache-poi-returns-java-lang-noclassdeffounderror-javax-xml-bind-jaxbexception/83113/9 "2024-02-21T17:10:32Z")

</div>

Update:

Just spun up a VM with 8.1.38-rc1. Getting the same JAXB error in the designer, though it runs successfully in the gateway.

I can work with it, but it just makes things a bit more convoluted whilst working in vision.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [February 21, 2024, 5:14pm UTC](https://forum.inductiveautomation.com/t/apache-poi-returns-java-lang-noclassdeffounderror-javax-xml-bind-jaxbexception/83113/10 "2024-02-21T17:14:04Z")

</div>

We ended up reverting the POI version bump at the last minute, because it was causing other issues via a transitive dependency update. So no changes in 8.1.38, but should be in some 8.1 version "soon" ™

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [February 21, 2024, 5:15pm UTC](https://forum.inductiveautomation.com/t/apache-poi-returns-java-lang-noclassdeffounderror-javax-xml-bind-jaxbexception/83113/11 "2024-02-21T17:15:53Z")

</div>

Ah. Then I'm EagerlyAwaitingTM.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [February 22, 2024, 8:56pm UTC](https://forum.inductiveautomation.com/t/apache-poi-returns-java-lang-noclassdeffounderror-javax-xml-bind-jaxbexception/83113/12 "2024-02-22T20:56:54Z")

</div>

> [@Kevin.Herron](#):
>
> Java 11+ you need to include the JAXB libraries separately. It looks like we may include them in the Gateway, but not in the Client/Designer.

Just circling back for a moment. Would it be better to include JAXB in the Client/Designer, or just wait until the proper fix for the CVEs comes along?

Asking for a friend. 😉

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 22, 2024, 9:13pm UTC](https://forum.inductiveautomation.com/t/apache-poi-returns-java-lang-noclassdeffounderror-javax-xml-bind-jaxbexception/83113/13 "2024-02-22T21:13:48Z")

</div>

You could try including them as a temporary fix, but adding things to the lib/core folders is always a temporary fix, in that the next upgrade, or gateway backup and restore elsewhere, will require manual intervention to add them back again.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [February 22, 2024, 9:18pm UTC](https://forum.inductiveautomation.com/t/apache-poi-returns-java-lang-noclassdeffounderror-javax-xml-bind-jaxbexception/83113/14 "2024-02-22T21:18:20Z")

</div>

I wasn't meaning me, I'm too lazy. I was thinking IA in a future release. 🤪

At this point though, it seems we're six of one and half-dozen of the other.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 22, 2024, 9:31pm UTC](https://forum.inductiveautomation.com/t/apache-poi-returns-java-lang-noclassdeffounderror-javax-xml-bind-jaxbexception/83113/15 "2024-02-22T21:31:58Z")

</div>

No dice. Among other reasons, new dependencies in that scope increase the amount of crap the Client/Designer has to download.

POI will get upgraded because of the CVE, it was just the timing that required a revert instead of a fix.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [July 29, 2024, 7:25pm UTC](https://forum.inductiveautomation.com/t/apache-poi-returns-java-lang-noclassdeffounderror-javax-xml-bind-jaxbexception/83113/16 "2024-07-29T19:25:07Z")

</div>

Resurrecting this for a moment. The change log is saying that we upgraded to 4.1.2. Will v5 make it to Ignition 8.1 or will this be more of an 8.3 thing?

> [@Nightly 8.1 Changelogs - 2024](https://forum.inductiveautomation.com/t/nightly-8-1-changelogs-2024/83608/46):
>
> Nightly Changelog: 8.1.39-SNAPSHOT-b20240312 Security Security IGN-9236: Bump jose4j Dependency to address potential DoS Vulnerability Bumped jose4j dependency from v0.9.3 to v0.9.5 to address a potential DoS vulnerability Reporting Reporting IGN-9273: Upgrade Apache POI from 3.17 to 4.1.2 to remove mandatory log4j dependency, retest IGN-5969 Upgrade Apache POI from 3.17 to 4.1.2 Perspective Perspective IGN-1181: Add tabindex to meta props schema, emit into rendered component if appropriate …

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 29, 2024, 7:28pm UTC](https://forum.inductiveautomation.com/t/apache-poi-returns-java-lang-noclassdeffounderror-javax-xml-bind-jaxbexception/83113/17 "2024-07-29T19:28:53Z")

</div>

Now that it has been upgraded to 4.1.2 and no longer triggers security scans because of a vulnerable dependency there is no stakeholder and no tickets for further upgrading this in any version of Ignition right now.
