Description
Yanming Zhou opened SPR-12329 and commented
I am using log4j, and using a custom system property "app.home" placeholder in log4j configuration.
<param name="file" value="${app.home}/logs/application.log"/>
set system property with a ServletContextListener.contextInitialized(), It works fine util I have more than one WebApplicationInitializers, after my investigation, I found it caused by SpringServletContainerInitializer
AnnotationAwareOrderComparator.sort(initializers);
AnnotationAwareOrderComparator depends on org.springframework.core.annotation.AnnotationUtils, AnnotationUtils used commons-logging, It will make my log4j premature, "app.home" will eval as empty since SpringServletContainerInitializer is executed before any ServletContextListener.contextInitialized().
please remove logging from AnnotationUtils, it's not useful. or use java.util.logging instead.
Affects: 4.0.7, 4.1.1
Issue Links:
- AnnotationUtils.findAnnotation fails with poor diagnostics if it encounters an Annotation that references an unloadable class [SPR-11874] #16493 AnnotationUtils.findAnnotation fails with poor diagnostics if it encounters an Annotation that references an unloadable class
- AnnotationUtils provides poor diagnostics if getDeclaredAnnotations throws an exception [SPR-12325] #16930 AnnotationUtils provides poor diagnostics if getDeclaredAnnotations throws an exception
Backported to: 4.0.8