ClassNotFoundException using gradle plugin 1.7.0

84 views
Skip to first unread message

Ugo Delle Donne

unread,
Nov 26, 2021, 3:31:42 AM11/26/21
to pitu...@googlegroups.com
Hi Folks,
I just ran into an error trying to upgrade the pitest gradle plugin.

I'm using the buildscript configuration and when I run the pitest task on my module with the version 1.7.0 I get the stacktrace below


Please copy and paste the information and the complete stacktrace below when reporting an issue
VM : Java HotSpot(TM) 64-Bit Server VM
Vendor : Oracle Corporation
Version : 11.0.11+9-LTS-194
Uptime : 6311
Input ->
 1 : -Djdk.attach.allowAttachSelf=true
 2 : -Dfile.encoding=UTF-8
 3 : -Duser.country=US
 4 : -Duser.language=en
 5 : -Duser.variant
BootClassPathSupported : false

        at org.pitest.util.Unchecked.translateCheckedException(Unchecked.java:20)
        at org.pitest.mutationtest.incremental.ObjectOutputStreamHistoryStore.deserialize(ObjectOutputStreamHistoryStore.java:129)
        at org.pitest.mutationtest.incremental.ObjectOutputStreamHistoryStore.restoreResults(ObjectOutputStreamHistoryStore.java:99)
        at org.pitest.mutationtest.incremental.ObjectOutputStreamHistoryStore.initialize(ObjectOutputStreamHistoryStore.java:85)
        at org.pitest.mutationtest.tooling.MutationCoverage.runAnalysis(MutationCoverage.java:159)
        at org.pitest.mutationtest.tooling.MutationCoverage.runReport(MutationCoverage.java:139)
        at org.pitest.mutationtest.tooling.EntryPoint.execute(EntryPoint.java:125)
        at org.pitest.mutationtest.tooling.EntryPoint.execute(EntryPoint.java:52)
        at org.pitest.mutationtest.commandline.MutationCoverageReport.runReport(MutationCoverageReport.java:98)
        at org.pitest.mutationtest.commandline.MutationCoverageReport.main(MutationCoverageReport.java:45)
Caused by: java.lang.ClassNotFoundException: org.pitest.mutationtest.engine.MethodName
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:398)
        at java.base/java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:756)
        at java.base/java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1995)
        at java.base/java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1862)
        at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2169)
        at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1679)
        at java.base/java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2464)
        at java.base/java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2358)
        at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2196)
        at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1679)
        at java.base/java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2464)
        at java.base/java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2358)
        at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2196)
        at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1679)
        at java.base/java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2464)
        at java.base/java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2358)
        at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2196)
        at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1679)
        at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:493)
        at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:451)
        at org.pitest.mutationtest.incremental.ObjectOutputStreamHistoryStore.deserialize(ObjectOutputStreamHistoryStore.java:127)
        ... 8 more

Looking in the repo for the PiTest and the plugin I could not find the missing class anywhere.

Has anybody else experienced this? Am I missing something?

Thanks in advance,
Ugo


Ugo Delle Donne

unread,
Nov 26, 2021, 3:45:12 AM11/26/21
to pitu...@googlegroups.com
Small update, the error occurs only if the pitest gradle task is configured with the parameter "withHistory=true"

Henry Coles

unread,
Nov 26, 2021, 4:09:02 AM11/26/21
to pitu...@googlegroups.com
It sounds like you have a history file from an earlier incompatible version of pitest. The history file should be deleted when upgrading. Admittedly pitest should handle this much more gracefully when it is not.

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+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pitusers/CAJpMazTZ0Z--jUkpaKvtPiRc3dM0YRoUtJWiRmnTTSGYwqXrHA%40mail.gmail.com.

Marcin Zajączkowski

unread,
Nov 26, 2021, 9:59:09 AM11/26/21
to 'Henry Coles' via PIT Users
On 2021-11-26 10:08, 'Henry Coles' via PIT Users wrote:
> It sounds like you have a history file from an earlier incompatible version
> of pitest. The history file should be deleted when upgrading. Admittedly
> pitest should handle this much more gracefully when it is not.

Exactly, I would suspect what Henry just said.

Btw, it is worth to read the release notes :)

> Due to the internal changes in PIT 1.7.0 (#630):
>
> - all history files should be deleted before upgrading
> - the names of the remove conditionals mutators have changed slightly (it might be needed to update their names in build.gradle, if activated explicitly)

https://github.com/szpak/gradle-pitest-plugin/releases/tag/release%2F1.7.0

Marcin



> On Fri, 26 Nov 2021 at 08:45, Ugo Delle Donne <udel...@gmail.com> wrote:
>
>> Small update, the error occurs only if the pitest gradle task is
>> configured with the parameter "*withHistory=true"*

Ugo Delle Donne

unread,
Nov 26, 2021, 10:13:39 AM11/26/21
to pitu...@googlegroups.com
Hi Henry/Martin,

Thank you both for the feedback, I'm pretty sure the problem was definitely what Henry mentioned.

I was suggested to update by Idea and with the autocompletion I hadn't opened the project page on github and I got the withHistory settings from an external change so to be honest I'm not sure I would have gotten much benefit from reading the Release note.

However you are right, it could still be considered an edge case of RTFM, though some match on Google or StackOverflow might have helped  :)

Thanks for all the hard work.
Ugo

--
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+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages