6 Replies Latest reply on Mar 14, 2017 3:39 PM by Sławomir Wojciechowski

    XmlItemReader

    Sławomir Wojciechowski Newbie

      Hello,

      I work on proces that get data from xml file na load it to csv. My simple xml batch file is:

      <job id="libra" version="1.0" xmlns="http://xmlns.jcp.org/xml/ns/javaee">

          <step id="load">

              <chunk>

              <reader ref="xmlItemReader">

                      <properties>

                          <property name="resource" value="/home/sla/data_in.xml"/>

                          <property name="beanType" value="pl.test.domain.DataIn"/>

                      </properties>

                  </reader>

                 <processor ref="dataInItemProcessor">

                 </processor>

                

                 <writer ref="csvItemWriter">

                      <properties>

                      <property name="resource" value="/home/sla/data_out.csv""/>

                          <property name="writeMode" value="overwrite"/>

                          <property name="preference" value="STANDARD_PREFERENCE"/>

                          <property name="delimiterChar" value=","/>

                          <property name="quoteChar" value="^"/>

                          <property name="beanType" value="pl.test.domain.DataIn"/>

        </properties>

                  </writer>

                 

              </chunk>

          </step>

      </job>

       

      I have add to pom file all dependecies (https://jberet.gitbooks.io/jberet-user-guide/content/xmlitemreader_and_xmlitemwriter/index.html ). When I start my job I got error:

       

      19:26:16,030 ERROR [org.jberet] (Batch Thread - 1) JBERET000007: Failed to run job libra, load, org.jberet.job.model.Step@3607133b: java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.SerializationConfig.withDefaultPrettyPrinter(Lcom/fasterxml/jackson/core/PrettyPrinter;)Lcom/fasterxml/jackson/databind/SerializationConfig;

        at com.fasterxml.jackson.dataformat.xml.XmlMapper.<init>(XmlMapper.java:86) [jackson-dataformat-xml-2.8.1.jar:2.8.1]

        at com.fasterxml.jackson.dataformat.xml.XmlMapper.<init>(XmlMapper.java:67) [jackson-dataformat-xml-2.8.1.jar:2.8.1]

        at org.jberet.support.io.XmlItemReaderWriterBase.initXmlFactory(XmlItemReaderWriterBase.java:79) [jberet-support-1.2.0.Final.jar:1.2.0.Final]

        at org.jberet.support.io.XmlItemReader.open(XmlItemReader.java:107) [jberet-support-1.2.0.Final.jar:1.2.0.Final]

        at org.jberet.runtime.runner.ChunkRunner.run(ChunkRunner.java:181) [jberet-core-1.0.2.Final.jar:1.0.2.Final]

        at org.jberet.runtime.runner.StepExecutionRunner.runBatchletOrChunk(StepExecutionRunner.java:205) [jberet-core-1.0.2.Final.jar:1.0.2.Final]

        at org.jberet.runtime.runner.StepExecutionRunner.run(StepExecutionRunner.java:138) [jberet-core-1.0.2.Final.jar:1.0.2.Final]

        at org.jberet.runtime.runner.CompositeExecutionRunner.runStep(CompositeExecutionRunner.java:164) [jberet-core-1.0.2.Final.jar:1.0.2.Final]

        at org.jberet.runtime.runner.CompositeExecutionRunner.runFromHeadOrRestartPoint(CompositeExecutionRunner.java:88) [jberet-core-1.0.2.Final.jar:1.0.2.Final]

        at org.jberet.runtime.runner.JobExecutionRunner.run(JobExecutionRunner.java:58) [jberet-core-1.0.2.Final.jar:1.0.2.Final]

        at org.wildfly.jberet.services.BatchEnvironmentService$WildFlyBatchEnvironment$1.run(BatchEnvironmentService.java:144) [wildfly-jberet-8.1.0.Final.jar:8.1.0.Final]

        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_101]

        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_101]

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_101]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_101]

        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_101]

        at org.jboss.threads.JBossThread.run(JBossThread.java:122)

       

      I don't know where is the problem. It looks that all required libs are in war file.

       

      Best regards

      sw