Org.gradle.messaging.remote.internal.MessageIOException: Could not read message from '/127.0.0.1:61292'

Hi!

This is my first post on the community, so I respectfully apologize if I don’t provide enough information for being helped or posted on the wrong section.

In order to run my Selenium tests in the future, I’m trying to integrate Gradle and Arquillian, so Arquillian can take care of my container life cycle.

I have the following Arquillian test class:

import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.gradle.archive.importer.embedded.EmbeddedGradleImporter;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Test;
import org.junit.runner.RunWith;

@RunWith(Arquillian.class)
public class ArquillianTestCase {

	@Deployment
	public static WebArchive createDeployment() {
		return ShrinkWrap.create(EmbeddedGradleImporter.class)
				.forThisProjectDirectory().importBuildOutput()
				.as(WebArchive.class);
	}

	@Test
	@RunAsClient
	public void shouldRun() throws Exception {
		System.out.println("Arquillian!");
	}
}

When I run gradle test on Eclipse, the following errors are thrown:

Unexpected exception thrown.
org.gradle.messaging.remote.internal.MessageIOException: Could not read message from '/127.0.0.1:61292'.
	at org.gradle.messaging.remote.internal.inet.SocketConnection.receive(SocketConnection.java:84)
	at org.gradle.messaging.remote.internal.hub.MessageHub$ConnectionReceive.run(MessageHub.java:235)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
	at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: com.esotericsoftware.kryo.KryoException: java.io.IOException: Foi forçado o cancelamento de uma conexão existente pelo host remoto
	at com.esotericsoftware.kryo.io.Input.fill(Input.java:141)
	at com.esotericsoftware.kryo.io.Input.require(Input.java:159)
	at com.esotericsoftware.kryo.io.Input.readByte(Input.java:255)
	at org.gradle.internal.serialize.kryo.KryoBackedDecoder.readByte(KryoBackedDecoder.java:80)
	at org.gradle.messaging.remote.internal.hub.InterHubMessageSerializer$MessageReader.read(InterHubMessageSerializer.java:63)
	at org.gradle.messaging.remote.internal.hub.InterHubMessageSerializer$MessageReader.read(InterHubMessageSerializer.java:52)
	at org.gradle.messaging.remote.internal.inet.SocketConnection.receive(SocketConnection.java:77)
	... 6 more
Caused by: java.io.IOException: Foi forçado o cancelamento de uma conexão existente pelo host remoto
	at sun.nio.ch.SocketDispatcher.read0(Native Method)
	at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
	at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
	at sun.nio.ch.IOUtil.read(IOUtil.java:192)
	at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
	at org.gradle.messaging.remote.internal.inet.SocketConnection$SocketInputStream.read(SocketConnection.java:165)
	at com.esotericsoftware.kryo.io.Input.fill(Input.java:139)
	... 12 more
Unexpected exception thrown.
org.gradle.messaging.remote.internal.MessageIOException: Could not write message [EndOfStream] to '/127.0.0.1:61292'.
	at org.gradle.messaging.remote.internal.inet.SocketConnection.dispatch(SocketConnection.java:111)
	at org.gradle.messaging.remote.internal.hub.MessageHub$ConnectionDispatch.run(MessageHub.java:284)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
	at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Foi forçado o cancelamento de uma conexão existente pelo host remoto
	at sun.nio.ch.SocketDispatcher.write0(Native Method)
	at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:51)
	at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
	at sun.nio.ch.IOUtil.write(IOUtil.java:51)
	at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:471)
	at org.gradle.messaging.remote.internal.inet.SocketConnection$SocketOutputStream.flush(SocketConnection.java:236)
	at org.gradle.messaging.remote.internal.inet.SocketConnection.dispatch(SocketConnection.java:109)
	... 6 more

(Some messages are in portuguese, let me know if you need translation).

I googled a few time but I’m stuck with this error, did I miss something?
Below is the content of my build.gradle file:

apply plugin: 'war'
apply plugin: 'eclipse-wtp'

sourceCompatibility = 1.8
version = '1.0'
jar {
    manifest {
        attributes 	'Implementation-Title': 'Arch Project', 
        			'Implementation-Version': version
    }
}

repositories {
    mavenCentral()
    
    jcenter()
    maven { url 'http://repository.primefaces.org' }
    maven { url 'http://repository.jboss.org/nexus/content/groups/public' }
}

configurations {
    provided
}

sourceSets {
    main.compileClasspath += configurations.provided
    test.compileClasspath += configurations.provided
    test.runtimeClasspath += configurations.provided
}

dependencies {

    /* Cryptography API for BCrypt algorithm. */
    compile 'de.svenkubiak:jBCrypt:0.4'
    
    /* Primefaces. */
    compile 'org.primefaces:primefaces:5.3'
    
    /* Primefaces's pepper-grinder theme. */
    compile 'org.primefaces.themes:pepper-grinder:1.0.10'
    
    /* JUnit for unit testing. */
    testCompile 'junit:junit:4.12'
    
    /* DbUnit for persitence unit testing. */
    testCompile 'org.dbunit:dbunit:2.5.1'
    testCompile 'org.slf4j:slf4j-simple:1.7.13'
    
    /* Hibernate. */
    testCompile 'org.hibernate:hibernate-core:5.0.4.Final'
    
    /* Hibernate provider for JPA. */
    testCompile 'org.hibernate:hibernate-entitymanager:5.0.4.Final'
    
    /* 
     * Hibernate and c3p0 integration for connection pooling. This dependency 
     * automatically downloads the needed c3p0 standalone jars.
     */
    testCompile 'org.hibernate:hibernate-c3p0:5.0.4.Final'
    
    /* Hibernate's dependency. */
    testCompile 'com.fasterxml:classmate:1.3.1'
    
    /* H2 for in memory persistence tests. */
    testCompile 'com.h2database:h2:1.4.190'
    
    /* Mockito for mocking test dependencies. */
    testCompile 'org.mockito:mockito-all:1.10.19'
    
    /* Arquillian for managing the life cycle of the container. */
    testCompile 'org.jboss.arquillian.junit:arquillian-junit-container:1.1.10.Final'
    
    /* Arquillian's Wildfly embedded container. */
    testCompile 'org.wildfly:wildfly-arquillian-container-embedded:8.2.1.Final'
    
    /* Wildfly's dependency. */
    testCompile 'org.wildfly.core:wildfly-controller-client:2.0.3.Final'
    
    /* Arquillian and Gradle integration. */
    testCompile 'org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-gradle-depchain:2.2.0'

    /* Selenium for front-end testing. */
    testCompile 'org.seleniumhq.selenium:selenium-java:2.48.2'
    
    /* Java EE 7 API. */
    provided 'javax:javaee-api:7.0'
        
    /* SLF4J - Logging API. */
    provided 'org.slf4j:slf4j-api:1.7.13'
        
    /* Security framework provided by Wildfly 8.2.0.Final */
    provided 'org.picketbox:picketbox:4.9.2.Final'
} 

Sorry for the long post, I tried to provide as much information as I can.
The whole project is available in my GitHub (without those commits): archproject
Thanks in advance.

1 Like

Hi @bgasparotto ,
Are you able to fix this issue ? Please let me know
Thank you in advance :slight_smile: