'Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'step1': Initialization of bean fa
i'm creating an automatic process with Spring Batch, but when i'm creationg the XML File to define the configuration it's throwing me this error:
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'step1': Initialization of bean failed Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'com.konecta.tpvsemselavon.batch.task.Pruebajaja$$EnhancerBySpringCGLIB$$630a5c43' to required type 'org.springframework.batch.core.step.tasklet.Tasklet' for property 'tasklet'; nested exception is java.lang.IllegalStateException: Cannot convert value of type 'com.konecta.tpvsemselavon.batch.task.Pruebajaja$$EnhancerBySpringCGLIB$$630a5c43' to required type 'org.springframework.batch.core.step.tasklet.Tasklet' for property 'tasklet': no matching editors or conversion strategy found
My XML file is like that:
<import resource="applicationContext.xml" />
<context:annotation-config />
<context:component-scan
base-package="com.konecta.tpvsemselavon.batch" />
<!-- Aspecto de envio de correos ante errores inesperados -->
<aop:aspectj-autoproxy proxy-target-class="true"></aop:aspectj-autoproxy>
<aop:config>
<aop:aspect ref="correoAspectoErrores">
<aop:after-throwing method="enviarCorreo"
pointcut="execution(public * com.konecta.tpvsemselavon.batch.*.*.*(..))"
throwing="exception" />
</aop:aspect>
</aop:config>
<!-- Fin aspecto -->
<bean id="jobRepository"
class="org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean">
<property name="transactionManager"
ref="transactionManagerBatch" />
</bean>
<bean id="transactionManagerBatch"
class="org.springframework.batch.support.transaction.ResourcelessTransactionManager" />
<bean id="jobLauncher"
class="org.springframework.batch.core.launch.support.SimpleJobLauncher">
<property name="jobRepository" ref="jobRepository" />
</bean>
<!-- CLases de las tareas -->
<bean id="prueba" class="com.konecta.tpvsemselavon.batch.task.Pruebajaja" />
<bean id="finalTasklet"
class="com.konecta.tpvsemselavon.batch.task.FinalTasklet" />
<batch:job id="job">
<batch:step id="step1" next="stepFinal"> //seems it's failing here
<batch:tasklet ref="prueba">
</batch:tasklet>
</batch:step>
<batch:step id="stepFinal">
<batch:tasklet ref="finalTasklet">
</batch:tasklet>
</batch:step>
</batch:job>
What can be the problem?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
