6

From Spring boot 1.5.x, I receive the following WARN messages:

     :: Spring Boot ::        (v2.0.0.RELEASE)

2018-03-17 18:58:18.546  WARN 27877 --- [  restartedMain] o.s.a.f.CglibAopProxy                    : Unable to proxy interface-implementing method [public final void org.springframework.web.context.support.WebApplicationObjectSupport.setServletContext(javax.servlet.ServletContext)] because it is marked as final: Consider using interface-based JDK proxies instead!
2018-03-17 18:58:18.551  WARN 27877 --- [  restartedMain] o.s.a.f.CglibAopProxy                    : Unable to proxy interface-implementing method [public final void org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(org.springframework.context.ApplicationContext) throws org.springframework.beans.BeansException] because it is marked as final: Consider using interface-based JDK proxies instead!
2018-03-17 18:58:18.937  WARN 27877 --- [  restartedMain] o.s.a.f.CglibAopProxy                    : Unable to proxy interface-implementing method [public final void org.springframework.web.context.support.WebApplicationObjectSupport.setServletContext(javax.servlet.ServletContext)] because it is marked as final: Consider using interface-based JDK proxies instead!
2018-03-17 18:58:18.938  WARN 27877 --- [  restartedMain] o.s.a.f.CglibAopProxy                    : Unable to proxy interface-implementing method [public final void org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(org.springframework.context.ApplicationContext) throws org.springframework.beans.BeansException] because it is marked as final: Consider using interface-based JDK proxies instead!
2018-03-17 18:58:19.034  WARN 27877 --- [  restartedMain] o.s.a.f.CglibAopProxy                    : Unable to proxy interface-implementing method [public final void org.springframework.web.context.support.WebApplicationObjectSupport.setServletContext(javax.servlet.ServletContext)] because it is marked as final: Consider using interface-based JDK proxies instead!
2018-03-17 18:58:19.035  WARN 27877 --- [  restartedMain] o.s.a.f.CglibAopProxy                    : Unable to proxy interface-implementing method [public final void org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(org.springframework.context.ApplicationContext) throws org.springframework.beans.BeansException] because it is marked as final: Consider using interface-based JDK proxies instead!
2018-03-17 18:58:19.136  WARN 27877 --- [  restartedMain] o.s.a.f.CglibAopProxy                    : Unable to proxy interface-implementing method [public final void org.springframework.web.context.support.WebApplicationObjectSupport.setServletContext(javax.servlet.ServletContext)] because it is marked as final: Consider using interface-based JDK proxies instead!
2018-03-17 18:58:19.136  WARN 27877 --- [  restartedMain] o.s.a.f.CglibAopProxy                    : Unable to proxy interface-implementing method [public final void org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(org.springframework.context.ApplicationContext) throws org.springframework.beans.BeansException] because it is marked as final: Consider using interface-based JDK proxies instead!

I don't have CGLIB in the dependency hierarchy. I'm using only interfaces for DI and I've tried to disable @EnableGlobalMethodSecurity(securedEnabled = true) and everything related to it, but still no change. (I've read that MethodSecurity and @Secured annotations in the Controller Classes can cause this WARNing, but it seems that I get them from another place. How to know from where I receive these warnings?

3 Answers 3

2

The problem was with some @Transactional annotations on a Class level. After I put them on the interfaces (Repositories - I'm using spring data) Everything is OK :)

Sign up to request clarification or add additional context in comments.

Comments

2

After checking @Transactional annotation, make sure u put your @Repository annotation directly to repository interface. In my case I did the following:

  1. Removed @Transactional and @Repository from my DAO class
  2. Put @Repository to my repo interface
  3. Put @Component to my DAO class

See Spring Boot + Annotations for more info about annotations

Comments

0

Based on the reported issue, I have faced same issue like having interface-implementing method with final.

From the concrete class (Bean) if we remove final from method , also solved the same issue.

Ref: https://github.com/spring-projects/spring-boot/issues/8974

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.