5 Replies Latest reply on Dec 1, 2018 8:56 AM by cfang

    beanIOItemWriter Invalid writer property value for key resource

    richardmoore

      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
          cfang

          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
            richardmoore

            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
              cfang

              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"

              • 4. Re: beanIOItemWriter Invalid writer property value for key resource
                cfang

                This issue is tracked in JBERET-460

                • 5. Re: beanIOItemWriter Invalid writer property value for key resource
                  cfang

                  the fix is included in jberet-support 1.3.3.Final release (released on 2018-11-29), and jberet-support 1.4.0.Beta1 release (released on 2018-11-26).