A jetty service cannot start with jacoco

13 views
Skip to first unread message

winter

unread,
Dec 7, 2021, 3:16:59 AM12/7/21
to JaCoCo and EclEmma Users
jetty service  start with two java processes, jetty container and application service
/usr/local/java8/bin/java -jar $JETTY_HOME/start.jar -Dapp.workdir=$APP_WORK_HOME

then jacoco throws java.net.BindException: Address already in use, cause both processes create agent use the same port. I found in lower version, Agent class won't throw any Exception, so it can works with lower version such as 0.7.x , while , in 0.8.x, the method throws Exception, so my jetty service cannot start normally, can I remove the exception?
92427450-DD61-40B2-AAE4-C5A3ECBDF87C.png

Marc Hoffmann

unread,
Dec 7, 2021, 3:29:00 AM12/7/21
to jac...@googlegroups.com
Hi,

your observation is correct. Since 0.8.5 the startup fails when the JaCoCo runtime cannot be initialised as configured:


Before that the exception was only logged to the console but no coverage data was available. Because this causes a lot of confusion for our users (why would we allow running a disfunctional coverage agent?) we implemented "fail fast".

Please consult the Jetty project how to configure only the JVM which you want to collect code coverage from.

Regards,
-marc 


<92427450-DD61-40B2-AAE4-C5A3ECBDF87C.png>

--
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/c205eb4c-349f-49d4-843d-af530b11cca8n%40googlegroups.com.
<92427450-DD61-40B2-AAE4-C5A3ECBDF87C.png>

Reply all
Reply to author
Forward
0 new messages