java - 正在加载重复的 Spring 配置?

标签 java spring tomcat

我正在查看由 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/

相关文章:

java - Java 8 与 Java 9 中的 Stream.peek() 方法

java - 如何实现 Multi-Tenancy Spring Boot 应用程序(每个用户都有自己的数据库)

java - 为什么我的 Spring 应用程序无法识别有人已经登录?

java - 如何在基于 Spring 的 Java 应用程序中的每个请求中添加唯一的 UUID

linux - Tomcat7 绑定(bind)到 shell

java - 如何优化这个更新 SQL 查询

java - 在 Eclipse 中,动态布局中弹出的文本链接

java - Spring 中/** 和/* 的区别

eclipse - no-eclipse tomcat 环境变量等效

tomcat - JVM 堆转储 : The memory is accumulated in one instance of "java. util.concurrent.ConcurrentHashMap$Segment