Hello. Great looking tool, but I'm having some difficulty getting things to work with my cactus struts testcase tests. These are running in weblogic 8.1. I see the messages that the code is instrumented, but when I kill the server, I never get the coverage data output. I don't see any messages on the console which would lead to believe that the coverage data is being output anywhere. Does anyone have any ideas about why this might be? Everything works great for my non-strutstestcase tests.
Thanks,
John
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
(1) are you actually deploying instrumented classes? I am not familiar with Cactus, so I don't know if .war or whatever deployment is necessary for WebLogic.
(2) assuming the answer to (1) is "yes", the instrumented classes need to jave emma.jar available in their classpath. Have you done that and how (JRE standard extension, packaged within the .war, etc)?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
1) Yes. They are instrumented and I do see messages like: "collecting runtime coverage data ... " when the cactus tests are running.
2) I think answer 1 covers these. The classes are instrumented and claim to be generating coverage data, but I don't get an output file when I shut down weblogic.
Thanks,
John
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is very puzzling.... No exceptions logged to any WebLogic log files?
I would hazard a guess that is might be related to Java security. If so, it would be helpful to make sure emma.jar is in lib/ext of whichever JVM is used to run WebLogic to ensure that EMMA's runtime is a trusted class.
EMMA is used successfully with Websphere here at Trilogy, by the way.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Another update. I implemented a servlet filter to dump the coverage data (using the public API for this) and put it in the chain for the cactus struts test case servlet. Now I get the coverage data being properly dumped to a file. Maybe the way weblogic shuts down doesn't give emma a chance to dump the files? Could there be some odd glitch in weblogic's JVM which makes this not happen properly?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think I've got the same thing happening (just an empty file being generated) with Tomcat 4.0.4-LE running on Linux.
Here's Tomcat's dying breath:
WebappClassLoader: Lifecycle error : CL stopped
java.lang.NoClassDefFoundError: com/vladium/util/asserts/$assert
at com.vladium.emma.data.DataFactory.persist(DataFactory.java:664)
at com.vladium.emma.data.DataFactory.persist(DataFactory.java:87)
at com.vladium.emma.rt.RT.dumpCoverageData(RT.java:181)
at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:30)
at java.lang.Thread.run(Thread.java:534)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've got it now (a Trilogy user reported this before). This is an issue with how classloading is done from a JVM exit hook.
I will need to make some code changes to prevent this, but for now the workaround is to follow the install recommendation in EMMA docs: install emma.jar as the standard extension for the JRE that runs WebLogic. Find that jre dir and copy emma.jar into lib/ext under it, don't package emma.jar with your code.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think build 4127 should improve this situation significantly (that is, the shutdown hook should work without requiring emma.jar to be installed as a JRE standard extension). Everyone is encouraged to give it a try.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello. Great looking tool, but I'm having some difficulty getting things to work with my cactus struts testcase tests. These are running in weblogic 8.1. I see the messages that the code is instrumented, but when I kill the server, I never get the coverage data output. I don't see any messages on the console which would lead to believe that the coverage data is being output anywhere. Does anyone have any ideas about why this might be? Everything works great for my non-strutstestcase tests.
Thanks,
John
John,
You need to provide some more details:
(1) are you actually deploying instrumented classes? I am not familiar with Cactus, so I don't know if .war or whatever deployment is necessary for WebLogic.
(2) assuming the answer to (1) is "yes", the instrumented classes need to jave emma.jar available in their classpath. Have you done that and how (JRE standard extension, packaged within the .war, etc)?
1) Yes. They are instrumented and I do see messages like: "collecting runtime coverage data ... " when the cactus tests are running.
2) I think answer 1 covers these. The classes are instrumented and claim to be generating coverage data, but I don't get an output file when I shut down weblogic.
Thanks,
John
An update. I *am* getting a coverage.ec file, but it is a zero-byte file. It does not actually contain any coverage data.
This is very puzzling.... No exceptions logged to any WebLogic log files?
I would hazard a guess that is might be related to Java security. If so, it would be helpful to make sure emma.jar is in lib/ext of whichever JVM is used to run WebLogic to ensure that EMMA's runtime is a trusted class.
EMMA is used successfully with Websphere here at Trilogy, by the way.
Another update. I implemented a servlet filter to dump the coverage data (using the public API for this) and put it in the chain for the cactus struts test case servlet. Now I get the coverage data being properly dumped to a file. Maybe the way weblogic shuts down doesn't give emma a chance to dump the files? Could there be some odd glitch in weblogic's JVM which makes this not happen properly?
Glad you've found a workaround (and silly of me to forget about the dump API option as well in the earlier post).
I will turn this into a bug issue to look at. JRockit JVM is already part of my testsuite, although only on win32. Which OS was this on?
I'm running it on win2k.
I think I've got the same thing happening (just an empty file being generated) with Tomcat 4.0.4-LE running on Linux.
Here's Tomcat's dying breath:
WebappClassLoader: Lifecycle error : CL stopped
java.lang.NoClassDefFoundError: com/vladium/util/asserts/$assert
at com.vladium.emma.data.DataFactory.persist(DataFactory.java:664)
at com.vladium.emma.data.DataFactory.persist(DataFactory.java:87)
at com.vladium.emma.rt.RT.dumpCoverageData(RT.java:181)
at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:30)
at java.lang.Thread.run(Thread.java:534)
I've got it now (a Trilogy user reported this before). This is an issue with how classloading is done from a JVM exit hook.
I will need to make some code changes to prevent this, but for now the workaround is to follow the install recommendation in EMMA docs: install emma.jar as the standard extension for the JRE that runs WebLogic. Find that jre dir and copy emma.jar into lib/ext under it, don't package emma.jar with your code.
Issue: http://sourceforge.net/tracker/index.php?func=detail&aid=978671&group_id=108932&atid=651897
I think build 4127 should improve this situation significantly (that is, the shutdown hook should work without requiring emma.jar to be installed as a JRE standard extension). Everyone is encouraged to give it a try.