How to fix “No remote command visitor” error getting while Dumping data on request in tcpclient mode

626 views
Skip to first unread message

Vijay Nanekar

unread,
Apr 2, 2019, 12:29:24 PM4/2/19
to jac...@googlegroups.com
Hello,

We have started our micro service with jacoco java agent with tcpclient output mode, -javaagent:$PWD/coverage/jacocoagent.jar=output=tcpclient,includes=*,address=100.XXX.XXX.XXX,port=6300

Micro-service get started successfully.

Next, On another machine (100.XXX.XXX.XXX), we have executed ExecutionDataServer.java given on jacoco site (https://www.jacoco.org/jacoco/trunk/doc/examples/java/ExecutionDataServer.java) This will continuously listen for an incoming connection on port 6300.

Now, we have executed test cases.

After that, We connect to micro-service machine to dump coverage data on the fly (Without shutdown). To do that we execute below jacoco command on micro service machine. java -jar coverage/jacococli.jar dump --address 100.XXX.XXX.XXX –destfile jacoco-server.exec

Once I executed the above command, connection successfully gets created between 100.XXX.XXX.XXX machine and micro service machine. But data is not getting dumped on 100.XXX.XXX.XXX machine. We are getting "No remote command visitor" error.

Stack Trace : Exception in thread "main" java.io.IOException: No remote command visitor. at org.jacoco.cli.internal.core.runtime.RemoteControlReader.readDumpCommand(RemoteControlReader.java:63) at org.jacoco.cli.internal.core.runtime.RemoteControlReader.readBlock(RemoteControlReader.java:42) at org.jacoco.cli.internal.core.data.ExecutionDataReader.read(ExecutionDataReader.java:92) at org.jacoco.cli.internal.core.tools.ExecDumpClient.dump(ExecDumpClient.java:127) at org.jacoco.cli.internal.core.tools.ExecDumpClient.dump(ExecDumpClient.java:98) at org.jacoco.cli.internal.commands.Dump.execute(Dump.java:69) at org.jacoco.cli.internal.Main.execute(Main.java:89) at org.jacoco.cli.internal.Main.main(Main.java:104)

Please help me to resolve this issue.


Thanks,

Vijay

Evgeny Mandrikov

unread,
Apr 2, 2019, 1:35:45 PM4/2/19
to JaCoCo and EclEmma Users


On Tuesday, April 2, 2019 at 6:29:24 PM UTC+2, Vijay Nanekar wrote:

We have started our micro service with jacoco java agent with tcpclient output mode, -javaagent:$PWD/coverage/jacocoagent.jar=output=tcpclient,includes=*,address=100.XXX.XXX.XXX,port=6300

...

After that, We connect to micro-service machine to dump coverage data on the fly (Without shutdown). To do that we execute below jacoco command on micro service machine. java -jar coverage/jacococli.jar dump --address 100.XXX.XXX.XXX –destfile jacoco-server.exec

"dump" from command line interface is not applicable here - quoting its description ( https://www.jacoco.org/jacoco/trunk/doc/cli.html ):

Request execution data from a JaCoCo agent running in 'tcpserver' output mode.

In case of output=tcpclient ExecutionDataServer can request dump from its client - see https://groups.google.com/d/msg/jacoco/V7Bmz5r0P24/PdCC5apIoqgJ

Vijay Nanekar

unread,
Apr 9, 2019, 12:50:29 AM4/9/19
to JaCoCo and EclEmma Users
Thanks a lot Evgeny. 

Yes, I got it now that cli dump is only for agent running in 'tcpserver' output mode. 

In our case, we are using output=tcpclient, And as per post link you provided, we have to call RemoteControlWriter.visitDumpCommand(true, false).
Do we need to place this call in ExecutionDataServer.java class? or Do I need to execute this from micro service container?

Evgeny Mandrikov

unread,
Apr 9, 2019, 4:58:41 AM4/9/19
to JaCoCo and EclEmma Users

On Tuesday, April 9, 2019 at 6:50:29 AM UTC+2, Vijay Nanekar wrote:
Do we need to place this call in ExecutionDataServer.java class?

Yes 

Vijay Nanekar

unread,
Apr 11, 2019, 12:31:37 AM4/11/19
to JaCoCo and EclEmma Users
Thanks a lot Evgeny. It is working for me now.

abat...@indeed.com

unread,
May 22, 2019, 9:29:40 AM5/22/19
to JaCoCo and EclEmma Users
Hello,
Could you elaborate more on how this worked, please?
If there are updates required to ExecutionDataServer.java, is this file updated? I am still getting the same error "No remote command visitor".

Vijay Nanekar

unread,
Jun 1, 2019, 2:01:14 AM6/1/19
to jac...@googlegroups.com
Hello Abatarseh,

Yes you need to update ExecutionDataServer.java. And add below API call to send dump command.

RemoteControlWriter.visitDumpCommand(true, false) 

Thanks,
Vijay

--
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/6305ee4d-6068-4834-a9d5-2212d2d7a2bd%40googlegroups.com.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages