Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An issue has occurred with pitest-maven:1.17.0:report report, skipping LinkageError null, please report an issue to Maven dev team. #1358

Open
patpatpat123 opened this issue Nov 1, 2024 · 2 comments

Comments

@patpatpat123
Copy link

Hello team,

Just wanted to say this project is awesome.
I am using the pitest maven plugin, to run pitest as part of the build pipeline process.

During the run, I am always faced with:

An issue has occurred with pitest-maven:1.17.0:report report, skipping LinkageError null, please report an issue to Maven dev team.
java.lang.ExceptionInInitializerError
    at org.apache.commons.lang.builder.ToStringStyle$MultiLineToStringStyle.<init> (ToStringStyle.java:2269)
    at org.apache.commons.lang.builder.ToStringStyle.<clinit> (ToStringStyle.java:95)
    at org.pitest.maven.report.generator.ReportGenerationContext.toString (ReportGenerationContext.java:100)
    at java.lang.String.valueOf (String.java:4556)
    at java.lang.StringBuilder.append (StringBuilder.java:173)
    at org.pitest.maven.report.generator.ReportGenerationManager.generateSiteReport (ReportGenerationManager.java:47)
    at org.pitest.maven.report.PitReportMojo.executeReport (PitReportMojo.java:160)
    at org.apache.maven.reporting.AbstractMavenReport.generate (AbstractMavenReport.java:237)
    at org.apache.maven.plugins.site.render.ReportDocumentRenderer.renderDocument (ReportDocumentRenderer.java:226)
    at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render (DefaultSiteRenderer.java:348)
    at org.apache.maven.plugins.site.render.SiteMojo.renderLocale (SiteMojo.java:194)
    at org.apache.maven.plugins.site.render.SiteMojo.execute (SiteMojo.java:143)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103)
    at java.lang.reflect.Method.invoke (Method.java:580)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:255)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:201)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:361)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:314)
Caused by: java.lang.StringIndexOutOfBoundsException: Range [0, 3) out of bounds for length 2
    at jdk.internal.util.Preconditions$1.apply (Preconditions.java:55)
    at jdk.internal.util.Preconditions$1.apply (Preconditions.java:52)
    at jdk.internal.util.Preconditions$4.apply (Preconditions.java:213)
    at jdk.internal.util.Preconditions$4.apply (Preconditions.java:210)
    at jdk.internal.util.Preconditions.outOfBounds (Preconditions.java:98)
    at jdk.internal.util.Preconditions.outOfBoundsCheckFromToIndex (Preconditions.java:112)
    at jdk.internal.util.Preconditions.checkFromToIndex (Preconditions.java:349)
    at java.lang.String.checkBoundsBeginEnd (String.java:4963)
    at java.lang.String.substring (String.java:2925)
    at org.apache.commons.lang.SystemUtils.getJavaVersionAsFloat (SystemUtils.java:1133)
    at org.apache.commons.lang.SystemUtils.<clinit> (SystemUtils.java:818)
    at org.apache.commons.lang.builder.ToStringStyle$MultiLineToStringStyle.<init> (ToStringStyle.java:2269)
    at org.apache.commons.lang.builder.ToStringStyle.<clinit> (ToStringStyle.java:95)
    at org.pitest.maven.report.generator.ReportGenerationContext.toString (ReportGenerationContext.java:100)
    at java.lang.String.valueOf (String.java:4556)
    at java.lang.StringBuilder.append (StringBuilder.java:173)
    at org.pitest.maven.report.generator.ReportGenerationManager.generateSiteReport (ReportGenerationManager.java:47)
    at org.pitest.maven.report.PitReportMojo.executeReport (PitReportMojo.java:160)
    at org.apache.maven.reporting.AbstractMavenReport.generate (AbstractMavenReport.java:237)
    at org.apache.maven.plugins.site.render.ReportDocumentRenderer.renderDocument (ReportDocumentRenderer.java:226)
    at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render (DefaultSiteRenderer.java:348)
    at org.apache.maven.plugins.site.render.SiteMojo.renderLocale (SiteMojo.java:194)
    at org.apache.maven.plugins.site.render.SiteMojo.execute (SiteMojo.java:143)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103)
    at java.lang.reflect.Method.invoke (Method.java:580)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:255)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:201)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:361)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:314)

Apologies for the big copy-paste. As I do not know what is needed to further debug this issue, could you please let me know what I can provide to help resolve it?

Thank you for being so helpful

@hcoles
Copy link
Owner

hcoles commented Nov 1, 2024

The issue looks to be that something in apache commons is trying (and failing) to parse the current Java version. It's not clear why anything here needs to know the Java version - the code looks to be being called by some kind of reflective toString builder called by some user contributed code.

I'll see if that can be easily stripped out.

Can you confirm the exact build and version of java this is occurring on?

@patpatpat123
Copy link
Author

Thank you for looking into this @hcoles .

Here is the snippet from my pom file:

   <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <image>
                        <env>
                            <BP_JVM_VERSION>23</BP_JVM_VERSION>
                        </env>
                    </image>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.graalvm.buildtools</groupId>
                <artifactId>native-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.pitest</groupId>
                <artifactId>pitest-maven</artifactId>
                <version>1.17.0</version>
                <configuration>
                    <skip>false</skip>
                    <sourceDataFormats>
                        <sourceDataFormat>HTML</sourceDataFormat>
                        <sourceDataFormat>HTML</sourceDataFormat>
                    </sourceDataFormats>
                    <threads>16</threads>
                    <outputFormats>
                        <param>XML</param>
                        <param>HTML</param>
                    </outputFormats>
                    <mutators>
                        <mutator>CONDITIONALS_BOUNDARY</mutator>
                        <mutator>INCREMENTS</mutator>
                        <mutator>INVERT_NEGS</mutator>
                        <mutator>MATH</mutator>
                        <mutator>NEGATE_CONDITIONALS</mutator>
                        <mutator>EMPTY_RETURNS</mutator>
                        <mutator>FALSE_RETURNS</mutator>
                        <mutator>TRUE_RETURNS</mutator>
                        <mutator>PRIMITIVE_RETURNS</mutator>
                        <mutator>REMOVE_INCREMENTS</mutator>
                        <mutator>EXPERIMENTAL_BIG_INTEGER</mutator>
                        <mutator>EXPERIMENTAL_MEMBER_VARIABLE</mutator>
                        <mutator>EXPERIMENTAL_SWITCH</mutator>
                    </mutators>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.pitest</groupId>
                        <artifactId>pitest-junit5-plugin</artifactId>
                        <version>1.2.1</version>
                    </dependency>
                </dependencies>
            </plugin>

And here is the java I am using:

java --version
java 23 2024-09-17
Java(TM) SE Runtime Environment Oracle GraalVM 23+37.1 (build 23+37-jvmci-b01)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 23+37.1 (build 23+37-jvmci-b01, mixed mode, sharing)

It is fairly recent java, I hope this is not causing problem

hcoles added a commit that referenced this issue Nov 1, 2024
The reflection based toString generator fails on some modern jvms as apache commons tries
to parse out the version of Java, but fails due to outdated assumptions.

Not clear why it's inmportant to have a toString method here, but replacing with an autogenerated one
should solve #1358. Implementation excludes logger and sink form toString as it's unclear how they would be useful.
hcoles added a commit that referenced this issue Nov 1, 2024
The reflection based toString generator fails on some modern jvms as apache commons tries
to parse out the version of Java, but fails due to outdated assumptions.

Not clear why it's inmportant to have a toString method here, but replacing with an autogenerated one
should solve #1358. Implementation excludes logger and sink form toString as it's unclear how they would be useful.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants