Error: Could not find or load main class org.pitest.coverage.execute.CoverageMinion

1,063 views
Skip to first unread message

Robert Lavey

unread,
Sep 29, 2017, 8:57:12 AM9/29/17
to PIT Users
Greetings, I'm getting started with PIT and was working through the example at http://beyondscheme.com/2016/pitest-with-java.  I'm not able to get PIT to execute, however.  Here's the verbose output: 

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building pitest-example 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- pitest-maven:1.2.3:mutationCoverage (default-cli) @ pitest-example ---
[INFO] Found plugin : Default csv report plugin
[INFO] Found plugin : Default xml report plugin
[INFO] Found plugin : Default html report plugin
[INFO] Found plugin : Static initializer code detector plugin
[INFO] Found plugin : Static initializer filter plugin
[INFO] Found plugin : Excluded annotations plugin
[INFO] Found plugin : Inlined finally block filter plugin
[INFO] Found plugin : Try with resources filter
[INFO] Found plugin : Logging calls filter
[INFO] Found plugin : Infinite for loop filter
[INFO] Found plugin : Long running iterator loop filter
[INFO] Found plugin : Kotlin junk mutations filter
[INFO] Found plugin : Max mutations per class limit
[INFO] Found plugin : Equals shortcut equivalent mutant filter
[INFO] Found shared classpath plugin : Default mutation engine
[INFO] Adding org.pitest:pitest to SUT classpath
[INFO] Mutating from C:\Users\jisarl1\OneDrive - J.B. Hunt Transport\Documents\Git\pitest-java-example\target\classes
[INFO] Defaulting target classes to match packages in build directory
7:55:32 AM PIT >> INFO : ---------------------------------------------------------------------------
7:55:32 AM PIT >> INFO : Enabled (+) and disabled (-) features.
7:55:32 AM PIT >> INFO : -----------------------------------------
7:55:32 AM PIT >> INFO : +FINFINC        Filters mutations to increments that may cause infinite loops
7:55:32 AM PIT >> INFO : +FFBLOCK        Filters mutations in code duplicated by finally block inlining
7:55:32 AM PIT >> INFO : +FSTATI         Filters mutations in static initializers and code called only from them
7:55:32 AM PIT >> INFO : +FTRYWR         Filters mutations in code generated for try with resources statements
7:55:32 AM PIT >> INFO : +FKOTLIN        Filters out junk mutations in bytecode created by compiler for kotlin language features
7:55:32 AM PIT >> INFO : +FSEQUIVEQUALS  Filters equivalent mutations that affect only performance in short cutting equals methods
7:55:32 AM PIT >> INFO : +FSTATINIT      Filters mutations in static initializers and code called only from them
7:55:32 AM PIT >> INFO : +FLOGCALL       Filters mutations in code that makes calls to logging frameworks
7:55:32 AM PIT >> INFO : +FINFIT         Filters mutations that may cause infinite loops by removing calls to iterator.next
7:55:32 AM PIT >> INFO : +FANN           Filters mutations in classes and methods with matching annotations of class or runtime retention
7:55:32 AM PIT >> INFO :   [annotation]    Annotation to avoid (full package name not required)
7:55:32 AM PIT >> INFO : -CLASSLIMIT     Limits the maximum number of mutations per class
7:55:32 AM PIT >> INFO :   [limit]         Integer value for maximum mutations to create per class
7:55:32 AM PIT >> INFO : ---------------------------------------------------------------------------
7:55:33 AM PIT >> FINE : Running report with ReportOptions [targetClasses=[^com\.beyondscheme\.pitest\..*$], excludedMethods=[], excludedClasses=[], codePaths=[C:\Users\jisarl1\OneDrive - J.B. Hunt Transport\Documents\Git\pitest-java-example\target\classes], reportDir=C:\Users\jisarl1\OneDrive - J.B. Hunt Transport\Documents\Git\pitest-java-example\target\pit-reports, historyInputLocation=null, historyOutputLocation=null, sourceDirs=[C:\Users\jisarl1\OneDrive - J.B. Hunt Transport\Documents\Git\pitest-java-example\src\main\java, C:\Users\jisarl1\OneDrive - J.B. Hunt Transport\Documents\Git\pitest-java-example\src\test\java], classPathElements=[C:\Users\jisarl1\OneDrive - J.B. Hunt Transport\Documents\Git\pitest-java-example\target\test-classes, C:\Users\jisarl1\OneDrive - J.B. Hunt Transport\Documents\Git\pitest-java-example\target\classes, C:\Users\jisarl1\OneDrive - J.B. Hunt Transport\Maven\.m2\repository\junit\junit\4.11\junit-4.11.jar, C:\Users\jisarl1\OneDrive - J.B. Hunt Transport\Maven\.m2\repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar, C:\Users\jisarl1\OneDrive - J.B. Hunt Transport\Maven\.m2\repository\org\pitest\pitest\1.2.3\pitest-1.2.3.jar], mutators=[], dependencyAnalysisMaxDistance=-1, mutateStaticInitializers=false, jvmArgs=[], numberOfThreads=1, timeoutFactor=1.25, timeoutConstant=3000, targetTests=[], loggingClasses=[], maxMutationsPerClass=0, verbose=true, failWhenNoMutations=true, outputs=[HTML], groupConfig=TestGroupConfig [excludedGroups=[], includedGroups=[]], mutationUnitSize=0, shouldCreateTimestampedReports=true, detectInlinedCode=true, exportLineCoverage=false, mutationThreshold=0, coverageThreshold=0, mutationEngine=gregor, javaExecutable=null, includeLaunchClasspath=true, properties={}, maxSurvivors=0, excludedRunners=[], features=[]]
7:55:33 AM PIT >> FINE : System class path is C:\PROGRA~1\APACHE~1.9\bin\..\boot\plexus-classworlds-2.5.2.jar
7:55:33 AM PIT >> FINE : Maximum available memory is 3570 mb
7:55:33 AM PIT >> FINE : MINION : Installing PIT agent

7:55:33 AM PIT >> INFO : MINION : Error: Could not find or load main class org.pitest.coverage.execute.CoverageMinion


I ran these commands:
mvn clean test
mvn org.pitest:pitest-maven:mutationCoverage -Dverbose


I verified that the pittest:jar:1.2.3 is downloaded to my local .m2, and it does contains the org.pitest.coverage.execute.CoverageMinion class.

I'm running on a Windows 10 box with Maven 3.3.9 and Java 1.8.  I appreciate any help you can provide.

Thanks,
Bob

Henry Coles

unread,
Sep 29, 2017, 9:13:46 AM9/29/17
to pitu...@googlegroups.com
I'm going to take a wild guess and say this might be a windows specific issue to do with spaces in file paths.

Can you confirm if the issue is still present/not present if .m2 and the examples are moved to paths without spaces?

Thanks

Henry

--
You received this message because you are subscribed to the Google Groups "PIT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pitusers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Robert Lavey

unread,
Sep 29, 2017, 10:08:18 AM9/29/17
to PIT Users
Thanks, Henry.  I'll give that a try.

Robert Lavey

unread,
Sep 29, 2017, 10:27:50 AM9/29/17
to PIT Users
Unfortunately, I get the same result:

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building pitest-example 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- pitest-maven:1.2.3:mutationCoverage (default-cli) @ pitest-example ---
[INFO] Found plugin : Default csv report plugin
[INFO] Found plugin : Default xml report plugin
[INFO] Found plugin : Default html report plugin
[INFO] Found plugin : Static initializer code detector plugin
[INFO] Found plugin : Static initializer filter plugin
[INFO] Found plugin : Excluded annotations plugin
[INFO] Found plugin : Inlined finally block filter plugin
[INFO] Found plugin : Try with resources filter
[INFO] Found plugin : Logging calls filter
[INFO] Found plugin : Infinite for loop filter
[INFO] Found plugin : Long running iterator loop filter
[INFO] Found plugin : Kotlin junk mutations filter
[INFO] Found plugin : Max mutations per class limit
[INFO] Found plugin : Equals shortcut equivalent mutant filter
[INFO] Found shared classpath plugin : Default mutation engine
[INFO] Adding org.pitest:pitest to SUT classpath
[INFO] Mutating from C:\Users\jisarl1\MavenTest\pitest-java-example\target\classes
[INFO] Defaulting target classes to match packages in build directory
9:26:50 AM PIT >> INFO : ---------------------------------------------------------------------------
9:26:50 AM PIT >> INFO : Enabled (+) and disabled (-) features.
9:26:50 AM PIT >> INFO : -----------------------------------------
9:26:50 AM PIT >> INFO : +FINFINC        Filters mutations to increments that may cause infinite loops
9:26:50 AM PIT >> INFO : +FFBLOCK        Filters mutations in code duplicated by finally block inlining
9:26:50 AM PIT >> INFO : +FSTATI         Filters mutations in static initializers and code called only from them
9:26:50 AM PIT >> INFO : +FTRYWR         Filters mutations in code generated for try with resources statements
9:26:50 AM PIT >> INFO : +FKOTLIN        Filters out junk mutations in bytecode created by compiler for kotlin language features
9:26:50 AM PIT >> INFO : +FSEQUIVEQUALS  Filters equivalent mutations that affect only performance in short cutting equals methods
9:26:50 AM PIT >> INFO : +FSTATINIT      Filters mutations in static initializers and code called only from them
9:26:50 AM PIT >> INFO : +FLOGCALL       Filters mutations in code that makes calls to logging frameworks
9:26:50 AM PIT >> INFO : +FINFIT         Filters mutations that may cause infinite loops by removing calls to iterator.next
9:26:50 AM PIT >> INFO : +FANN           Filters mutations in classes and methods with matching annotations of class or runtime retention
9:26:50 AM PIT >> INFO :   [annotation]    Annotation to avoid (full package name not required)
9:26:50 AM PIT >> INFO : -CLASSLIMIT     Limits the maximum number of mutations per class
9:26:50 AM PIT >> INFO :   [limit]         Integer value for maximum mutations to create per class
9:26:50 AM PIT >> INFO : ---------------------------------------------------------------------------
9:26:50 AM PIT >> FINE : Running report with ReportOptions [targetClasses=[^com\.beyondscheme\.pitest\..*$], excludedMethods=[], excludedClasses=[], codePaths=[C:\Users\jisarl1\MavenTest\pitest-java-example\target\classes], reportDir=C:\Users\jisarl1\MavenTest\pitest-java-example\target\pit-reports, historyInputLocation=null, historyOutputLocation=null, sourceDirs=[C:\Users\jisarl1\MavenTest\pitest-java-example\src\main\java, C:\Users\jisarl1\MavenTest\pitest-java-example\src\test\java], classPathElements=[C:\Users\jisarl1\MavenTest\pitest-java-example\target\test-classes, C:\Users\jisarl1\MavenTest\pitest-java-example\target\classes, C:\Users\jisarl1\MavenTest\.m2\repository\junit\junit\4.11\junit-4.11.jar, C:\Users\jisarl1\MavenTest\.m2\repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar, C:\Users\jisarl1\MavenTest\.m2\repository\org\pitest\pitest\1.2.3\pitest-1.2.3.jar], mutators=[], dependencyAnalysisMaxDistance=-1, mutateStaticInitializers=false, jvmArgs=[], numberOfThreads=1, timeoutFactor=1.25, timeoutConstant=3000, targetTests=[], loggingClasses=[], maxMutationsPerClass=0, verbose=true, failWhenNoMutations=true, outputs=[HTML], groupConfig=TestGroupConfig [excludedGroups=[], includedGroups=[]], mutationUnitSize=0, shouldCreateTimestampedReports=true, detectInlinedCode=true, exportLineCoverage=false, mutationThreshold=0, coverageThreshold=0, mutationEngine=gregor, javaExecutable=null, includeLaunchClasspath=true, properties={}, maxSurvivors=0, excludedRunners=[], features=[]]
9:26:50 AM PIT >> FINE : System class path is C:\Users\jisarl1\MavenTest\apache-maven-3.3.9\bin\..\boot\plexus-classworlds-2.5.2.jar
9:26:50 AM PIT >> FINE : Maximum available memory is 3570 mb
9:26:51 AM PIT >> FINE : MINION : Installing PIT agent

