4 Replies Latest reply on Nov 8, 2018 1:55 PM by Cheng Fang

    beanIOItemWriter Invalid writer property value for key resource

    Richard Moore Master

      I am getting - JBERET060000: Invalid reader or writer property value mytest.out for key resource

       

      Here is the jsl -

       

      <chunk item-count="1000">

      <reader ref="beanIOItemReader">

      <properties>

      <property name="resource" value="RPE_ThirdPartyDealsScan_Sorted_20181105_105330.csv"/>

      <property name="streamName" value="ThrdPrtyDlsInputAllFlds" />

      <property name="streamMapping" value="src/com/awginc/rpe/map/xml/ThrdPrtyDlsInputAllFlds.xml" />

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

      <property name="skipBeanValidation" value="true" />

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

      </properties>

      </reader>

       

         <processor ref="com.awginc.rpe.item.RPEThirdPartyDealsScanProcessor">

        <properties>

           <property name="dataSourceLookup" value="jdbc/db2/batapp/db2pdba"/>

           <property name="errorFile" value="RPE_ThirdPartyDealsScan_Sorted_20181105_105330.err"/>

        </properties>

         </processor>

        

         <writer ref="beanIOItemWriter">

      <properties>

      <property name="resource" value="mytest.out"/>

      <property name="streamName" value="ThrdPrtyDlsOutputMap" />

      <property name="streamMapping" value="src/com/awginc/rpe/map/xml/ThrdPrtyDlsOutputMap.xml" />

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

      <property name="columnSeparator" value="|" />

      </properties>

      </writer>

      </chunk>

        • 1. Re: beanIOItemWriter Invalid writer property value for key resource
          Cheng Fang Master

          what's the complete stacktrace?  It could be some IOException as the root cause when accessing the writer output file.

          • 2. Re: beanIOItemWriter Invalid writer property value for key resource
            Richard Moore Master

            Sorry about that, I knew I should send all of it.

             

            2018-11-07 16:21:47.091 jberet-1         RPEThirdPartyDealsScanProcessor - INFO  errorFile = RPE_ThirdPartyDealsScan_Sorted_20181105_105330.err

            2018-11-07 16:21:47.328 jberet-1                                  jberet - ERROR item-count=1000, time-limit=0, skip-limit=-1, skipCount=0, retry-limit=-1, retryCount=0

            2018-11-07 16:21:47.331 jberet-1                                  jberet - ERROR JBERET000007: Failed to run job RPE_Daily_ThirdPartyDealsScan, processData, org.jberet.job.model.Chunk@3987edb1

            javax.batch.operations.BatchRuntimeException: JBERET060000: Invalid reader or writer property value mytest.out for key resource

            at org.jberet.support.io.ItemReaderWriterBase.newFileOutputStream(ItemReaderWriterBase.java:222) ~[jberet-support-1.3.0.Final.jar:?]

            at org.jberet.support.io.ItemReaderWriterBase.getOutputStream(ItemReaderWriterBase.java:183) ~[jberet-support-1.3.0.Final.jar:?]

            at org.jberet.support.io.BeanIOItemWriter.open(BeanIOItemWriter.java:48) ~[jberet-support-1.3.0.Final.jar:?]

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

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

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

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

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

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

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

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

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

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

            • 3. Re: beanIOItemWriter Invalid writer property value for key resource
              Cheng Fang Master

              looks like the writer class is trying to get the parent directory of your output file, which returns null, because you've specified "mytest.out" for it.

               

              jberet-support/ItemReaderWriterBase.java at master · jberet/jberet-support · GitHub

               

              The file "mytest.out" will be created under the current working directory.  As a workaround, you can include the path prefix, for example,

               

              "./mytest.out", or "/users/abc/test/mytest.out"