mockserver icon indicating copy to clipboard operation
mockserver copied to clipboard

StackOverflow error when running unit test using JsonTest annotation and version 5.15.0

Open stavrogin opened this issue 2 years ago • 2 comments

Describe the issue StackOverflow error when executing a test with maven 3.6.3 including @JsonTest Spring Boot annotation It happens with 5.15.0 version; with 5.14.0 there is no issue

What you are trying to do I am running the following empty test:

@JsonTest
class SampleTest {
    @Test
    void empty() throws Exception {  }
}

MockServer version 5.15.0

To Reproduce Run the following unit test above with maven (from IntelliJ it works fine)

Expected behaviour Unit test runs without errors

MockServer Log java.lang.StackOverflowError

stavrogin avatar Feb 03 '23 15:02 stavrogin

I am also getting a stackoverflow since version 5.15.0, more specifically the exception is related with a circular dependency on the logging libraries:

java.lang.StackOverflowError
	at org.slf4j.helpers.FormattingTuple.<init>(FormattingTuple.java)
	at org.slf4j.helpers.MessageFormatter.arrayFormat(MessageFormatter.java:185)
	at org.slf4j.helpers.MessageFormatter.basicArrayFormat(MessageFormatter.java:170)
	at org.slf4j.jul.JDK14LoggerAdapter.innerNormalizedLoggingCallHandler(JDK14LoggerAdapter.java:146)
	at org.slf4j.jul.JDK14LoggerAdapter.log(JDK14LoggerAdapter.java:172)
	at org.slf4j.bridge.SLF4JBridgeHandler.callLocationAwareLogger(SLF4JBridgeHandler.java:221)
	at org.slf4j.bridge.SLF4JBridgeHandler.publish(SLF4JBridgeHandler.java:303)
	at java.logging/java.util.logging.Logger.log(Logger.java:980)
	at org.slf4j.jul.JDK14LoggerAdapter.innerNormalizedLoggingCallHandler(JDK14LoggerAdapter.java:156)
	at org.slf4j.jul.JDK14LoggerAdapter.log(JDK14LoggerAdapter.java:172)

Any idea on how to avoid this error?

juangrases avatar Nov 01 '23 12:11 juangrases

See https://github.com/mock-server/mockserver/issues/1660

markvr avatar Apr 04 '24 10:04 markvr