Skip to content

Subclasses of ApplicatonObjectSupport can no longer be proxied via CGLIB [SPR-2237] #6927

@spring-projects-issues

Description

@spring-projects-issues

Chris Lee opened SPR-2237 and commented

The latest nightly build (2.0RC2 b69) fails to proxy beans whose implementation inherits from ApplicationObjectSupport.

With RC1, the following messages were logged:

10:36:58.469 INFO [Cglib2AopProxy] Unable to proxy method [public final org.springframework.context.ApplicationContext org.springframework.context.support.ApplicationObjectSupport.getApplicationContext() throws java.lang.IllegalStateException] because it is final: All calls to this method via a proxy will be routed directly to the proxy. [] [main]
10:36:58.469 INFO [Cglib2AopProxy] Unable to proxy method [public final void org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(org.springframework.context.ApplicationContext) throws org.springframework.beans.BeansException] because it is final: All calls to this method via a proxy will be routed directly to the proxy. [] [main]

With RC2b69, an exception is thrown with the following message:

Cannot proxy class 'bridges.facade.aa.AuthenticationFacadeImpl' since it has one or more public final methods.

...it looks like the implementation of Cglib2AopProxy.doValidateClass changed between RC1 & RC2b69.

One workaround would be to use JDK proxies, which works for this specific object; however, we have a number of legacy objects (now Spring-proxied for txns), which is why CGLIB proxying is enabled.


Affects: 2.0 RC2

Metadata

Metadata

Assignees

No one assigned

    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