1 Reply Latest reply on Aug 9, 2016 2:20 PM by cfang

    Failed to create artifact with ref name jdbcItemReader

    richardmoore

      I am using the ref jdbcItemReader without any issues, but when a teammate copies my source and classpath they are getting the JBERET000600: Failed to create artifact with ref name jdbcItemReader. Is there a batch.xml that defines this ref to class? If so, where is it located? What are we missing?

        • 1. Re: Failed to create artifact with ref name jdbcItemReader
          cfang

          First check for META-INF/beans.xml in the classpath, for CDI SE to discover jdbcItemReader.

           

          jdbcItemReader has class-level @Named annotation so should be automatically discovered already by CDI SE if the above beans.xml is present.

           

          META-INF/batch.xml can bind a ref name to its class name, if the above still does not solve the problem, though I think it should:

           

          <?xml version="1.0" encoding="UTF-8"?>

          <batch-artifacts xmlns="http://xmlns.jcp.org/xml/ns/javaee">
            <ref id="csvItemReader" class="org.jberet.support.io.CsvItemReader" />
            <ref id="jsonItemWriter" class="org.jberet.support.io.JsonItemWriter" />

           

            <ref id="whateverRefName" class="org.jberet.support.io.JdbcItemReader" />
          </batch-artifacts>