You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Akash (Jira)" <ji...@apache.org> on 2020/04/23 18:07:00 UTC

[jira] [Created] (MSHADE-362) Exception while relocating Apache POI OOXML Schema Dependency

Akash created MSHADE-362:
----------------------------

             Summary: Exception while relocating Apache POI OOXML Schema Dependency
                 Key: MSHADE-362
                 URL: https://issues.apache.org/jira/browse/MSHADE-362
             Project: Maven Shade Plugin
          Issue Type: Bug
    Affects Versions: 3.2.3
            Reporter: Akash


Trying to create a fat jar using latest version of maven shade plugin.

Relocating package of apache poi ooxml schema and xmlbeans dependency.

 
{code:java}
/<relocation>
  <pattern>org.apache.xmlbeans.</pattern>
  <shadedPattern>shaded.org.apache.xmlbeans.</shadedPattern>
</relocation>
<relocation>
  <pattern>schemaorg_apache_xmlbeans.</pattern>
  <shadedPattern>shaded.schemaorg_apache_xmlbeans.</shadedPattern>
</relocation>
<relocation>
  <pattern>org.openxmlformats.</pattern>
  <shadedPattern>shaded.org.openxmlformats.</shadedPattern>
</relocation>/
{code}
 

Class Cast exception is coming 

Caused by: java.lang.ClassCastException: shaded.org.apache.xmlbeans.impl.values.XmlComplexContentImpl cannot be cast to shaded.org.openxmlformats.schemas.wordprocessingml.x2006.main.DocumentDocument

On analysis found that, we are reading document2bd9doctype.xsb file present in poi-ooxml-schema jar during run time and class name given in the xsb file is not getting changed during execution. Hence unable to find the correct class.

XSB file - poi-ooxml-schemas-3.12.jar!\schemaorg_apache_xmlbeans\system\sE130CAA0A01A7CDE5A2B4FEB8B311707\document2bd9doctype.xsb

 

Class Name in xsb file - org.openxmlformats.schemas.wordprocessingml.x2006.main.DocumentDocument



--
This message was sent by Atlassian Jira
(v8.3.4#803005)