Jacoco working locally but not on build server.

59 views
Skip to first unread message

Alex Foreman

unread,
Aug 4, 2022, 6:13:58 AM8/4/22
to JaCoCo and EclEmma Users
HI, I've had this problem for a while now ~6 months and it came up again.
Both times I've done extensive searches and cannot find anyone with the same issue as myself.

Locally my Project which is using Maven as the Build System builds fine.  All tests are run and pass and Jacoco instruments and generates the coverage report.
This is all done from 'mvn install'.

However the same repo and the same command on our Jenkins server completes all the way up to the tests at which point we see:
'[INFO] [INFO] ------------------------------------------------------- [INFO] T E S T S [INFO] ------------------------------------------------------- Error occurred during initialization of VM Could not find agent library instrument on the library path, with error: Can't find dependent libraries Module java.instrument may be missing from runtime image.'

And it hangs there forever and I have to abort the build.
This is the same code base so no versions are different.  Without Jacoco It builds and passes perfectly.

FYI,
Java 11
Maven version: 3.6.3
Jacoco version: 0.8.7 (But I have tried other versions which have the same affect).

Both Machines are Windows :/

Has anyone ever seen this before.

Thanks in advance!

Marc Hoffmann

unread,
Aug 4, 2022, 6:28:09 AM8/4/22
to JaCoCo and EclEmma Users
Also I searched a bit for this error message and it might be a consequence that the JVM can’t allocate enough memory during startup. Can you please have a look at free memory on your build server during the build?

Cheers,
-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/d1a00044-20fa-4102-8999-c2fa4c3fe14cn%40googlegroups.com.

Marc Hoffmann

unread,
Aug 4, 2022, 6:28:36 AM8/4/22
to JaCoCo and EclEmma Users
Hi Alex,

I also have never heard of this error message. this part of the message may indicate that the JDK/JRE you’re using is incomplete:

Can't find dependent libraries Module java.instrument may be missing from runtime image.

Can you please check what exact JDK version you are using on the build server?

Also at this JDK installation there should be the following file (and it should be accessible by the build user):

<your JDK>/jmods/java.instrument.jmod

Also can you please provide the full command line which is used to launch the unit tests? Maven will print in in debug mode (-X).

Cheers,
-marc


On 4. Aug 2022, at 12:13, Alex Foreman <alexdf...@gmail.com> wrote:

Alex Foreman

unread,
Aug 4, 2022, 9:28:19 AM8/4/22
to JaCoCo and EclEmma Users
Thank you marc.  I have informed our Devops who are going to see if this could be the cause.
Ill keep you all posted.

Reply all
Reply to author
Forward
0 new messages