Java – Duplicate spring configurations being loaded

javaspringtomcat

I'm looking at the output from spring being loaded up by tomcat and there's something very strange…Everything is duplicated. What would cause this? Whatever it is, it's causing my application to run in odd ways.

Additional Info:

The application is a web app. All the spring information is loaded using the context loader(?) defined in the web.xml file. My configuration files are split amoung 6 (or so) files.

Example debug output:

[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

Best Answer

Are you sure that something in the logging configuration isn't adding each category/logger to the appender more than once?

That's something that's possible with log4j, not sure about JCL or whatever the latest version of Tomcat uses under the cover.