jlolling / talendcomp_tJasperReportExec

Talend Component tJasperReportExec - Run JasperReports within Talend
Apache License 2.0
2 stars 1 forks source link

Incompatibility with tFileInPutExcel in TDI 6.3.1 #1

Closed lfrugere closed 6 years ago

lfrugere commented 6 years ago

Hello,

There's a mismatch with poi lib when using tFileInputExcel with Excel 2007 format and tJasperReportExec.

tFileInputExcel/tFileInputExcel_java.xml :

<IMPORT NAME="poi" MODULE="poi-3.11-20141221_modified_talend.jar" MVN="mvn:org.talend.libraries/poi-3.11-20141221_modified_talend/6.0.0"  UrlPath="platform:/plugin/org.talend.libraries.excel/lib/poi-3.11-20141221_modified_talend.jar" REQUIRED_IF="(VERSION_2007 == 'true')" />

tJasperReportExec/pom.xml :

<dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi-ooxml</artifactId>
    <version>3.16</version>
    <exclusions>
        <exclusion>
            <artifactId>stax-api</artifactId>
            <groupId>stax</groupId>
        </exclusion>
    </exclusions>
</dependency>

So when using both components in the same job, an exception occurs :

Exception in thread "main" java.lang.NoSuchMethodError: org.apache.poi.util.POILogger.log(ILjava/lang/Object;)V
at org.apache.poi.openxml4j.opc.PackageRelationshipCollection.parseRelationshipsPart(PackageRelationshipCollection.java:313)
at org.apache.poi.openxml4j.opc.PackageRelationshipCollection.<init>(PackageRelationshipCollection.java:163)
at org.apache.poi.openxml4j.opc.PackageRelationshipCollection.<init>(PackageRelationshipCollection.java:131)
at org.apache.poi.openxml4j.opc.PackagePart.loadRelationships(PackagePart.java:559)
at org.apache.poi.openxml4j.opc.PackagePart.<init>(PackagePart.java:112)
at org.apache.poi.openxml4j.opc.PackagePart.<init>(PackagePart.java:83)
at org.apache.poi.openxml4j.opc.PackagePart.<init>(PackagePart.java:128)
at org.apache.poi.openxml4j.opc.ZipPackagePart.<init>(ZipPackagePart.java:78)
at org.apache.poi.openxml4j.opc.ZipPackage.getPartsImpl(ZipPackage.java:243)
at org.apache.poi.openxml4j.opc.OPCPackage.getParts(OPCPackage.java:673)
at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:226)
at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:186)
at org.apache.poi.POIXMLDocument.openPackage(POIXMLDocument.java:74)
at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:296)

Except desactivating 2007 feature, do you have any suggestion ?

Thanks in advance,

Lionel

jlolling commented 6 years ago

Sorry for the huge delayed answer. This happens because Talend uses for its own components out-dated libraries. I use as much as I can the latest libraries - in this case the Apache POI library from Talend is very out dated and I am unable to fall back to such an old version of POI. You can use my tFileExcelSheetOutput component to do the same with Excel - and much better ;-) This component also use the latest Apache POI library.