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

Inconsistent constantpool data in classfile #290

Closed
mattagohni opened this issue Nov 7, 2023 · 6 comments
Closed

Inconsistent constantpool data in classfile #290

mattagohni opened this issue Nov 7, 2023 · 6 comments

Comments

@mattagohni
Copy link

Hi there,
I hope I'm correct here. After upgrading this package in my project from 1.1.0 to 1.2.0 I get the following for me rather exotic error:

Inconsistent constant pool data in classfile for class io/dekorate/helm/config/HelmChartConfigFluent. Method 'io.dekorate.helm.config.HelmChartConfigFluent withDescription(java.lang.String)' at index 858 is CONSTANT_MethodRef and should be CONSTANT_InterfaceMethodRef

Some googling pointed to breaking changes in libraries which cause such behaviour. Honestly I'm not sure how I can work around this, since all tips I foud tell me to mvn clean build but that doesn't work for me. Here is a stackoverflow link (sadly rather old 13+years)

https://stackoverflow.com/questions/1980452/what-causes-java-lang-incompatibleclasschangeerror

When I downgrade to 1.1.0 everything works fine. The error appears durin build-phase (tests are all green).

here is my configuration for the quarkus-maven-plugin (in version 3.5.0). I'm currently using Java 17.

<build>
  <plugins>
     <plugin>
           <groupId>io.quarkus</groupId>
           <artifactId>quarkus-maven-plugin</artifactId>
           <version>${quarkus-maven-plugin.version}</version>
           <executions>
               <execution>
                    <goals>
                         <goal>build</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
  </plugins>
</build>

Is there anything I can do? For now I will stay on 1.1.0, but I would like to upgrade at some point in time. :) Thx for any help in advance!

@Sgitario
Copy link
Contributor

Sgitario commented Nov 7, 2023

This issue is very similar to #287, and Quarkus Helm 1.2.0 was meant to fix the incompatibility class issue.

However, I've never seen the Inconsistent constant pool data error. Can you share a reproducer? so I can deep into it. Otherwise, can you check the reproducer from #287 (comment) and see what is different?

@mattagohni
Copy link
Author

Thx for the quick response. Sadly, my project is internal, but I will try to recreate a generic project to reproduce this. Hope I can update here tomorrow!

@mattagohni
Copy link
Author

mattagohni commented Nov 8, 2023

Hi @Sgitario , I have created an empty maven-project with the exact dependencies I'm using in my internal project. The problem is reproducable with this repo.

https://github.com/mattagohni/quarkus-helm-incositant-pool-data

There are 2 branches:

  • main: here quarkus-helm is installed in 1.2.0 and the github-Action reproduces the error
  • with-downgraded-quarkus-helm : here quarkus-helm is installed in 1.1.0 . The build with github-Action is green as expected.

Hope this helps, if I can provide further assistance, let me know. :)

@Sgitario
Copy link
Contributor

Sgitario commented Nov 8, 2023

Hi @Sgitario , I have created an empty maven-project with the exact dependencies I'm using in my internal project. The problem is reproducable with this repo.

https://github.com/mattagohni/quarkus-helm-incositant-pool-data

There are 2 branches:

  • main: here quarkus-helm is installed in 1.2.0 and the github-Action reproduces the error
  • with-downgraded-quarkus-helm : here quarkus-helm is installed in 1.1.0 . The build with github-Action is green as expected.

Hope this helps, if I can provide further assistance, let me know. :)

The problem is that you're not really using Quarkus 3.5.0 (you're only using the Quarkus Maven plugin 3.5.0). Because you're declaring:

<dependency>
                <groupId>io.quarkiverse.operatorsdk</groupId>
                <artifactId>quarkus-operator-sdk-bom</artifactId>
                <version>${quarkus-sdk.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

Where quarkus-sdk.version is 6.3.3, this bom is enforcing Quarkus 3.2.6.Final (note that you can confirm it running mvn quarkus:dependency-tree. And Quarkus 3.2.6.Final is not compatible with Quarkus Helm 1.2.0 as you're experiencing.

The right Maven configuration when you're installing Quarkiverse dependencies is:

<properties>
    <compiler-plugin.version>3.11.0</compiler-plugin.version>
    <maven.compiler.release>17</maven.compiler.release>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <quarkus.platform.version>3.5.0</quarkus.platform.version>
    <skipITs>true</skipITs>
    <surefire-plugin.version>3.1.2</surefire-plugin.version>
  </properties>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>io.quarkus.platform</groupId>
        <artifactId>quarkus-bom</artifactId>
        <version>${quarkus.platform.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>io.quarkus.platform</groupId>
        <artifactId>quarkus-operator-sdk-bom</artifactId>
        <version>${quarkus.platform.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>io.quarkiverse.helm</groupId>
      <artifactId>quarkus-helm</artifactId>
      <version>1.2.0</version>
    </dependency>
    <dependency>
      <groupId>io.quarkiverse.operatorsdk</groupId>
      <artifactId>quarkus-operator-sdk</artifactId>
    </dependency>
....
</dependencies>
<build>
    <plugins>
      <plugin>
        <groupId>io.quarkus.platform</groupId>
        <artifactId>quarkus-maven-plugin</artifactId>
        <version>${quarkus.platform.version}</version>
        <extensions>true</extensions>
        <executions>
          <execution>
            <goals>
              <goal>build</goal>
              <goal>generate-code</goal>
              <goal>generate-code-tests</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
....

With the above configuration, your reproducer now works fine.
I'm closing the ticket, but let me know if this is still not working for you!

@Sgitario Sgitario closed this as completed Nov 8, 2023
@mattagohni
Copy link
Author

mattagohni commented Nov 8, 2023

thx, for your explanation and your support. This explains a lot. :)

@mattagohni
Copy link
Author

mattagohni commented Nov 9, 2023

Your hint solved my problem. 🎉 Thx again for your support!

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