我正在查看由 tomcat 加载的 spring 的输出,有一些非常奇怪的东西......一切都是重复的。什么会导致这个?不管是什么原因,它都会导致我的应用程序以奇怪的方式运行。
附加信息:
该应用程序是一个网络应用程序。所有 spring 信息都是使用 web.xml 文件中定义的上下文加载器(?)加载的。我的配置文件分为 6 个(左右)文件。
示例调试输出:
[DEBUG,DefaultFilterInvocationDefinitionSource,main] Added URL pattern: /
**
; attributes: [REQUIRES_SECURE_CHANNEL][DEBUG,DefaultFilterInvocationDefinitionSource,main] Added URL pattern: /
**
; attributes: [REQUIRES_SECURE_CHANNEL][DEBUG,DefaultFilterInvocationDefinitionSource,main] Added URL pattern: /
**
; attributes: [ROLE_READ, ROLE_UPDATE][DEBUG,DefaultFilterInvocationDefinitionSource,main] Added URL pattern: /
**
; attributes: [ROLE_READ, ROLE_UPDATE][DEBUG,AbstractFallbackMethodDefinitionSource,main] Adding security method [CacheKey[com.service.impl.FooServiceImpl; public abstract java.lang.Boolean com.service.IFooService.saveOrUpdateFoo(com.model.Foo2,java.lang.String) throws org.springframework.dao.DataAccessException]] with attribute [[ROLE_UPDATE]]
[DEBUG,AbstractFallbackMethodDefinitionSource,main] Adding security method [CacheKey[com.service.impl.FooServiceImpl; public abstract java.lang.Boolean com.service.IFooService.saveOrUpdateFoo(com.model.Foo2,java.lang.String) throws org.springframework.dao.DataAccessException]] with attribute [[ROLE_UPDATE]]
[INFO,AbstractSecurityInterceptor,main] Validated configuration attributes
[INFO,AbstractSecurityInterceptor,main] Validated configuration attributes
最佳答案
您确定日志记录配置中的某些内容没有将每个类别/记录器多次添加到附加程序吗?
这对 log4j 来说是可能的,不确定 JCL 或任何最新版本的 Tomcat 在幕后使用。
关于java - 正在加载重复的 Spring 配置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/244620/