-
Jun 12th, 2012, 09:40 AM
#1
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">
<beans
roperty 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 at 10:37 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules