Skip to content

AutowireUtils requires ObjectFactory to be Serializable [SPR-7264] #11923

@spring-projects-issues

Description

@spring-projects-issues

Kenny MacLeod opened SPR-7264 and commented

Since Spring 3.0, AutowireUtils.resolveAutowiringValue() has required that all ObjectFactory-implementing classes also implement Serializable. This means that when passing an ObjectFactory to ConfigurableListableBeanFactory.registerResolvableDependency(), this must be Serializable.

This was not the case in 2.5.6, however, and so code written to use this facility will not work in 3.0.x unless Serializable is introduced. This is invasive to the client code, and in many cases is highly inappropriate.

I'm not sure why this check is being made. AutowireUtils is constructing a ObjectFactoryDelegatingInvocationHandler which also implements Serializable, but there doesn't seem to be a reason for this.

Can this check be removed?


Affects: 3.0 GA, 3.0.1, 3.0.2

Referenced from: commits cc23820

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions