[resolved] problem with tFileExcelWorkbookOpen in karaf, v5.2.1

One Star

[resolved] problem with tFileExcelWorkbookOpen in karaf, v5.2.1

Hi all,
is someone have problem with the use of tFileExcelWorkbookOpen component in Karaf with a job called by a cTalendJob in a route?
It works fine in Studio, but not in Karaf.
It seems to be an api conflict between xml apis: SAX in component and Xerces embedded in Karaf, i don't know how i can resolve it properly.
I have a message like this if i use a component which use xml api with the excel component in the same job(like extractxmlfield or trouteinput, or others...):

org.dom4j.DocumentException:SAX2 driver class org.apache.xerces.parsers.SAXParser does not implement XMLReader Nested exception: SAX2 driver class org.apache.xerces.parsers.SAXParser does not implement XMLReader


Add libraryload component with saxon.jar, saxon-dom.jar, dom4j.jar, poi..all-dependancies.jar doesn't resolve the problem.
It looks like to work if i add a BundleID property in the xx_java.xml file of the excel component and if i add the POI...all_dependancy.jar in the deploy folder of Karaf. But i don't like this solution because i don't want to have sides effects with others bundles deployed (with the POI...all-dependancy.jar deployed as bundle).
This problem talking to someone?
thanks.
Xavier
One Star

Re: [resolved] problem with tFileExcelWorkbookOpen in karaf, v5.2.1

I tested with the latest v5.5.1, the problem is the same...
Seventeen Stars

Re: [resolved] problem with tFileExcelWorkbookOpen in karaf, v5.2.1

It looks like an incompatibility between the xml-api jar which comes with the apache poi api and the xml implementation shipped with the Karaf container. The component does not carries a xml parser, it uses the default parser from the JVM.
Could you tell me what xml parser implementation the Karaf container uses?
The jar file shipped with the component contains the classes of the following jars:
poi-ooxml-3.10-FINAL.jar 
poi-3.10-FINAL.jar
commons-codec-1.5.jar
poi-ooxml-schemas-3.10-FINAL.jar
xmlbeans-2.3.0.jar
stax-api-1.0.1.jar
dom4j-1.6.1.jar
xml-apis-1.0.b2.jar
You can remove my jar and use these jar and if you find another implementation of one of them you could try to use the existing one shipped with the Karaf container.
One Star

Re: [resolved] problem with tFileExcelWorkbookOpen in karaf, v5.2.1

I Jan,
thanks for your answer!
I think karaf embedded  org.xml.sax in the JRE default package, but there is xerces too as default package deployed with the camel-core bundle.
I'll try to separate API's and add sax or xerces to jar files in the component.
I'll tell you if it works.
Xavier
One Star

Re: [resolved] problem with tFileExcelWorkbookOpen in karaf, v5.2.1

It works!
I build the <CODEGENERATION> section of the java.xml file of tFileExcelWorkbookOpen component like this (with .jar corresponding):
<CODEGENERATION>
    <IMPORTS>
   <IMPORT NAME="tFileExcelPOI" MODULE="de.jar" REQUIRED="true"/>
 <IMPORT NAME="xmlbeans" MODULE="xmlbeans-2.3.0.jar" REQUIRED="true" />
 <IMPORT NAME="commons-codec" MODULE="commons-codec-1.5.jar" REQUIRED="true"/>
 <IMPORT NAME="dom4j" MODULE="dom4j-1.6.1.jar" REQUIRED="true"/>
 <IMPORT NAME="poi-ooxml" MODULE="poi-ooxml-3.10-FINAL.jar" REQUIRED="true"/>
 <IMPORT NAME="poi-ooxml-schemas" MODULE="poi-ooxml-schemas-3.10-FINAL.jar" REQUIRED="true"/>
 <IMPORT NAME="stax-api" MODULE="stax-api-1.0.1.jar" REQUIRED="true"/>
 <IMPORT NAME="xml-apis" MODULE="xml-apis-1.0.b2.jar" REQUIRED="true"/>
 <IMPORT NAME="poi" MODULE="poi-3.10-FINAL.jar" REQUIRED="true"/>
</IMPORTS>
  </CODEGENERATION>

Xavier