Thank you so much for your suggestion. it worked. java -javaagent:C:\tools\jacoco\lib\jacocoagent.jar=jmx=true,output=none -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.port=1090 -Dcom.sun.management.jmxremote.rmi.port=1099 -Dcom.sun.management.jmxremote.password.file=c:\coverage\sample\jmxremote.password -Dcom.sun.management.jmxremote.access.file=c:\coverage\sample\jmxremote.access -Dcom.sun.management.jmxremote.ssl=true -jar C:\coverage\sample\calculator.jar
then i used jconsole to connect to see if it works, no luck. i used the https://github.com/jacoco/jacoco/blob/35f352a95551f532da9013f3587e2591cdcef6ec/org.jacoco.examples/src/org/jacoco/examples/MBeanClient.java#L53 this code. but no luck. What should be service url?? i am using service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi as the service url I get the below exception Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.rmi.NoSuchObjectException: no such object in table] i do not see any docs on how to implement using jmx. any guidance is highly appreciated. On Tuesday, December 31, 2024 at 3:20:54 AM UTC-6 Evgeny Mandrikov wrote: > On Tue, 31 Dec 2024 at 02:15, sudheer kumar <[email protected]> wrote: > >> I am not sure if i am doing it right or not... >> >> java -Dcom.sun.management.jmxremote.authenticate=true >> -Dcom.sun.management.jmxremote.password.file=c:\coverage\sample\jmxremote.password >> >> -Dcom.sun.management.jmxremote.access.file=c:\coverage\sample\jmxremote.access >> >> -javaagent:C:\tools\jacoco\lib\jacocoagent.jar=jmx=true,output=tcpserver,address=*,port=6300 >> >> -jar C:\coverage\sample\calculator.jar >> >> this is how instrumented my jar file with jmx >> >> now the app works fine... >> >> the problem is... still i am able to use "dump" without authentication.. >> >> java -jar c:/tools/jacoco/lib/jacococli.jar dump --address localhost >> --port 6300 --destfile C:/coverage/assurenxt/exec/jacoco.exec >> >> the jacoco.exec file is created. i donot want this command to work when >> jmx=true. is my understanding wrong? > > > > To make data available only via JMX use > output=none > instead of > output=tcpserver,address=*,port=6300 > > > Regards, > Evgeny > > -- 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/8ba819e2-158f-4773-a9f8-5f5abbc77daan%40googlegroups.com.
