I have a unit test and the only thing I get is a stack overflow as follows:
java.lang.StackOverflowError
at org.apache.logging.log4j.util.StackLocator.getCallerClass(StackLocator.java:125)
at org.apache.logging.log4j.util.StackLocatorUtil.getCallerClass(StackLocatorUtil.java:55)
at org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:42)
at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:46)
at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)
at org.apache.logging.slf4j.SLF4JLoggerContext.getLogger(SLF4JLoggerContext.java:39)
at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:37)
at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:29)
at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:52)
at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)
... many more
I am tring to use log4j and slf4j. I have excluded logback if I dont i get a diferent error about casting log4j context to slf4j context.
I have cut down the build.gradle file to the minimum dependacies:
testCompile ('org.springframework.boot:spring-boot-starter-test'){
exclude group: 'ch.qos.logback', module: 'logback-classic'
}
testCompile 'com.fedex.gss.extras:gss-extras-base'
testCompile 'org.mockito:mockito-core'
testCompile('junit:junit')
plus importing the BOM for log4j and springboot.
Any ideas?
Many thanks.