I have recently started to use WireMock inside some integration tests within my play application.
I have found that when I run the test individually or as a whole class they seem to work fine but when run through Maven or when running the full suite of tests from within Intelij they fail for some strange reasons.
Maven
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00000001245bbd25, pid=1683, tid=356619
#
# JRE version: Java(TM) SE Runtime Environment (7.0_51-b13) (build 1.7.0_51-b13)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.51-b03 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# C [libnet.dylib+0x6d25] NET_Timeout+0x35a
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/jamesmorgan/workspace/backoffice/hs_err_pid1683.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Exception in thread "Thread-5" java.io.EOFException
at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2598)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1318)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
at sbt.React.react(ForkTests.scala:110)
at sbt.ForkTests$$anonfun$mainTestTask$1$Acceptor$2$.run(ForkTests.scala:69)
at java.lang.Thread.run(Thread.java:744)
[error] Error: Total 0, Failed 0, Errors 0, Passed 0
[error] Error during tests:
[error] Running java with options -classpath /Users/jamesmorgan/workspace/backoffice/target/scala-2.10/test-classes:/Users/jamesmorgan/workspace/backoffice/target/scala-2.10/classes:/Users/jamesmorgan/workspace/backoffice/lib/akka-actor_2.10-2.2.0.jar:/Users/jamesmorgan/workspace/backoffice/lib/akka-testkit_2.10-2.2.0.jar:/Users/jamesmorgan/workspace/backoffice/lib/angular-ui-bootstrap-0.10.0.jar:/Users/jamesmorgan/workspace/backoffice/lib/angularjs-1.2.16.jar:/Users/jamesmorgan/workspace/backoffice/lib/aopalliance-1.0.jar:/Users/jamesmorgan/workspace/backoffice/lib/async-http-client-1.7.18.jar:/Users/jamesmorgan/workspace/backoffice/lib/bootstrap-3.0.3.jar:/Users/jamesmorgan/workspace/backoffice/lib/bson4jackson-2.2.3.jar:/Users/jamesmorgan/workspace/backoffice/lib/classmate-0.8.0.jar:/Users/jamesmorgan/workspace/backoffice/lib/commons-lang-2.6.jar:/Users/jamesmorgan/workspace/backoffice/lib/commons-lang3-3.1.jar:/Users/jamesmorgan/workspace/backoffice/lib/commons-pool-1.5.5.jar:/Users/jamesmorgan/workspace/backoffice/lib/config-1.0.2.jar:/Users/jamesmorgan/workspace/backoffice/lib/data-0.1.0-20140424.134211-188.jar:/Users/jamesmorgan/workspace/backoffice/lib/data-1.0.16-20140423.095019-8.jar:/Users/jamesmorgan/workspace/backoffice/lib/deadbolt-core_2.10-2.2-RC4.jar:/Users/jamesmorgan/workspace/backoffice/lib/deadbolt-java_2.10-2.2-RC4.jar:/Users/jamesmorgan/workspace/backoffice/lib/dom4j-1.6.1.jar:/Users/jamesmorgan/workspace/backoffice/lib/el-api-2.2.jar:/Users/jamesmorgan/workspace/backoffice/lib/el-impl-2.2.jar:/Users/jamesmorgan/workspace/backoffice/lib/guava-14.0.1.jar:/Users/jamesmorgan/workspace/backoffice/lib/guice-3.0.jar:/Users/jamesmorgan/workspace/backoffice/lib/hamcrest-core-1.3.jar:/Users/jamesmorgan/workspace/backoffice/lib/hibernate-validator-5.0.1.Final.jar:/Users/jamesmorgan/workspace/backoffice/lib/internationalisation-1.0.16-20140423.095006-8.jar:/Users/jamesmorgan/workspace/backoffice/lib/jackson-annotations-2.2.2.jar:/Users/jamesmorgan/workspace/backoffice/lib/jackson-core-2.2.2.jar:/Users/jamesmorgan/workspace/backoffice/lib/jackson-core-asl-1.9.13.jar:/Users/jamesmorgan/workspace/backoffice/lib/jackson-databind-2.2.2.jar:/Users/jamesmorgan/workspace/backoffice/lib/jackson-datatype-joda-2.3.0.jar:/Users/jamesmorgan/workspace/backoffice/lib/jackson-mapper-asl-1.9.13.jar:/Users/jamesmorgan/workspace/backoffice/lib/java-dogstatsd-client-2.0.7.jar:/Users/jamesmorgan/workspace/backoffice/lib/javassist-3.18.0-GA.jar:/Users/jamesmorgan/workspace/backoffice/lib/javax.inject-1.jar:/Users/jamesmorgan/workspace/backoffice/lib/javax.servlet-api-3.0.1.jar:/Users/jamesmorgan/workspace/backoffice/lib/jboss-logging-3.1.1.GA.jar:/Users/jamesmorgan/workspace/backoffice/lib/jedis-2.1.0.jar:/Users/jamesmorgan/workspace/backoffice/lib/jetty-6.1.26.jar:/Users/jamesmorgan/workspace/backoffice/lib/jline-0.9.94.jar:/Users/jamesmorgan/workspace/backoffice/lib/joda-money-0.9.jar:/Users/jamesmorgan/workspace/backoffice/lib/joda-time-2.2.jar:/Users/jamesmorgan/workspace/backoffice/lib/jolt-core-0.0.12.jar:/Users/jamesmorgan/workspace/backoffice/lib/jongo-1.0.jar:/Users/jamesmorgan/workspace/backoffice/lib/jopt-simple-4.3.jar:/Users/jamesmorgan/workspace/backoffice/lib/jquery-2.0.3.jar:/Users/jamesmorgan/workspace/backoffice/lib/json-path-0.8.1.jar:/Users/jamesmorgan/workspace/backoffice/lib/json-smart-1.1.1.jar:/Users/jamesmorgan/workspace/backoffice/lib/json-utils-0.0.12.jar:/Users/jamesmorgan/workspace/backoffice/lib/jsonassert-1.2.3.jar:/Users/jamesmorgan/workspace/backoffice/lib/jsr305-2.0.1.jar:/Users/jamesmorgan/workspace/backoffice/lib/junit-4.11.jar:/Users/jamesmorgan/workspace/backoffice/lib/junit-dep-4.10.jar:/Users/jamesmorgan/workspace/backoffice/lib/kafka_2.10-0.8.0-beta1.jar:/Users/jamesmorgan/workspace/backoffice/lib/log4j-1.2.16.jar:/Users/jamesmorgan/workspace/backoffice/lib/logback-classic-1.0.13.jar:/Users/jamesmorgan/workspace/backoffice/lib/logback-core-1.0.13.jar:/Users/jamesmorgan/workspace/backoffice/lib/logback-jackson-0.1.2.jar:/Users/jamesmorgan/workspace/backoffice/lib/logback-json-classic-0.1.2.jar:/Users/jamesmorgan/workspace/backoffice/lib/logback-json-core-0.1.2.jar:/Users/jamesmorgan/workspace/backoffice/lib/logging-1.0.12-20140331.103938-33.jar:/Users/jamesmorgan/workspace/backoffice/lib/metrics-annotation-2.2.0.jar:/Users/jamesmorgan/workspace/backoffice/lib/metrics-core-2.2.0.jar:/Users/jamesmorgan/workspace/backoffice/lib/mockito-all-1.9.5.jar:/Users/jamesmorgan/workspace/backoffice/lib/mongo-java-driver-2.11.4.jar:/Users/jamesmorgan/workspace/backoffice/lib/netty-3.7.0.Final.jar:/Users/jamesmorgan/workspace/backoffice/lib/opencsv-2.3.jar:/Users/jamesmorgan/workspace/backoffice/lib/output-0.2-SNAPSHOT.jar:/Users/jamesmorgan/workspace/backoffice/lib/output-statsd-0.2-SNAPSHOT.jar:/Users/jamesmorgan/workspace/backoffice/lib/play-java_2.10-2.2.2.jar:/Users/jamesmorgan/workspace/backoffice/lib/reflections-0.9.8.jar:/Users/jamesmorgan/workspace/backoffice/lib/requirejs-2.1.10.jar:/Users/jamesmorgan/workspace/backoffice/lib/scala-compiler-2.10.2.jar:/Users/jamesmorgan/workspace/backoffice/lib/scala-library-2.10.3.jar:/Users/jamesmorgan/workspace/backoffice/lib/scala-reflect-2.10.3.jar:/Users/jamesmorgan/workspace/backoffice/lib/slf4j-api-1.7.5.jar:/Users/jamesmorgan/workspace/backoffice/lib/snakeyaml-1.12.jar:/Users/jamesmorgan/workspace/backoffice/lib/snappy-java-1.0.4.1.jar:/Users/jamesmorgan/workspace/backoffice/lib/spring-beans-3.2.3.RELEASE.jar:/Users/jamesmorgan/workspace/backoffice/lib/spring-context-3.2.3.RELEASE.jar:/Users/jamesmorgan/workspace/backoffice/lib/spring-core-3.2.3.RELEASE.jar:/Users/jamesmorgan/workspace/backoffice/lib/utils-akka-1.0.3-20140423.080750-4.jar:/Users/jamesmorgan/workspace/backoffice/lib/validation-api-1.1.0.Final.jar:/Users/jamesmorgan/workspace/backoffice/lib/webjars-locator-0.12.jar:/Users/jamesmorgan/workspace/backoffice/lib/webjars-play_2.10-2.2.1-2.jar:/Users/jamesmorgan/workspace/backoffice/lib/wiremock-1.46-standalone.jar:/Users/jamesmorgan/workspace/backoffice/lib/xml-apis-1.4.01.jar:/Users/jamesmorgan/workspace/backoffice/lib/xmlunit-1.5.jar:/Users/jamesmorgan/workspace/backoffice/lib/zkclient-0.3.jar:/Users/jamesmorgan/workspace/backoffice/lib/zookeeper-3.3.4.jar:/usr/local/Cellar/play/2.2.1/libexec/framework/sbt/boot/scala-2.10.2/lib/scala-library.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/com.typesafe.play/play_2.10/2.2.1/jars/play_2.10.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/com.typesafe.play/sbt-link/2.2.1/jars/sbt-link.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.javassist/javassist/3.18.0-GA/bundles/javassist.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/com.typesafe.play/play-exceptions/2.2.1/jars/play-exceptions.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/com.typesafe.play/templates_2.10/2.2.1/jars/templates_2.10.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/com.github.scala-incubator.io/scala-io-file_2.10/0.4.2/jars/scala-io-file_2.10.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/com.github.scala-incubator.io/scala-io-core_2.10/0.4.2/jars/scala-io-core_2.10.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/com.jsuereth/scala-arm_2.10/1.3/jars/scala-arm_2.10.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/com.typesafe.play/play-iteratees_2.10/2.2.1/jars/play-iteratees_2.10.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.scala-stm/scala-stm_2.10/0.7/jars/scala-stm_2.10.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/com.typesafe/config/1.0.2/bundles/config.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/com.typesafe.play/play-json_2.10/2.2.1/jars/play-json_2.10.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/com.typesafe.play/play-functional_2.10/2.2.1/jars/play-functional_2.10.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/com.typesafe.play/play-datacommons_2.10/2.2.1/jars/play-datacommons_2.10.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/joda-time/joda-time/2.2/jars/joda-time.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.joda/joda-convert/1.3.1/jars/joda-convert.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/com.fasterxml.jackson.core/jackson-annotations/2.2.2/jars/jackson-annotations.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/com.fasterxml.jackson.core/jackson-core/2.2.2/jars/jackson-core.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/com.fasterxml.jackson.core/jackson-databind/2.2.2/jars/jackson-databind.jar:/usr/local/Cellar/play/2.2.1/libexec/framework/sbt/boot/scala-2.10.2/lib/scala-reflect.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/io.netty/netty/3.7.0.Final/bundles/netty.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/com.typesafe.netty/netty-http-pipelining/1.1.2/jars/netty-http-pipelining.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.slf4j/slf4j-api/1.7.5/jars/slf4j-api.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.slf4j/jul-to-slf4j/1.7.5/jars/jul-to-slf4j.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.slf4j/jcl-over-slf4j/1.7.5/jars/jcl-over-slf4j.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/ch.qos.logback/logback-core/1.0.13/jars/logback-core.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/ch.qos.logback/logback-classic/1.0.13/jars/logback-classic.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/com.typesafe.akka/akka-actor_2.10/2.2.0/jars/akka-actor_2.10.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/com.typesafe.akka/akka-slf4j_2.10/2.2.0/bundles/akka-slf4j_2.10.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.apache.commons/commons-lang3/3.1/jars/commons-lang3.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/com.ning/async-http-client/1.7.18/jars/async-http-client.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/oauth.signpost/signpost-core/1.2.1.2/jars/signpost-core.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/oauth.signpost/signpost-commonshttp4/1.2.1.2/jars/signpost-commonshttp4.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/commons-logging/commons-logging/1.1.1/jars/commons-logging.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/xerces/xercesImpl/2.11.0/jars/xercesImpl.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/xml-apis/xml-apis/1.4.01/jars/xml-apis.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/javax.transaction/jta/1.1/jars/jta.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/com.typesafe.play/play-test_2.10/2.2.1/jars/play-test_2.10.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/junit/junit/4.11/jars/junit.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.hamcrest/hamcrest-core/1.3/jars/hamcrest-core.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.specs2/specs2_2.10/2.1.1/jars/specs2_2.10.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.scalaz/scalaz-core_2.10/7.0.2/bundles/scalaz-core_2.10.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.scalaz/scalaz-concurrent_2.10/7.0.2/bundles/scalaz-concurrent_2.10.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.scalaz/scalaz-effect_2.10/7.0.2/bundles/scalaz-effect_2.10.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/com.novocode/junit-interface/0.10/jars/junit-interface.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.scala-tools.testing/test-interface/0.5/jars/test-interface.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/com.google.guava/guava/14.0.1/bundles/guava.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/com.google.code.findbugs/jsr305/2.0.1/jars/jsr305.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.fluentlenium/fluentlenium-festassert/0.8.0/jars/fluentlenium-festassert.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.fluentlenium/fluentlenium-core/0.8.0/jars/fluentlenium-core.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.seleniumhq.selenium/selenium-java/2.32.0/jars/selenium-java.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.seleniumhq.selenium/selenium-android-driver/2.32.0/jars/selenium-android-driver.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.seleniumhq.selenium/selenium-remote-driver/2.32.0/jars/selenium-remote-driver.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/cglib/cglib-nodep/2.1_3/jars/cglib-nodep.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.json/json/20080701/jars/json.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.seleniumhq.selenium/selenium-api/2.32.0/jars/selenium-api.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.apache.httpcomponents/httpclient/4.2.1/jars/httpclient.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.apache.httpcomponents/httpcore/4.2.1/jars/httpcore.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/commons-codec/commons-codec/1.6/jars/commons-codec.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.apache.commons/commons-exec/1.1/jars/commons-exec.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/net.java.dev.jna/jna/3.4.0/jars/jna.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/net.java.dev.jna/platform/3.4.0/jars/platform.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.seleniumhq.selenium/selenium-chrome-driver/2.32.0/jars/selenium-chrome-driver.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.seleniumhq.selenium/selenium-htmlunit-driver/2.32.0/jars/selenium-htmlunit-driver.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/net.sourceforge.htmlunit/htmlunit/2.12/jars/htmlunit.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/xalan/xalan/2.7.1/jars/xalan.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/xalan/serializer/2.7.1/jars/serializer.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/commons-collections/commons-collections/3.2.1/jars/commons-collections.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.apache.httpcomponents/httpmime/4.2.3/jars/httpmime.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/net.sourceforge.htmlunit/htmlunit-core-js/2.12/jars/htmlunit-core-js.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/net.sourceforge.nekohtml/nekohtml/1.9.18/jars/nekohtml.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/net.sourceforge.cssparser/cssparser/0.9.9/jars/cssparser.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.w3c.css/sac/1.3/jars/sac.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/commons-io/commons-io/2.2/jars/commons-io.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.eclipse.jetty/jetty-websocket/8.1.9.v20130131/jars/jetty-websocket.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.eclipse.jetty/jetty-util/8.1.9.v20130131/jars/jetty-util.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.eclipse.jetty/jetty-io/8.1.9.v20130131/jars/jetty-io.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.eclipse.jetty/jetty-http/8.1.9.v20130131/jars/jetty-http.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.seleniumhq.selenium/selenium-firefox-driver/2.32.0/jars/selenium-firefox-driver.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.seleniumhq.selenium/selenium-ie-driver/2.32.0/jars/selenium-ie-driver.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.seleniumhq.selenium/selenium-iphone-driver/2.32.0/jars/selenium-iphone-driver.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.seleniumhq.selenium/selenium-safari-driver/2.32.0/jars/selenium-safari-driver.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.webbitserver/webbit/0.4.14/jars/webbit.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.seleniumhq.selenium/selenium-support/2.32.0/jars/selenium-support.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.easytesting/fest-assert/1.4/jars/fest-assert.jar:/usr/local/Cellar/play/2.2.1/libexec/repository/local/org.easytesting/fest-util/1.1.6/jars/fest-util.jar:/usr/local/Cellar/play/2.2.1/libexec/framework/sbt/boot/scala-2.10.2/org.scala-sbt/sbt/0.13.0/test-agent-0.13.0.jar:/usr/local/Cellar/play/2.2.1/libexec/framework/sbt/boot/scala-2.10.2/org.scala-sbt/sbt/0.13.0/test-interface-1.0.jar sbt.ForkMain 53309 failed with exit code 134
[error] (test:test) sbt.TestsFailedException: Tests unsuccessful
[error] Total time: 30 s, completed 25-Apr-2014 10:45:32
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
Intelij
java.net.SocketException: Invalid argument
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:152)
at java.net.SocketInputStream.read(SocketInputStream.java:122)
at wiremock.org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:166)
at wiremock.org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:90)
at wiremock.org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:281)
at wiremock.org.apache.http.impl.conn.LoggingSessionInputBuffer.readLine(LoggingSessionInputBuffer.java:115)
at wiremock.org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:92)
at wiremock.org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:62)
at wiremock.org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:254)
at wiremock.org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:289)
at wiremock.org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:252)
at wiremock.org.apache.http.impl.conn.ManagedClientConnectionImpl.receiveResponseHeader(ManagedClientConnectionImpl.java:191)
at wiremock.org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:300)
at wiremock.org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:127)
at wiremock.org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:717)
at wiremock.org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:522)
at wiremock.org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at wiremock.org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
at wiremock.org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:784)
at com.github.tomakehurst.wiremock.client.HttpAdminClient.postJsonAssertOkAndReturnBody(HttpAdminClient.java:146)
at com.github.tomakehurst.wiremock.client.HttpAdminClient.addStubMapping(HttpAdminClient.java:67)
at com.github.tomakehurst.wiremock.client.WireMock.register(WireMock.java:118)
at com.github.tomakehurst.wiremock.client.WireMock.givenThat(WireMock.java:61)
at com.github.tomakehurst.wiremock.client.WireMock.stubFor(WireMock.java:65)
at com.msm.backoffice.play.controllers.TasksControllerIntegrationTest.shouldResponseWithNullInstanceWhenCheckTaskDeploymentStatus(TasksControllerIntegrationTest.java:145)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at com.github.tomakehurst.wiremock.junit.WireMockRule$1.evaluate(WireMockRule.java:74)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runners.Suite.runChild(Suite.java:127)
at org.junit.runners.Suite.runChild(Suite.java:26)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Do you have any ideas on what would cause this issue, I'm kind of stuck and currently @Ignoring the tests?
In maven it still happens when you @Ignore the tests, you must comment out ht @Rule before its completes. I have attached a error log generated form the JVM issue, hopefully it may help.
I've never seen this one before. Pretty distressing that it's causing a JVM crash in the first instance.
Do you have anything unusual in your machine's network setup e.g. different drivers/libs that might alter the TCP socket implementation?
Bit of a long shot, but it might be worth putting this into the JVM args passed by Maven:
-Djava.net.preferIPv4Stack=true
Based on this (last comment):
http://stackoverflow.com/questions/8216713/java-net-socketexception-invalid-argument-connect
I'll give it ago. I dont think I've got anything unsualy i.e. Java 7 (latest), Mac OSX (latest), Play framework 2.2, Mongo. Ill give your suggestion ago and see what happens.
Failing that it might be worth running your Maven build inside a VM, which should help determine whether it's a platform or code related issue.
I've also tried it on two different machined and the same thing happens. I wondered if you have seen anything similar to the SocketException?
Were they also Macs or a different architecture?
I haven't seen anything like this before with WireMock, and I'm also running JDK 1.7.0_51 b13 on a Mac.
Another Mac, same setup really.
Just tried with -Djava.net.preferIPv4Stack=true and no luck, JVM blows up. Could be something to do with the Play integration tests I'm using it with.
In that case I'd definitely suggest running up a Linux VM and trying it there.
I guess if you think Play might be interfering with it, perhaps it's worth pulling them out into a separate project temporarily (with the Play JARs removed) and seeing if the tests still break.
I'm using it in the following manor : http://www.playframework.com/documentation/2.2.x/JavaTest
I use running(fakeApplication()) which in turns boots my app and I make various API calls. Prior to this I start WireMock to intercept come 3rd party API calls.
The strange thing is why do they work when running the class or individual test but fail when running as a batch. Its strange.
I agree that's very odd. I'm sorry I don't have more to suggest.
No worries, I'm going to ask a colleague with more play knowledge to have a look. Cheers, I'll update this if I found out how or why its happening.
I'm assuming this hasn't been resolved, seeing as there's no update with a solution. In any case, for the benefit of others, I've experienced this too and it turned out to be a bug in the JDK. Upgrading to JDK 7u60 resolved it for me. This happens to only affect Mac OS though.
Here's the SO question that pointed me in the right direction: http://stackoverflow.com/questions/16191236/tomcat-startup-fails-due-to-java-net-socketexception-invalid-argument-on-mac-o
And the link to the release notes for JDK 7u60: http://www.oracle.com/technetwork/java/javase/2col/7u60-bugfixes-2202029.html
HTH
Thanks for taking the time to share this. Hopefully it'll save a few folks some time at least.
:+1: thanks for tip!
@tomakehurst
Thank you so much for helping me solve a problem.
I've been stuck into this problem for several years.
Most helpful comment
@tomakehurst
Thank you so much for helping me solve a problem.
I've been stuck into this problem for several years.