AppClassLoader 错误无法确定缺少类型的已实现接口...编织类型时

AppClassLoader error can't determine implemented interfaces of missing type ... when weaving type

[AppClassLoader@18b4aac2] error can't determine implemented interfaces of missing type org.springframework.cache.ehcache.EhCacheCacheManager
when weaving type org.springframework.boot.autoconfigure.cache.EhCacheCacheConfiguration
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[AppClassLoader@18b4aac2] error can't determine implemented interfaces of missing type org.springframework.cache.ehcache.EhCacheCacheManager
when weaving type org.springframework.boot.autoconfigure.cache.EhCacheCacheConfiguration
when weaving classes 
when weaving 

这些警告实际上是关于什么的?
我在我的应用程序中创建了一个 @Aspect class,它工作正常。
我的知识atm并不深。只有我知道当应用程序将我的方面编织到应该使用它的 classes 时存在的那一刻。
警告让我感到困惑。为什么该应用要编织我在此日志中看到的 classes?

PS stackoverflow 给了我如何避免警告的答案 (aop.xml)。但我想知道这个警告最初的原因是什么。会不会是以后的问题。

前言:欢迎来到SO。请为每个问题提供 MCVE,了解如何提出更好的问题。在这种情况下,我不得不推测根本原因可能是什么,因为您遗漏了最重要的事情:代码和 Spring 配置。我通常不喜欢推测,但在这种情况下,我相当确定我的猜测是正确的。不过,我可能是错的,这就是为什么猜测是个坏主意。这是您在这个平台上作为新手的免费机会。下次请问一个更好的问题。

看起来你的切入点太宽泛了,试图编织到所有现有的 Spring 组件中,包括 Spring 自己的组件,fox 示例 class EhCacheCacheConfiguration ,这是一个 Spring 启动 class。显然,class 引用 Spring 核心 class EhCacheCacheManager,在尝试将方面编织到配置 class 或其中之一时不可用components/beans 在那里声明。

这是一个 class 具有全局“编织整个世界”方面的逻辑引导问题。我认为 aop.xml 文件不会在这里帮助你,因为可能像大多数用户一样,你正在使用默认的 AOP 框架 Spring AOP,而不是原生的 AspectJ,但 aop.xml 只是用于 AspectJ 加载时编织配置。您要做的是通过向切入点添加类似 && within(my.target.package..*) 的内容来限制方面的目标范围。错误可能会消失。