9:26:51 AM PIT >> INFO : MINION : Error: Could not find or load main class org.pitest.coverage.execute.CoverageMinion




On Friday, September 29, 2017 at 7:57:12 AM UTC-5, Robert Lavey wrote:

Henry Coles

unread,
Sep 29, 2017, 11:24:09 AM9/29/17
to pitu...@googlegroups.com
So much for wild guesses.

I think there has been a similar report before, but I can't remember how/if it was resolved.

I strongly suspect that this is some sort of environmental issue. What happens if you clone

https://github.com/hcoles/pitest-issue-starter

And run

mvn verify

?

Robert Lavey

unread,
Sep 29, 2017, 11:49:07 AM9/29/17
to PIT Users
Thanks, Henry.  I agree this feels like an issue with my environment.

I cloned pitest-issue-starter and get "MINION : Error: Could not find or load main class org.pitest.coverage.execute.CoverageMinion"  


On Friday, September 29, 2017 at 7:57:12 AM UTC-5, Robert Lavey wrote:

Robert Lavey

unread,
Sep 29, 2017, 12:53:32 PM9/29/17
to PIT Users
I've cloned the pitest repository, and I can build 1.2.4-SNAPSHOT, and that runs PIT many times successfully.

Definitely a setup problem with my work computer, too: my personal computer runs that 'mvn verify' in pitest-issue-starter fine.  At least I have a working system, so I can compare environments to see what's going on.

Thanks,
Bob

Robert Lavey

unread,
Sep 29, 2017, 12:55:36 PM9/29/17
to PIT Users
Yep, it's a CLASSPATH problem.  My personal computer has no classpath set, and when I cleared it on my work computer, PIT works fine.

Hopefully this will help someone else in the future.

Thanks for all your help, Henry.

Bob
Message has been deleted

Ziwei Lin

unread,
Mar 4, 2020, 9:40:56 AM3/4/20
to PIT Users
Hi Robert, I have the same problem here. Could you tell me how do you set your CLASSPATH on your computer? I have set java and junit on the CLASSPATH, so cannot just clear it. 

Thanks
Ziwei

Fauzia Khan

unread,
Nov 20, 2023, 2:58:40 AM11/20/23
to PIT Users
Hi,

I am getting this error while executing my junit test file.  
Error: Could not find or load main class org.pitest.pitclipse.runner.PitRunnerMain in module Max
I ran PIT many times but everyone this is causing problem even after re-installing pitclipse. I don't understand what the problem is and how to fix it. Can anyone help please?

Reply all
Reply to author
Forward
0 new messages