mock-server / mockserver

MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby. MockServer also includes a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding).
http://mock-server.com
Apache License 2.0
4.54k stars 1.07k forks source link

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

Open stavrogin opened 1 year ago

stavrogin commented 1 year ago

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

juangrases commented 9 months ago

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?

markvr commented 4 months ago

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