【发布时间】:2018-11-21 13:06:50
【问题描述】:
我正在为 MVC 和 Webflux 端点开发代码。我已经为 Autologging 编写了 AspectJ 代码,非常标准。
但是,每当我为 Webflux 端点应用此自动日志记录代码时,似乎都会出现内存泄漏,当我停止服务器时,它会关闭并发出警告。
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
为 Webflux/Reactive 代码编写 Aspects 是个坏主意吗?如果是,为什么?有没有办法解决这个问题并缓解?
提前致谢
【问题讨论】:
-
为什么该警告表示内存泄漏?没有这样的提及......即使没有方面,也会出现此消息(至少它发生在我身上)。它与 tomcat 执行一些 Java 10+ 中已弃用的反射调用有关。
-
我认为系统速度急剧下降时可能存在内存泄漏。但是,看到您的评论,我无法重现该问题。到目前为止,Webflux 上的 Aspects 运行良好。谢谢。
标签: spring aop aspectj spring-webflux reactive