updated JVM OPTIONS
=
-javaagent:/usr/local/jacoco-agent.jar=address=https://qa-jacoco-service.np.navi-sa.in,port=6300,output=tcpclient
On Tuesday, November 5, 2024 at 1:53:38 AM UTC+5:30 Rajeev Nandan wrote:
> I have deployed a jacoco-server which listens on serversocket and then
> generate report.
> Here is the code for creating serversocket
> public static void main(final String[] args) throws IOException {
> ApplicationContext context = SpringApplication.run
> (CodeCoverageApplication.class, args);
>
> final ServerSocket server = new ServerSocket(PORT, 0);
> log.info("Jacoco Server started");
>
> while (true) {
> log.info("Initiating handler...");
> Socket clientSocket = server.accept(); // Accept the incoming connection
>
> // Retrieve CodeCoverageHandler bean from the Spring context
> CodeCoverageHandler codeCoverageHandler =
> context.getBean(CodeCoverageHandler.class);
>
> // Set the socket for this instance
> codeCoverageHandler.setSocket(clientSocket);
>
> // Start the handler in a new thread
> new Thread(codeCoverageHandler).start();
> log.info("Started new handler");
> }
> }
>
> I am trying to attach jacoco-agent in service under test by passing this
> argument in JVM OPTIONS
> as -javaagent:/usr/local/jacoco-agent.jar=address=jacoco-server, port=6300
>
> Note:- ALB is attached with jacoco-server to handle requests
>
> But I am not able to attach the agent in the service. I am getting below
> error in the logs. Please hlep
>
> Error:-
> java.io.IOException: Invalid execution data file.
> at
> org.jacoco.agent.rt.internal_43f5073.core.data.ExecutionDataReader.read(ExecutionDataReader.java:90)
> at
> org.jacoco.agent.rt.internal_43f5073.output.TcpConnection.run(TcpConnection.java:60)
> at
> org.jacoco.agent.rt.internal_43f5073.output.TcpClientOutput$1.run(TcpClientOutput.java:56)
> at java.base/java.lang.Thread.run(Thread.java:834)
>
> jacoc-version: 0.8.5
>
> Thanks & Regards,
> Rajeev Nandan
>
--
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 visit
https://groups.google.com/d/msgid/jacoco/49ff8e66-34fb-4578-8f4c-4720893d08e1n%40googlegroups.com.