You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CGLIB proxy cannot be created for class containing a final afterPropertiesSet() method #35365
Implementing a subclass of WebServiceGatewaySupport and deploying it within Spring Boot, you will see the following log message:
025-08-21T13:32:25.007+02:00 WARN 97214 --- [XXX] [ restartedMain] o.s.aop.framework.CglibAopProxy : Unable to proxy interface-implementing method [public final void org.springframework.ws.client.core.support.WebServiceGatewaySupport.afterPropertiesSet() throws java.lang.Exception] because it is marked as final, consider using interface-based JDK proxies instead.
Please remove the final keyword in order to prevent this WARN message from being logged. See also here why this is logged.
We can't make such a change based on what you've described. There's no sample and no indication of the version you are using. FWIW, the final modifier is intentional: it prevents sub-classes to skip the initialization that WebServiceGatewaySupport needs. Also, the issue you've referenced is 8 years old so I don't think this is something we could blindly use to make a decision.
If you want to pursue this, please create a small sample from start.spring.io that reproduces the problem you've described. You can attach the sample here or push the code to a separate GitHub repository.
It seems that the WARN logging appears due to the @Timed annotation from the micrometer library in conjunction with spring-boot-starter-actuator and spring-boot-starter-aop.
Thanks for the sample. This is in no way specific to Spring WS. I can replicate with a bare-bone project that doesn't use it at all, see https://github.com/snicoll-scratches/spring-ws-1675. Running it leads to:
2025-08-21T15:26:33.877+02:00 INFO 91564 --- [ main] com.example.demo.DemoApplication : Starting DemoApplication using Java 17.0.16 with PID 91564 (/Users/snicoll/Downloads/gh-1675/out/production/classes started by snicoll in /Users/snicoll/Downloads/gh-1675)
2025-08-21T15:26:33.878+02:00 INFO 91564 --- [ main] com.example.demo.DemoApplication : No active profile set, falling back to 1 default profile: "default"
2025-08-21T15:26:33.999+02:00 WARN 91564 --- [ main] o.s.aop.framework.CglibAopProxy : Unable to proxy interface-implementing method [public final void com.example.demo.TestSupport.afterPropertiesSet() throws java.lang.Exception] because it is marked as final, consider using interface-based JDK proxies instead.
2025-08-21T15:26:34.036+02:00 INFO 91564 --- [ main] com.example.demo.DemoApplication : Started DemoApplication in 0.285 seconds (process running for 0.441)
We can't remove the final modifier for the reason you've described as it would mean we'd have to chase down every single use of such pattern to be consistent.
I wonder if Spring Framework could do something about this. We'll move this issue there to see what we can do.
changed the title [-]Do not make WebServiceGatewaySupport.afterPropertiesSet() final[/-][+]Proxying a class that inherit from a base class that locks down afterPropertiesSet leads to a warning[/+]on Aug 21, 2025
changed the title [-]Proxying a class that inherit from a base class that locks down afterPropertiesSet leads to a warning[/-][+]CGLIB proxy cannot be created for class containing a final `afterPropertiesSet()` method[/+]on Aug 21, 2025
Activity
snicoll commentedon Aug 21, 2025
We can't make such a change based on what you've described. There's no sample and no indication of the version you are using. FWIW, the
finalmodifier is intentional: it prevents sub-classes to skip the initialization thatWebServiceGatewaySupportneeds. Also, the issue you've referenced is 8 years old so I don't think this is something we could blindly use to make a decision.If you want to pursue this, please create a small sample from start.spring.io that reproduces the problem you've described. You can attach the sample here or push the code to a separate GitHub repository.
siom79 commentedon Aug 21, 2025
I have setup a minimal project reproducing the described issue: https://github.com/siom79/spring-boot-starter-web-services-issue. You can clone it and run
./gradlew bootRun.It seems that the WARN logging appears due to the
@Timedannotation from the micrometer library in conjunction withspring-boot-starter-actuatorandspring-boot-starter-aop.snicoll commentedon Aug 21, 2025
Thanks for the sample. This is in no way specific to Spring WS. I can replicate with a bare-bone project that doesn't use it at all, see https://github.com/snicoll-scratches/spring-ws-1675. Running it leads to:
We can't remove the
finalmodifier for the reason you've described as it would mean we'd have to chase down every single use of such pattern to be consistent.I wonder if Spring Framework could do something about this. We'll move this issue there to see what we can do.
[-]Do not make WebServiceGatewaySupport.afterPropertiesSet() final[/-][+]Proxying a class that inherit from a base class that locks down afterPropertiesSet leads to a warning[/+][-]Proxying a class that inherit from a base class that locks down afterPropertiesSet leads to a warning[/-][+]CGLIB proxy cannot be created for class containing a final `afterPropertiesSet()` method[/+]sbrannen commentedon Aug 24, 2026
Suppress CGLIB validation WARN for lifecycle callbacks