You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by Tobias Fink <fi...@fasihi.net> on 2019/02/25 14:48:42 UTC

References to org.apache.poi.POIXMLTypeLoader in ooxml-security-1.1.jar: NoClassDefFoundError

Hi,

in ooxml-security-1.1.jar in class "com.microsoft.schemas.office.x2006.encryption.EncryptionDocument" (in the inner class "Factory") there are references to the class "org.apache.poi.POIXMLTypeLoader" - which breaks at runtime with a NoClassDefFoundError, because the class is in package "org.apache.poi.ooxml.POIXMLTypeLoader" in poi-ooxml-4.0.1.jar.

I'm uncertain what I can do to clear this issue. In the class EncryptionDocument in poi-ooxml-schemas-4.0.1.jar the references are correct, but I cannot use this lib because it does not contain everything I need.

I cannot disclose the test document (it belongs to our customer), so here some more info about the error:

This is the method the error occurs in:

public static com.microsoft.schemas.office.x2006.encryption.EncryptionDocument parse(java.io.InputStream is, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
          return (com.microsoft.schemas.office.x2006.encryption.EncryptionDocument) org.apache.poi.POIXMLTypeLoader.parse( is, type, options ); }

Some way back on the stack:
[cid:image001.png@01D4CD1F.AE5567E0]


This is what the stacktrace could look like (I had to reconstruct it by hand, because the lib was compiled without debug infos):

java.lang.NoClassDefFoundError: org/apache/poi/POIXMLTypeLoader

at com.microsoft.schemas.office.x2006.encryption.EncryptionDocument.Factory.parse(EncryptionDocument:73)
at org.apache.poi.poifs.crypt.agile.AgileEncryptionInfoBuilder.parseDescriptor(AgileEncryptionInfoBuilder.java:104)
                at org.apache.poi.poifs.crypt.agile.AgileEncryptionInfoBuilder.initialize(AgileEncryptionInfoBuilder.java:40)
               at org.apache.poi.poifs.crypt.EncryptionInfo.<init>(EncryptionInfo.java:139)
               at org.apache.poi.poifs.crypt.EncryptionInfo.<init>(EncryptionInfo.java:88)
               at org.apache.poi.poifs.crypt.EncryptionInfo.<init>(EncryptionInfo.java:81)
               at org.apache.poi.ooxml.extractor.ExtractorFactory.createEncryptedOOXMLExtractor(ExtractorFactory.java:391)
               at org.apache.poi.ooxml.extractor.ExtractorFactory.createExtractor(ExtractorFactory.java:134)

Thank you and best regards,

Tobias Fink
Software Development

Fasihi GmbH - Donnersbergweg 4 - 67059 Ludwigshafen - Germany
Geschäftsführer Saeid Fasihi, Rolf Lutzer - Firmensitz Ludwigshafen a. Rh.
Amtsgericht Ludwigshafen - HRB 60601


AW: References to org.apache.poi.POIXMLTypeLoader in ooxml-security-1.1.jar: NoClassDefFoundError

Posted by Tobias Fink <fi...@fasihi.net>.
Hi,

sorry for the late reply.

We were able to get around the issue by not calling the createExtractor method. 
Honestly, I have no idea why we switched to ooxml-security-1.1.jar a long time ago, some classes were missing at runtime when we used poi-ooxml-schemas, and we didn't create a documentation for this issue.

As we can avoid the issue, I cannot spend any more time in investigating it. 

Thank you and best regards,

Tobias Fink
Software Development

Fasihi GmbH - Donnersbergweg 4 - 67059 Ludwigshafen - Germany
Geschäftsführer Saeid Fasihi, Rolf Lutzer - Firmensitz Ludwigshafen a. Rh.
Amtsgericht Ludwigshafen - HRB 60601

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


Re: References to org.apache.poi.POIXMLTypeLoader in ooxml-security-1.1.jar: NoClassDefFoundError

Posted by kiwiwings <ki...@apache.org>.
Hi Thomas,

the ooxml-security-1.1.jar is not compatible with poi-*-4.0.1.jar and this
is my fault, as I haven't updated the ooxml-security release. The original
reason are changes #60226 and #62355.

I assumed everything for encryption and signing should be provided by
poi-ooxml-schemas.
Which class/es do you miss?
... or even better, do you have junit test for it? ... so we can include the
necessary classes automatically on the OOXMLLite run

My temporary workaround would be, to compile the ooxml-security-1.* from the
source, but that will lead to duplicated classpath entries with
poi-ooxml-schemas - I'm not sure which side effects this will have.

Best wishes,
Andi



--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-Dev-f2312866.html

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