Spring boot - Unable to proxy interface-implementing method - WARN message

ROZZ picture ROZZ · Mar 17, 2018 · Viewed 7.9k times · Source

guys. 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 caused this WARNing, but it seems that I get them from another place. How to know from where I receive these warnings ?

Answer

ROZZ picture ROZZ · Mar 20, 2018

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 :)