Connection refused while connecting to a server where jacoco agent is running

48 views
Skip to first unread message

ravite...@gmail.com

unread,
Nov 15, 2019, 3:50:00 PM11/15/19
to JaCoCo and EclEmma Users
Hi,

I am trying to get code coverage for my maven project using jacoco agent. My server code and test code is separate code bases. So I thought jacoco agent is helpful in getting the code coverage.

For that I downloaded the jacoco agent(jacoco-0.8.5.zip) from here : https://www.jacoco.org/jacoco/

Jar is added into the dev code server and also added java arguments like below:

-javaagent:lib/org.jacoco.agent-0.8.1.jar=destfile=./coverage/jacoco.exec,output=tcpserver,address=*,port=6400 \

Restarted the server and make sure 6400 is upon running with jacoco agent.

In my test code, in pom file I added the code like below to generate the coverage report. But I am getting an error saying connection refused like below. Can some one Pl help me in fixing this issue and generating the coverage report

[INFO] Connecting to server name
[INFO] Connection refused (Connection refused)

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.5</version>
<configuration>
<address>provided the server address here</address>
<destfile>coverage/jacoco.exec</destfile>
<port>6400</port>
<reset>false</reset>
<append>true</append>
</configuration>
<executions>
<execution>
<id>jacoco-initialize</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>jacoco-dump</id>
<goals>
<goal>dump</goal>
</goals>
</execution>
<execution>
<id>jacoco-check</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>

</execution>
<execution>
<id>jacoco-report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>jacoco-instrument</id>
<phase>test</phase>
<goals>
<!-- <goal>instrument</goal>-->
<goal>report</goal>
</goals>
<configuration>
<skip>false</skip>
</configuration>
</execution>
</executions>
</plugin>

Marc Hoffmann

unread,
Nov 15, 2019, 8:24:54 PM11/15/19
to jac...@googlegroups.com
Hi,

the user property to configure the the port of the dump goal is “jacoco.port”. Not “port”.


The same applies to the other user properties you defined.

Regards,
-marc


--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/1e8d2335-846f-4a8a-9837-4926f8ead98d%40googlegroups.com.

ravite...@gmail.com

unread,
Nov 15, 2019, 10:13:31 PM11/15/19
to JaCoCo and EclEmma Users
Thanks Marc for responding. I tried the way which you said. Still see the same issue. This is what I have tried.

<properties>
<jacoco.address>server address</jacoco.address>
<jacoco.destfile>coverage/jacoco.exec</jacoco.destfile>
<jacoco.port>6400</jacoco.port>
<jacoco.reset>false</jacoco.reset>
<jacoco.append>true</jacoco.append>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>11</release>
</configuration>
</plugin>


<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
            <version>0.8.2</version>
<configuration>
<address>${jacoco.address}</address>
<destfile>${jacoco.destfile}</destfile>
<port>${jacoco.port}</port>
<reset>${jacoco.reset}</reset>
<append>${jacoco.append}</append>
To unsubscribe from this group and stop receiving emails from it, send an email to jac...@googlegroups.com.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages