9 Replies Latest reply on Oct 5, 2016 11:05 AM by Richard Moore

    Fixed formatted records

    Richard Moore Master

      I have tried to duplicate the BeanIO example for the star-entities and am getting the following -

       

      2016-10-04 15:38:01.006 [jberet-1    ]                         jberet - [ERROR] ProcessingInfo{count=0, timerExpired=false, itemState=RUNNING, chunkState=RUNNING, checkpointPosition=-1, readPosition=0, failurePoint=null}

      2016-10-04 15:38:01.037 [jberet-1    ]                         jberet - [ERROR] item-count=10, time-limit=0, skip-limit=-1, skipCount=0, retry-limit=-1, retryCount=0

      2016-10-04 15:38:01.065 [jberet-1    ]                         jberet - [ERROR] JBERET000007: Failed to run job Jberet_Adhoc_TestCase3, step1, org.jberet.job.model.Chunk@f905252

      java.lang.NullPointerException

        at org.jberet.support.io.ItemReaderWriterBase.validate(ItemReaderWriterBase.java:92) ~[jberet-support-1.3.0.Beta3.jar:?]

        at org.jberet.support.io.BeanIOItemReader.readItem(BeanIOItemReader.java:119) ~[jberet-support-1.3.0.Beta3.jar:?]

        at org.jberet.runtime.runner.ChunkRunner.readItem(ChunkRunner.java:359) ~[jberet-core-1.3.0.Beta3.jar:1.3.0.Beta3]

        at org.jberet.runtime.runner.ChunkRunner.readProcessWriteItems(ChunkRunner.java:305) ~[jberet-core-1.3.0.Beta3.jar:1.3.0.Beta3]

        at org.jberet.runtime.runner.ChunkRunner.run(ChunkRunner.java:201) [jberet-core-1.3.0.Beta3.jar:1.3.0.Beta3]

        at org.jberet.runtime.runner.StepExecutionRunner.runBatchletOrChunk(StepExecutionRunner.java:226) [jberet-core-1.3.0.Beta3.jar:1.3.0.Beta3]

        at org.jberet.runtime.runner.StepExecutionRunner.run(StepExecutionRunner.java:147) [jberet-core-1.3.0.Beta3.jar:1.3.0.Beta3]

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

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

        at org.jberet.runtime.runner.JobExecutionRunner.run(JobExecutionRunner.java:60) [jberet-core-1.3.0.Beta3.jar:1.3.0.Beta3]

        at org.jberet.spi.JobExecutor$1.run(JobExecutor.java:99) [jberet-core-1.3.0.Beta3.jar:1.3.0.Beta3]

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_73]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_73]

        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_73]

       

      I downloaded the ca2013entities_ascii.txt file and the org.jberet.support.io.CaliforniaStarEntity source from gitHub, and am using the step -

       

      <chunk>

        <reader ref="beanIOItemReader">

                      <properties>

                          <property name="resource" value="#{systemProperties['APP_DATA_PERSISTENT_FCLTY']}/#{systemProperties['batchJobname']}.txt"/>

                          <property name="streamName" value="star-entities"/>

                          <property name="streamMapping" value="#{systemProperties['APP_PARMS_FCLTY']}/#{systemProperties['batchJobname']}_Bean.xml"/>

                          <property name="mappingProperties" value="zipCodeFieldName=zipCode, zipCodeFieldType=string"/>

                          <property name="errorHandler" value="org.beanio.BeanReaderErrorHandlerSupport"/>

                          <property name="charset" value="UTF-8"/>

                      </properties>

                  </reader>

                  <writer ref="beanIOItemWriter">

                      <properties>

                          <property name="resource" value="#{systemProperties['APP_DATA_TMP_FCLTY']}/#{systemProperties['batchJobname']}.out"/>

                          <property name="streamName" value="star-entities"/>

                          <property name="streamMapping" value="#{systemProperties['APP_PARMS_FCLTY']}/#{systemProperties['batchJobname']}_Bean.xml"/>

                          <property name="mappingProperties" value="zipCodeFieldName=zipCode, zipCodeFieldType=string"/>

                          <property name="charset" value="UTF-8"/>

                      </properties>

                  </writer>

        </chunk>

       

      Got any ideas what I have wrong? Also, is this the best way to process fixed format records?