Announcement Announcement Module
Collapse
No announcement yet.
Set scope on HdfsScriptFactoryBean?? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Set scope on HdfsScriptFactoryBean??

    Is there any way to set the scope on the HdfsScriptFactoryBean bean that is automatically used by the <script-tasklet>

    in short this is what I want to do:

    <script-tasklet id="csv-import-tasklet" scope="step" >
    <script location="cp-data.js">
    <property name="localResource" value="#{jobParameters[csv-file]}" />
    </script>
    </script-tasklet>


    In addition I would like to pass jobParameters into the job:

    <job id="csv-to-cube-MR-job" scope="step"
    properties-location="#{jobParameters[properties-file]}"
    configuration-ref="hbaseConfiguration"
    input-path="${input}"
    output-path="${output}"
    mapper="haruspex.etl.csv.CsvToCubeMapper"
    reducer="haruspex.etl.csv.CsvToCubeReducer"
    validate-paths="false"
    />

    this results in a proxy conversion error:

    Caused by: java.lang.IllegalStateException: Cannot convert value of type [$Proxy14 implementing org.springframework.aop.scope.ScopedObject,java.io .Serializable,org.springframework.aop.framework.Ao pInfrastructureBean,org.springframework.aop.Spring Proxy,org.springframework.aop.framework.Advised] to required type [org.apache.hadoop.mapreduce.Job] for property 'job': no matching editors or conversion strategy found


    When I add:

    <beans:bean class="org.springframework.batch.core.scope.StepSc ope">
    <beansroperty name="proxyTargetClass" value="true"/>
    </beans:bean>


    I get:

    Caused by: java.io.FileNotFoundException: class path resource [#{jobParameters[properties-file]}] cannot be opened because it does not exist

    as if I didn't have the scope set.


    Thanks
    Last edited by ebersoless; Jun 12th, 2012, 11:37 AM.
Working...
X