Closed Bing-ok closed 3 years ago
Thanks for reporting and including a solution.
For my information, was this when compiling WhiteRabbit yourself or using the released distribution? If so, what branch/version were you using?
I used the latest master branch. This happened when compile and test it myself.
Thanks for your support!
Issue description:
There are multiple versions of org.apache.poi:poi-ooxml-schemas in rabbit-core. As shown in the following dependency tree, according to Maven's "nearest wins" strategy, only org.apache.poi:poi-ooxml-schemas:3.9 can be loaded, org.apache.poi:poi-ooxml-schemas:3.17 will be shadowed.
However, several methods defined in shadowed version org.apache.poi:poi-ooxml-schemas:3.17 are referenced by client project via org.apache.poi:poi-ooxml:3.17 but missing in the actually loaded version org.apache.poi:poi-ooxml-schemas:3.9.
For instance, the following missing method(defined in org.apache.poi:poi-ooxml-schemas:3.17) are actually referenced by rabbit-core, which will introduce a runtime error(i.e., "NoSuchMethodError") into rabbit-core.
com.microsoft.schemas.office.visio.x2012.main.MasterContentsDocument$Factory: com.microsoft.schemas.office.visio.x2012.main.MasterContentsDocument parse(java.io.InputStream) is invoked by rabbit-core via the following path:
com.microsoft.schemas.office.visio.x2012.main.MastersDocument$Factory: com.microsoft.schemas.office.visio.x2012.main.MastersDocument parse(java.io.InputStream) is invoked by rabbit-core via the following path:
com.microsoft.schemas.office.visio.x2012.main.PageContentsDocument$Factory: com.microsoft.schemas.office.visio.x2012.main.PageContentsDocument parse(java.io.InputStream) is invoked by rabbit-core via the following path:
com.microsoft.schemas.office.visio.x2012.main.PagesDocument$Factory: com.microsoft.schemas.office.visio.x2012.main.PagesDocument parse(java.io.InputStream) is invoked by rabbit-core via the following path:
Suggested fixing solutions:
Upgrade direct dependency org.apache.poi:poi-ooxml-schemas from 3.9 to 3.17. Because version 3.17 includes the above missing methods and is compatible with versions 3.9 in the project. This repair will introduce the following new conflicts, but these conflicts are benign (will not cause runtime exceptions). Conflict: org.apache.xmlbeans:xmlbeans versions: [2.3.0, /2.6.0]
Thank you very much for your attention. Best regards,
Dependency tree----