Search code examples
springaopaspectjspring-webfluxreactive

Aspects on Webflux acting funky


I am developing code for both MVC and Webflux endpoints. I have written AspectJ code for Autologging, pretty standard.

But, whenever I apply this Autologging code for Webflux endpoints, there seems to be a memory leak and when I stop the server, it closes with a warning.

2018-11-21 17:49:25.456  INFO [webflux-async_logback,,,] 6174 --- [on(2)-127.0.0.1] inMXBeanRegistrar$SpringApplicationAdmin : Application shutdown requested.


WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.catalina.loader.WebappClassLoaderBase (file:/Users/ahallim/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/9.0.12/tomcat-embed-core-9.0.12.jar) to field java.io.ObjectStreamClass$Caches.localDescs
WARNING: Please consider reporting this to the maintainers of org.apache.catalina.loader.WebappClassLoaderBase
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Is writing Aspects for Webflux/Reactive code a bad idea? If yes, why? Is there anyway to address this and mitigate?

Thanks in advance


Solution

  • This was not a memory leak. Webflux and AOP work together just fine.