• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Coldfusion 2018 update 5 creating issue with class files when adding jacocco.jar to JVM arguments

New Here ,
Jan 16, 2020 Jan 16, 2020

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.

TOPICS
Advanced techniques , Asynchronous , Builder , cfchart , Cffiddle , Connector , Database access , Documentation , Event gateways , Flash integration , Getting started , Monitoring , Reporting , Security , Server administration

Views

587

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 19, 2020 Jan 19, 2020

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 19, 2020 Jan 19, 2020

Copy link to clipboard

Copied

LATEST

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. 


/Charlie (troubleshooter, carehart.org)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation