Hi,
I am using jacoco in tcp server mode to collect coverage data for
integration tests. To launch my application, I use the following jvm argument
"-Djavaagent:org.jacoco.agent-0.8.2.jar=output=tcpserver,port=36302,address=*"
The application launches fine but when I try connecting to the port 36302 on ip
127.0.0.1, inisde the container, I get connection refused. What am I doing
incorrect here ?
Connecting to 127.0.0.1 PORT:6300
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at
org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: 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:589)
at java.net.Socket.connect(Socket.java:538)
at java.net.Socket.<init>(Socket.java:434)
at java.net.Socket.<init>(Socket.java:244)
at ExecutionDataClient.main(ExecutionDataClient.java:29)
-------------------------
I am using ExecutionDataClient to dump data
public static void main(final String[] args) throws IOException {
String address = (String) args[0];
int port = Integer.parseInt(args[1]);
final FileOutputStream localFile = new
FileOutputStream(DESTFILE);
final ExecutionDataWriter localWriter = new ExecutionDataWriter(
localFile);
// Open a socket to the coverage agent:
System.out.println("Connecting to " + address + " PORT:" + port
);
// final Socket socket = new
Socket(InetAddress.getByName(address), port);
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:
writer.visitDumpCommand(true, false);
if (!reader.read()) {
throw new IOException("Socket closed unexpectedly.");
}
socket.close();
localFile.close();
}
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jacoco/a845062f-045d-49fe-823a-677f913e0ba9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.