java - 无法转换类型“$Proxy55”的值

标签 java spring spring-batch

我编写的 Spring Batch 程序一切正常,直到我尝试重构 beans 的名称和相应的类名称,然后我才开始遇到异常

Error creating bean with name
'org.springframework.batch.core.configuration.xml.SimpleFlowFactoryBean#3':
Cannot create inner bean '(inner bean)#6aed4066' of type
[org.springframework.batch.core.job.flow.support.StateTransition] while
setting bean property 'stateTransitions' with key [24]; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name '(inner bean)#6aed4066': Cannot create inner bean '(inner 
bean)#7e1f1f61' of type
[org.springframework.batch.core.job.flow.support.state.StepState] while
setting constructor argument; nested exception is 
org.springframework.beans.factory.UnsatisfiedDependencyException: Error
creating bean with name '(inner bean)#7e1f1f61': Unsatisfied dependency
expressed through constructor argument with index 0 of type 
[org.springframework.batch.core.Step]: Could not convert constructor
argument value of type [$Proxy55] to...

因此,我试图了解 $Proxy 55 是什么以及为什么会发生此异常。

最佳答案

检查 spring 配置文件中每个 spring bean 的 id 属性后发现多个 spring bean 具有相同的 id,因此将它们更改为唯一 id 后问题得到解决

关于java - 无法转换类型“$Proxy55”的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43096619/

相关文章:

java - 我需要获取字数、字符数和行数 :

java - deleteCharAt() 从 Java 字符串中删除多个字符

json - Spring Web 服务和 Json

spring - 使用命令行(maven、Tomcat、spring、hibernate)从头开始创建 JEE 项目

java - spring-batch 读取 null int 值

java - 执行从抽象类派生的子类的静态 block

java - 生成球体顶点、索引和法线?

java - 什么是 Spring JMS 中的 JmsTemplate 回调?

java - Spring Batch - 如何从 ItemListenerSupport 访问 ExecutionContext

java - 如果 readCount 为零,如何跳过 itemWriter