Hi, hard to tell what the issue are. It looks like the target prozess is not properly running or has been killed during the dump (connection reset).
Note that output=tcpserver only works for long running processes. The process with the attached JaCoCo agent needs to be up and running for the entire time while executing the dump command. Another possible reason might be firewall or routing issues. Regards, -marc On 2018-01-06 20:55, ari wrote: > Even the jacococli throws the similar error: > >>> java -jar jacococli.jar dump --destfile jacoco.exec --address xxxx --port >>> 6015 > [INFO] Connecting to xxxxx/10.240.92.25:6015. > Exception in thread "main" java.net.SocketException: Connection reset > at java.net.SocketInputStream.read(SocketInputStream.java:197) > at java.net.SocketInputStream.read(SocketInputStream.java:122) > at java.net.SocketInputStream.read(SocketInputStream.java:211) > at java.io.FilterInputStream.read(FilterInputStream.java:83) > at > org.jacoco.cli.internal.core.data.ExecutionDataReader.read(ExecutionDataReader.java:83) > > 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) > > thanks > >> Hi, >> I am getting the foll. exception when I try to get the dump on a port >> connecting to the server where the jacoco agent is running >> My goal is to capture the test coverage after evety test is run, henc I am >> calling the jacoco dumper >> I have the jacoco agent running with below params: >> >> set the foll in weblogic appserver >> >> JAVA_OPTIONS="${JAVA_OPTIONS} - >> >> javaagent:/podscratch/jacoco/jacocoagent.jar=output=tcpserver,address=xxxxx,port >> >> >> =6015,append=false,dumponexit=false,classdumpdir=/podscratch/classdumpdir,destfile=/podscratch/co >> >> >> verage/coverage.exec" >> >> Exception: >> -------------------------------------- >> I get the below exception while it reads from the dumper: >> >> Exception in thread "main" java.net.SocketTimeoutException: Read timed out >> at java.net.SocketInputStream.socketRead0(Native Method) >> at java.net.SocketInputStream.socketRead(Unknown Source) >> at java.net.SocketInputStream.read(Unknown Source) >> at java.net.SocketInputStream.read(Unknown Source) >> at java.net.SocketInputStream.read(Unknown Source) >> at java.io.DataInputStream.readByte(Unknown Source) >> at org.jacoco.core.data.ExecutionDataReader.read(ExecutionDataReader.jav >> a:82) >> at JacocoDumper.main(JacocoDumper.java:58) >> >> My dumper code is something like this: >> >> ublic class JacocoDumper{ >> >> private static final String DESTFILE = "jacoco-client.exec"; >> >> private static final String ADDRESS = "xxxx" >> private static final int PORT = 6015; >> >> public static void main(String args[]) throws Exception{ >> >> //command to run the test >> >> String[] out1 = runCommand("java -jar REEATSGenericCLI.jar -action=execute >> -test_set_path="Test1" ); >> String jobId = null; >> >> System.out.println((jobId= out1[0].split("job id=\"")[1].split("\"")[0])); >> String[] out2 = null; >> >> for(;;){ >> Thread.sleep(1000); >> out2 = runCommand("java -jar ALM\\REEATSGenericCLI.jar -action=status >> -job_id=\""+jobId+"\""); >> if(!out2[1].contains("Given job not found.")) >> >> break; >> >> } >> >> } >> System.out.println(out2[0]); >> >> final FileOutputStream localFile = new FileOutputStream(DESTFILE); >> final ExecutionDataWriter localWriter = new ExecutionDataWriter( >> localFile); >> >> // Open a socket to the coverage agent: >> final Socket socket = new Socket(InetAddress.getByName(ADDRESS), PORT); >> final RemoteControlWriter writer = new RemoteControlWriter( >> socket.getOutputStream()); >> final RemoteControlReader reader = new RemoteControlReader( >> socket.getInputStream()); >> reader.setSessionInfoVisitor(localWriter); >> reader.setExecutionDataVisitor(localWriter); >> >> // Send a dump command and read the response: >> System.out.println("before dump "); >> writer.visitDumpCommand(true, true); >> System.out.println("after dump read"); >> if (!reader.read()) { >> throw new IOException("Socket closed unexpectedly."); >> } >> >> socket.close(); >> localFile.close(); >> } >> >> Any idea on waht the issue? >> thanks > > -- > 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+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jacoco/0db873cc-ee94-43b4-91f1-83ef318b04cd%40googlegroups.com > [1]. > For more options, visit https://groups.google.com/d/optout. Links: ------ [1] https://groups.google.com/d/msgid/jacoco/0db873cc-ee94-43b4-91f1-83ef318b04cd%40googlegroups.com?utm_medium=email&utm_source=footer -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/ebdc4903471cbf4c8b61d3bb6f79d334%40mountainminds.com. For more options, visit https://groups.google.com/d/optout.