You're right.  Thank you, Yegor.  I swapped out the 3.17-beta1 jars in Solr for 
the 3.17 jars, and I'm not getting that exception any more.

Onward!

Cheers,

                Tim

-----Original Message-----
From: Yegor Kozlov [mailto:yegor.koz...@dinom.ru] 
Sent: Wednesday, November 29, 2017 5:50 AM
To: POI Developers List <dev@poi.apache.org>
Subject: Re: classloading xsbs for pptx

It seems to be fixed in 3.17. The snippet below fails with 3.16 but works fine 
with  3.17 and  trunk

public static void main( String[] args ) throws Exception {
    Thread thread = Thread.currentThread();
    ClassLoader cl = thread.getContextClassLoader();

    Thread th = new Thread(() -> {
        try {
            XMLSlideShow ppt = new XMLSlideShow(new FileInputStream(args[0]));
            for (XSLFSlide slide : ppt.getSlides()) {
                List<XSLFShape> shapes = slide.getShapes();
            }
        } catch (Exception e){
            e.printStackTrace(); // prints
"java.lang.IllegalStateException: Schemas (*.xsb) for CTTable can't be loaded " 
with poi-3.16
        }
    });
    th.setContextClassLoader(cl.getParent());
    th.start();
    th.join();

}

Tim, you should be good to release with poi-3.17, the fix is already there.


Yegor


On Wed, Nov 29, 2017 at 2:25 AM, Andreas Beeker <kiwiwi...@apache.org>
wrote:

> Hi Tim,
>
> last time when I've introduced the setClassLoader() method, it was 
> helpful to have a minimal maven project to showcase the error.
> Can you setup a sample project?
>
> When I changed the ClassLoader code last time with #61478, I've also 
> used the same sample project [1]
>
> Andi
>
> [1] https://github.com/glucazeau/test-poi-sling
>
>
>

Reply via email to