"jacococli.jar dump", Connection refused

58 views
Skip to first unread message

Vasu BK

unread,
Jan 6, 2023, 4:19:15 AM1/6/23
to JaCoCo and EclEmma Users
Hello experts,
First of all would like to wish you all a wonderful year ahead.

Now, here is an issue I am facing and need your help.

I am trying to implement a Java code coverage solution for my project using jacoco. The projects gets build in gradle environment. I wanted to have capability to collect/dump coverage data on-demand. For that, I am trying to use jacoco CLI (ref: https://www.jacoco.org/jacoco/trunk/doc/cli.html). So, I have configured my jacocoagent with below options.

output = "tcpserver"                
address = "*" 
port = 6300

But, when I run "jacococli.jar dump" command, I get below error. My dev environment is Linux. I tried with output = tcpclient  as well. The issue remains same. Any insights would be highly appreciated.

$ java -jar /da/ToolsAndLibs/NoArch/jacoco-0.8.7/lib/jacococli.jar dump --destfile /da/data/coverage/coverage_demanddump_dva.exec 

[INFO] Connecting to localhost/127.0.0.1:6300.

[WARN] Connection refused (Connection refused).

[INFO] Connecting to localhost/127.0.0.1:6300.

[WARN] Connection refused (Connection refused).

[INFO] Connecting to localhost/127.0.0.1:6300.

[WARN] Connection refused (Connection refused).

[INFO] Connecting to localhost/127.0.0.1:6300.

[WARN] Connection refused (Connection refused).

[INFO] Connecting to localhost/127.0.0.1:6300.

[WARN] Connection refused (Connection refused).

[INFO] Connecting to localhost/127.0.0.1:6300.

[WARN] Connection refused (Connection refused).

[INFO] Connecting to localhost/127.0.0.1:6300.

[WARN] Connection refused (Connection refused).

[INFO] Connecting to localhost/127.0.0.1:6300.

[WARN] Connection refused (Connection refused).

[INFO] Connecting to localhost/127.0.0.1:6300.

[WARN] Connection refused (Connection refused).

[INFO] Connecting to localhost/127.0.0.1:6300.

[WARN] Connection refused (Connection refused).

[INFO] Connecting to localhost/127.0.0.1:6300.

Exception in thread "main" java.net.ConnectException: Connection refused (Connection refused)

   at java.net.PlainSocketImpl.socketConnect(Native Method)

   at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)

   at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)

   at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)

   at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)

   at java.net.Socket.connect(Socket.java:607)

   at java.net.Socket.connect(Socket.java:556)

   at java.net.Socket.<init>(Socket.java:452)

   at java.net.Socket.<init>(Socket.java:262)

   at org.jacoco.cli.internal.core.tools.ExecDumpClient.tryConnect(ExecDumpClient.java:144)

   at org.jacoco.cli.internal.core.tools.ExecDumpClient.dump(ExecDumpClient.java:116)

   at org.jacoco.cli.internal.core.tools.ExecDumpClient.dump(ExecDumpClient.java:99)

   at org.jacoco.cli.internal.commands.Dump.execute(Dump.java:70)

   at org.jacoco.cli.internal.Main.execute(Main.java:90)

   at org.jacoco.cli.internal.Main.main(Main.java:105)


Thank you in advance for your help.

Regards,
Vasu

Marc Hoffmann

unread,
Jan 8, 2023, 3:37:36 PM1/8/23
to JaCoCo and EclEmma Users
Hi Vasu,

I assume your test program is running on the same machine where you execute the cli command, right?

As a first step I would double-check whether the tcp server is actually running.  the When you execute

   netstat -an

on your system, can you see an entry like this?

tcp4       0      0  127.0.0.1.6300        *.*                    LISTEN

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/42e2f860-6362-4ab7-a343-7ba72f80d6b0n%40googlegroups.com.

Reply all
Reply to author
Forward
Message has been deleted
0 new messages