Copy link to clipboard
Copied
I am using JACOCO for code coverage report. It worked fine with CF10 earlier. But when configuring the same with CF2018 i am getting issues with CFC in the application.
The specified CFC DEMO could not be found.
Or
Class files is of invalid length.
The configuration is such as below.
CF2018 Update 5. Issue with both Java 10 and Java 11.
Tried with Jacoco 8.1-8.6
The jacocoagent.jar and jacococli.jar in “cfusion/lib/” folder.
Adding below line in jvm parameter in coldfusion admin under java & jvm setting:
-javaagent:{application.home}/lib/jacocoagent.jar=destfile={application.home}
/code_coverage/jacoco.exec,append=true,dumponexit=true,output=file
It will write jacoco.exec file inside \code_coverage\Report\ folder on server stop.
If someone could help me with a solution . Thanks in advance.
Copy link to clipboard
Copied
Check that cfusion/code_coverage/Report/ and cfusion/code_coverage/jacoco.exec do in fact exist. Shouldn't the JVM setting have the setting jmx=true?
Copy link to clipboard
Copied
It may be that it works by injecting itself into the class files cf creates, and if you leave on the cf setting to "save class files", in the cf admin caching page, then you should try stopping cf, and deleting all files in the wwwroot/WEB-INF/cfclasses folder (NOT classes).
There should be no noticeable performance impact from this. After you restart CF, when you next request a page, it's underlying class file/files will be recompiled and saved.
And yes, you could turn OFF save class files. Some do it needlessly (in dev or prod), some do it based on old wives tales or misinfo (perhaps to their detriment), but in some unique cases it may be useful.
Let us know if that gets you going. Btw, there are cfml code coverage solutions, if this Java one may not suit some readers.