My problem is that I'm building spring-boot project and I'm using class A from some other project which use log4j 1.2.8. When I force spring to use log4j 1.2.8 I have following error:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jettyEmbeddedServletContainerFactory' defined in class path resource [org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfiguration$EmbeddedJetty.class]: Initialization of bean failed; nested excepti
on is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.boot.autoconfigure.web.ServerProperties org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration.properties; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serverProperties' defined in class path resource [org/springframework/boot/autoconfigure/web/ServerPropertiesAutoConfiguration.class]: Initialization of bean failed; nested exception is java.lang.NoSuchFieldError: TRACE
Spring need at least log4j 1.2.12, so when I use this version of log4j my A class have follwing error:
java.lang.NoSuchMethodError: org.apache.log4j.LogManager.exists(Ljava/lang/String;)Lorg/apache/log4j/Logger;
There is any solution other than upgrade of my A class log4j? Maybe there is any way to force at runtime some classes should use log4j 1.2.8 and other would use 1.2.12 ?