How to access jobParameters in SpringBatch as a bean?

大城市里の小女人 提交于 2019-12-06 07:12:36

The error indicates something different.

Cannot convert value of type [$Proxy13 implementing java.io.Serializable,org.springframework.aop.scope.ScopedObject,org.springframework.aop.framework.AopInfrastructureBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [com.test.components.TestBean] for property 'reconBean': no matching editors or conversion strategy found]

I think the problem is somewhere else and not by accessing to the job parameters.

P.S: Can you show the configuration where you define TestBean and set it's property reconBean?

I've seen this before - there is something creating an AOP proxy that the classloader is using instead of the concrete implementation of your class. I've solved this in the past by introducing an interface, then calling your getBean as follows:

FileDownloadReadable fileDownloadReader = applicationContext.getBean("fileDownloadReader", FileDownloadReadable.class);
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!