0

Can someone point me to a project, preferably GitHub, where there is an example of our key technologies working under Java 17 so I can get a sense of harmonious dependency versions?

org.spockframework.util.InternalSpockError: Failed to instantiate spec 'CQRSExceptionMapperSpec'
        at app//org.spockframework.runtime.PlatformSpecRunner.createSpecInstance(PlatformSpecRunner.java:80)
        at app//org.spockframework.runtime.PlatformSpecRunner.runSharedSpec(PlatformSpecRunner.java:45)
. . .
Caused by: java.util.ServiceConfigurationError: Error instantiating :io.helidon.microprofile.server.JaxRsCdiExtension
. . .
Caused by: java.lang.VerifyError: Bad type on operand stack
Exception Details:
  Location:
    io/helidon/microprofile/server/JaxRsCdiExtension.toJerseySupport(Ljava/util/function/Supplier;Lio/helidon/microprofile/server/JaxRsApplication;Lorg/glassfish/jersey/internal/inject/InjectionManager;)Lio/helidon/webserver/jersey/JerseySupport; @4: invokestatic
  Reason:
    Type 'org/glassfish/jersey/server/ResourceConfig' (current frame, stack[0]) is not assignable to 'javax/ws/rs/core/Application'
  Current Frame:
    bci: @4
    flags: { }
    locals: { 'io/helidon/microprofile/server/JaxRsCdiExtension', 'java/util/function/Supplier', 'io/helidon/microprofile/server/JaxRsApplication', 'org/glassfish/jersey/internal/inject/InjectionManager' }
    stack: { 'org/glassfish/jersey/server/ResourceConfig' }
  Bytecode:
    0000000: 2cb6 004d b800 4e3a 0419 04b8 0035 c000
    0000010: 4f12 50b9 0051 0200 b600 5257 1904 2cb6
    0000020: 0053 2bb6 0054 c000 55b6 0056 5719 04bb
    0000030: 0057 592a b700 58b6 0059 5719 042d b600
    0000040: 5a57 1904 b600 5bb0                    

    at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3373)
    at java.base/java.lang.Class.getConstructor0(Class.java:3578)
    at java.base/java.lang.Class.getDeclaredConstructor(Class.java:2754)
    at org.jboss.weld.util.ServiceLoader.createInstance(ServiceLoader.java:311)
    ... 81 more

I apologize for the noise, but I have spent too many days on this...

I am trying to update our code base from Java 8 and 11 to 17, but run into multifarious dependency hell problems with Helidon, Jersy, Jackson, Spock, Groovy, etc.

Consulting Chat GPT I get lots of advice

The error message you provided, java.util.ServiceConfigurationError: Error instantiating io.helidon.microprofile.server.JaxRsCdiExtension, indicates that there's an issue with the instantiation of the io.helidon.microprofile.server.JaxRsCdiExtension class while using Helidon MicroProfile Server.

Here are a few steps you can take to troubleshoot and resolve this issue:

Check Dependencies: Ensure that you have the correct versions of Helidon MicroProfile and its dependencies. Make sure there are no version conflicts between different dependencies.

Classpath Issues: Verify that all the required JARs and libraries are included in your classpath. Sometimes, missing or conflicting libraries can lead to instantiation errors.

Correct Configuration: Review your configuration settings. Ensure that you've set up Helidon MicroProfile Server correctly, including any configuration files or annotations required for the JAX-RS and CDI extensions.

Logging and Debugging: Increase the logging level to see if there are more detailed error messages. This might help you pinpoint the exact cause of the issue.

Check for Known Issues: Search for any known issues related to the specific version of Helidon MicroProfile Server you are using. The issue might be a known bug with a workaround or a fix in a newer version.

Check Environment: Make sure your runtime environment (such as Java version) is compatible with the version of Helidon MicroProfile you are using.

Isolation: If you're using a dependency management tool like Maven or Gradle, try building a clean project or isolating the issue to ensure that it's not caused by interactions with other project components.

Contact Support or Community: If you can't resolve the issue on your own, consider reaching out to the Helidon MicroProfile community or support channels. They might be able to provide specific guidance based on your use case.

Remember that the error you're encountering is specific to the context of your project and its configuration. It's important to carefully review your project setup and troubleshoot systematically to identify the root cause of the issue.

and now I am at the "Contact Support or Community" step.

From our gradle.build I have

ext {
    immutablesVersion = "2.8.8"
    // helidonVersion = "2.6.0"
    helidonVersion = "2.6.2"
    jandexVersion = "0.8.0"
    groovyVersion = "4.0.13"
    spockVersion = "2.3-groovy-4.0"
    jacksonVersion = "2.14.2"
    jerseyJacksonVersion = "3.1.3"
    slf4jVersion = "1.7.30"
    log4j2Version="2.17.1"
    jerseyClientVersion = "2.31"
    apacheCommonsLang3Version = "3.8.1"
    jacksonAnnotationsVersion = "2.14.2"
    jacksonDataformatVersion = "2.14.2"
    jacksonDatabindVersion = "2.14.2"
    gcsVersion = "2.7.2"
    commonsCodecVersion = "1.15"
    nettyVersion = "4.1.86.Final"
    apacheCommonsVersion = "3.8.1"
    commonsCompressVersion = "1.21"
    bouncyCastleBcprovVersion = "1.67"
    jsltVersion = "0.1.11"
    googleLibrariesVersion = "26.1.3"
    prometheusJmxAgentVersion = "0.17.2"
    testngVersion = "7.7.1"
    jsonVersion = "20230227"
    jose4jVersion = "0.9.3"
    lz4JavaVersion = "1.8.0"
    kafkaVersion = "3.4.0"
}

Can someone point me to a project, preferably GitHub, where there is an example of our key technologies working under Java 17 so I can get a sense of harmonious dependency versions?

kriegaex
  • 63,017
  • 15
  • 111
  • 202
Eric Kolotyluk
  • 1,958
  • 2
  • 21
  • 30
  • You about you sharing a minimal reproducer on GitHub first, before asking others to throw you a complete GitHub solution over the fence? I think, that would also motivate others to help you, even if they do not have a pre-fabricated solution for you yet. – kriegaex Aug 11 '23 at 01:03
  • Based on prior experience with minimal reproducers, this is not a viable option. I have build many minimal reproducers, where some are straightforward, but some are intractable, and I sense this would be intractable. – Eric Kolotyluk Aug 11 '23 at 15:24
  • Up to you and good luck, then. I would have expected someone with your level of experience to be able to come up with one, but that's the problem with guesses: They are often wrong. – kriegaex Aug 11 '23 at 15:36

1 Answers1

1

Helidon provides dependencies management. See a Gradle example here. You can also look at the pom directly here.

Romain Grecourt
  • 488
  • 2
  • 4