Jacoco coverage works in output=file mode but not working in outut=tcpserver mode in weblogic

500 views
Skip to first unread message

shashi...@gmail.com

unread,
Dec 16, 2017, 12:58:47 PM12/16/17
to JaCoCo and EclEmma Users
I have a complex environment with multiple hosts...using weblogic
I added the necessary JAVA_OPTIONS in commEnv.sh
with output=file and dumponexit=true, the coverage for all the applications comes after shutting down

But when I use output=tcpsever, by using ant, I call the dump method, I see that only the weblogic classes coverage comes and not my application coverage
I tried with Java client too but everytime only the coverage of weblogic is seen

Are there any known issues with tcpserver options when working with complex environment having multiple servers like BI, SOA et.,

Evgeny Mandrikov

unread,
Dec 16, 2017, 2:30:36 PM12/16/17
to JaCoCo and EclEmma Users


On Saturday, December 16, 2017 at 6:58:47 PM UTC+1, shashi...@gmail.com wrote:
I have a complex environment with multiple hosts...using weblogic
I added the necessary JAVA_OPTIONS in commEnv.sh
with output=file and dumponexit=true, the coverage for all the applications comes after shutting down

But when I use output=tcpsever, by using ant, I call the dump method, I see that only the weblogic classes coverage comes and not my application coverage

I tried with Java client too but everytime only the coverage of weblogic is seen


Make sure that you do actually execute your application prior to requesting dump.
 

Are there any known issues with tcpserver options


There is no known issues with tcpserver. Moreover output mode doesn't change the way information is collected by agent, only the way it is outputted.
 

when working with complex environment having multiple servers like BI, SOA et.,

 
Keep in mind that in case of multiple servers there is multiple agents and hence dump should be requested from each.

Shashi Rekha

unread,
Dec 17, 2017, 11:32:45 PM12/17/17
to jac...@googlegroups.com

Make sure that you do actually execute your application prior to requesting dump.
I am running my tests before taking hte dump..As I mentioned, the coverage comes when I use the dumponeexit for the same set of tests, we get the coverage

Keep in mind that in case of multiple servers there is multiple agents and hence dump should be requested from each
Do you mean to say I should attach several jacoco agents and take the dump?---Is the same not needed for shutdown option?


--
You received this message because you are subscribed to a topic in the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jacoco/Ys1wF3GdZFU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jacoco+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/220b7062-0250-418a-aa55-0ec00d173b9c%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Evgeny Mandrikov

unread,
Dec 18, 2017, 3:46:53 AM12/18/17
to JaCoCo and EclEmma Users


On Monday, December 18, 2017 at 5:32:45 AM UTC+1, Shashi Rekha wrote:

Make sure that you do actually execute your application prior to requesting dump.
I am running my tests before taking hte dump..As I mentioned, the coverage comes when I use the dumponeexit for the same set of tests, we get the coverage

How do you check content of exec file? and that it contains only weblogic files ? Do you check "session page" (right top corner of report) ?

Also there was an improvement in unreleased version to make make sure that connection is not closed unexpectedly when taking dump - try this.

You can also try JMX to get the dump.

Also you can build your own version of JaCoCo from sources with addition of debug output during dump.

Beside this as was said before - there is no known issues with tcpserver and output mode doesn't change the way information is collected by agent, only the way it is outputted.
 

Keep in mind that in case of multiple servers there is multiple agents and hence dump should be requested from each
Do you mean to say I should attach several jacoco agents and take the dump?---Is the same not needed for shutdown option?

You said "multiple servers" if this means multiple JVMs, then one agent per JVM independently of options.

Evgeny Mandrikov

unread,
Dec 18, 2017, 2:03:15 PM12/18/17
to JaCoCo and EclEmma Users
Hi Shashi,

I did following test using latest JaCoCo build available at http://www.jacoco.org/jacoco/index.html :

$ java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

Downloaded and installed WebLogic Server 12.2.1.3.0 without any additional tuning/configuration.

Started it with JaCoCo agent as

$ JAVA_OPTIONS=-javaagent:/tmp/j/jacoco-0.7.10-20171215.002946-81/lib/jacocoagent.jar=output=tcpserver,port=6300  ./startWebLogic.sh

and via http://127.0.0.1:7001/console deployed example-1.0.war (you'll find it in attachments as well as its sources).

Opened 


which shows "Hello World!" as expected.

Then requested dump:

$ java -jar /tmp/j/jacoco-0.7.10-20171215.002946-81/lib/jacococli.jar dump --destfile test.exec --address localhost --port 6300
[INFO] Connecting to localhost/127.0.0.1:6300.
[INFO] Writing execution data to /private/tmp/j/example/test.exec.

And it contains class of deployed application:

$ java -jar /tmp/j/jacoco-0.7.10-20171215.002946-81/lib/jacococli.jar execinfo test.exec | grep "org.example"
db203688e0762b80    3 of   4   org/example/SimpleServlet

Generation of report

$ java -jar /tmp/j/jacoco-0.7.10-20171215.002946-81/lib/jacococli.jar report test.exec --classfiles target/classes --sourcefiles src/main/java --html report
[INFO] Loading execution data file /private/tmp/j/example/test.exec.
[INFO] Analyzing 1 classes.

Produced


As you can see - without any magical agent parameters.


So IMO without access to your environment there is nothing to add to the debugging advices given before.

Except maybe that usage of agent option "classdumpdir" allows to observe which classes were instrumented by agent:

$ JAVA_OPTIONS=-javaagent:/tmp/j/jacoco-0.7.10-20171215.002946-81/lib/jacocoagent.jar=output=tcpserver,port=6300,classdumpdir=/tmp/j/classdump  ./startWebLogic.sh

$ ls -R /tmp/j/classdump | grep -B 1 "SimpleServl"
/tmp/j/classdump/org/example:
SimpleServlet.db203688e0762b80.class


Regards,
Evgeny
example-1.0.war
example.zip
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages