You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Guillaume Lucazeau <gl...@gmail.com> on 2016/08/11 14:19:13 UTC

XSLFTable is empty when generated on Apache Felix/Sling server, works fine from standalone code

Hello,

We use Apache POI 3.14 to generate a PPTX document from Apache Sling
content, using the bundle org.apache.servicemix.bundles.poi.

For testing content we created a very light OSGi bundle, with one servlet
and one method to generate a small table:

    XMLSlideShow ppt = new XMLSlideShow();

    // XSLFSlide#createSlide() with no arguments creates a blank slide
    XSLFSlide slide = ppt.createSlide();

    XSLFTable tbl = slide.createTable(1, 2);
    tbl.setAnchor(new Rectangle2D.Double(0, 0, 500, 500));

    FileOutputStream out = new FileOutputStream("/path/to/doc.pptx");
    ppt.write(out);
    out.close();

    ppt.close();

When this code runs from a JUnit test in Eclipse, the table is correctly
generated. But when we deploy this in Felix and execute the doc from a
servlet, the table in the generated document is only one empty cell.

In debugging mode, we can see that XSLFTable objects contains rows and
cells, but in the XSLFSlide, the related shape does not contain rows and
cells, just:

<main1:tbl>
  <main1:tblPr/>
  <main1:tblGrid/>
</main1:tbl>

What could interact with POI in Felix environment? How shapes are updated
from creates XSLF objects?

Any track to debug this strange issue would be really helpful.

Thank you for your help

Guillaume

Re: XSLFTable is empty when generated on Apache Felix/Sling server, works fine from standalone code

Posted by Andreas Beeker <ki...@apache.org>.
Just for closing this issue officially - this has been verified already a while ago and there's now a workaround via [1]

Andi

[1] https://bz.apache.org/bugzilla/show_bug.cgi?id=60226

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: XSLFTable is empty when generated on Apache Felix/Sling server, works fine from standalone code

Posted by Andreas Beeker <ki...@apache.org>.
A short follow-up on this:
I can reproduce the error and it seems to be a classloader issue.
I'm now trying to change the POIXMLTypeLoader to use an user given class loader - maybe that helps ...

Andi


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: XSLFTable is empty when generated on Apache Felix/Sling server, works fine from standalone code

Posted by Andreas Beeker <ki...@apache.org>.
On 16.08.2016 10:12, Guillaume Lucazeau wrote:
> I have created a very small bundle here:
> https://github.com/glucazeau/test-poi-sling
> If you're willing to test, you should find everything to install Sling and
> deploy the bundle in the README. If not, just tell me and I'll provide
> missing information.

Hi Guillaume,

thank you for preparing a test project - unfortunately I can't respond within the next
few days as a de-/encryption feature is driving me nuts, i.e. the existing XOR obfuscation is flawed
and I've only recently noticed it when I've implemented the encryption routines.

Best wishes,
Andi


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: XSLFTable is empty when generated on Apache Felix/Sling server, works fine from standalone code

Posted by Guillaume Lucazeau <gl...@gmail.com>.
Hello Andreas,

Thank you for your reply, I have created a very small bundle here:
https://github.com/glucazeau/test-poi-sling
If you're willing to test, you should find everything to install Sling and
deploy the bundle in the README. If not, just tell me and I'll provide
missing information.

On the project there is a branch with a different POM, to embed
ooxml-schemas-1.3 dependency, but it doesn't seem to solve the problem. I
really don't know what could make the code fail in a server environment,
while it works in standalone.

Thank you very much for your help

Guillaume


On Fri, Aug 12, 2016 at 8:31 PM, Andreas Beeker <ki...@apache.org>
wrote:

> Hi Guillaume,
>
> this issue pops up every now and then - see #54697.
> I guess this happens because of the mixed namespaces, but I can't point
> out, what the real reason for it is.
> Although this might be too heavy-weighted, what happens when you use the
> ooxml-schemas-1.3.jar? [1]
>
> Would you send me your example project?
> I might need your help of setting up Apache Sling/Felix (and OSGi?) as I
> haven't played around with those.
>
> Andi
>
> [1] http://poi.apache.org/faq.html#faq-N10025
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>

Re: XSLFTable is empty when generated on Apache Felix/Sling server, works fine from standalone code

Posted by Andreas Beeker <ki...@apache.org>.
Hi Guillaume,

this issue pops up every now and then - see #54697.
I guess this happens because of the mixed namespaces, but I can't point out, what the real reason for it is.
Although this might be too heavy-weighted, what happens when you use the ooxml-schemas-1.3.jar? [1]

Would you send me your example project?
I might need your help of setting up Apache Sling/Felix (and OSGi?) as I haven't played around with those.

Andi

[1] http://poi.apache.org/faq.html#faq-N10025




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org