0

I originally was looking at this answer to create charts in Powerpoint and had an additional question as below:

Thanks for the above. Your example standalone works fine for me and I see the generated PPTX file ok. But when I try integrate it into my proper application I see the below exception at runtime.

Schemas (.xsb) for CTTable can't be loaded - usually this happens when OSGI loading is used and the thread context classloader has no reference to the xmlbeans classes - use POIXMLTypeLoader.setClassLoader() to set the loader, e.g. with CTTable.class.getClassLoader()*

When I googled I found mention of this issue: It shows in the code this comment:

// Pesky XmlBeans bug - see Bugzilla #49934 
// it never happens when using the full ooxml-schemas jar but may happen with the abridged poi-ooxml-schemas

Did you have any similiar issues to this? Can you tell me what versions of "poi-ooxml" (I'm using v3.17) and "poi" (I'm using v3.17) your using, or indeed share your pom.xml would be great.

If anyone could give any guidance, that would be great.

Thanks - Ro

Geshode
  • 3,600
  • 6
  • 18
  • 32
Silmarillion
  • 207
  • 4
  • 12
  • 1
    Have you tried using the `ooxml-schemas-1.3.jar` instead of the `poi-ooxml-schemas...jar`, as mentioned in [Apache POI Frequently Asked Questions](https://poi.apache.org/help/faq.html) -> 3. I'm using the poi-ooxml-schemas jar, but my code is failing...? If not, try that. And please do removing all dependencies to `poi-ooxml-schemas...jar` in favor of `ooxml-schemas-1.3.jar`. – Axel Richter Jul 25 '18 at 08:27
  • Hi Axel, thanks for the quick response. Yes I've done as you suggested, my code is using ooxml-schemas-1.3.jar now and not poi-ooxml-schemas-3.17.jar. I had to add a maven dependency inclusion to specifically exclude this as the poi-ooxml-3.17.jar was in fact pulling down the poi-ooxml-schemas-3.17 jar file. I can see in my environment now (well in my .m2 repo that this latter file is not getting pulled down. However I'm still seeing the same issue. – Silmarillion Jul 25 '18 at 12:50
  • Then I cannot help since I am not using that OSGI environment. Maybe others can help. – Axel Richter Jul 25 '18 at 13:01
  • I would try a [POI nightly](https://builds.apache.org/view/P/view/POI/job/POI-DSL-1.8/lastSuccessfulBuild/artifact/build/dist/) first - regarding OSGi, I've [changed something](https://bz.apache.org/bugzilla/show_bug.cgi?id=62564) even yesterday. If you have [time for experiments](https://stackoverflow.com/questions/51239464), you can reach me at my [apache mail](https://stackoverflow.com/users/2066598/kiwiwings?tab=profile) – kiwiwings Jul 25 '18 at 18:34
  • Hi kiwiwings - great thanks I'll look into using a POI nightly and will let you know how it goes. thanks Ronan. – Silmarillion Jul 26 '18 at 10:07
  • Hi again - can't see to find your Apache email on that page :-( wanted to send you a message re not being able to grab the nightly from maven (rather than manual download), thanks – Silmarillion Jul 26 '18 at 11:39
  • @Silmarillion: ... my email address is kiwiwings (at) apache.org ... if you want to use arbitrary files instead of the default maven repo, you need to use a local repository [here](https://github.com/kiwiwings/pptx-shape-exporter/blob/master/Pptx-Shape-Exporter/pom.xml) is an example – kiwiwings Jul 26 '18 at 21:47

0 Answers0