smallrye / jandex

Java Annotation Indexer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

java.lang.ClassCastException

kolotyluk opened this issue · comments

> Task :test FAILED

AnalyticsResourceEndToEndSpec > initializationError FAILED
    org.spockframework.util.InternalSpockError: Failed to instantiate spec 'AnalyticsResourceEndToEndSpec'
        at app//org.spockframework.runtime.PlatformSpecRunner.createSpecInstance(PlatformSpecRunner.java:80)
        at app//org.spockframework.runtime.PlatformSpecRunner.runSharedSpec(PlatformSpecRunner.java:45)
. . .
    Caused by:
    java.lang.ClassCastException: class org.jboss.jandex.MethodParameterInfo cannot be cast to class org.jboss.jandex.Type (org.jboss.jandex.MethodParameterInfo and org.jboss.jandex.Type are in unnamed module of loader 'app')
                    at io.smallrye.openapi.runtime.scanner.dataobject.TypeResolver.scanMethod(TypeResolver.java:717)
                    at io.smallrye.openapi.runtime.scanner.dataobject.TypeResolver.lambda$getAllFields$4(TypeResolver.java:473)

build.gradle

plugins {
    id "groovy"
    id "java"
    id "application"
    id "org.kordamp.gradle.jandex" version "1.1.0"
    id "com.google.cloud.tools.jib"
}
. . .
java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(11)
    }
}
. . .
dependencies {
    . . .
    runtimeOnly "org.jboss:jandex:3.0.5"
    . . .
}
. . .
jandex { // TODO is this needed?
    version = '3.0.5'
}

I am at a loss to know what is going wrong here, so any suggestions would be greatly appreciated.

In the process of upgrading our code base from Java 8 to Java 11 & 17, I started getting these errors.

I can provide more context on request...

What version of smallrye-open-api are you using? This issue might be better there: https://github.com/smallrye/smallrye-open-api/issues

You will probably need at least smallrye-open-api 2.1.23, but even that is quite old now.

CLASSPATH=$APP_HOME/lib/jas-service.jar:$APP_HOME/lib/jas-lib-1.0-SNAPSHOT.jar:$APP_HOME/lib/query-lib-1.0-SNAPSHOT.jar:$APP_HOME/lib/email-service-1.0-SNAPSHOT.jar:$APP_HOME/lib/eps-store-1.0-SNAPSHOT.jar:$APP_HOME/lib/cassandra-store-1.0-SNAPSHOT.jar:$APP_HOME/lib/bigTable-store-1.0-SNAPSHOT.jar:$APP_HOME/lib/mongo-store-1.0-SNAPSHOT.jar:$APP_HOME/lib/object-store-1.0-SNAPSHOT.jar:$APP_HOME/lib/elastic-store-1.0-SNAPSHOT.jar:$APP_HOME/lib/opensearch-store-1.0-SNAPSHOT.jar:$APP_HOME/lib/cloud-datastore-store-1.0-SNAPSHOT.jar:$APP_HOME/lib/data-store-api-1.0-SNAPSHOT.jar:$APP_HOME/lib/jdbc-service-1.0-SNAPSHOT.jar:$APP_HOME/lib/common-utils-1.0-SNAPSHOT.jar:$APP_HOME/lib/messaging-service-api-1.0-SNAPSHOT.jar:$APP_HOME/lib/event-republisher-1.0-SNAPSHOT.jar:$APP_HOME/lib/event-lib-1.0-SNAPSHOT.jar:$APP_HOME/lib/job-service-1.0-SNAPSHOT.jar:$APP_HOME/lib/etl-job-executor-1.0-SNAPSHOT.jar:$APP_HOME/lib/service-config-1.0-SNAPSHOT.jar:$APP_HOME/lib/utils.jar:$APP_HOME/lib/gcp-utils-1.0-SNAPSHOT.jar:$APP_HOME/lib/jslt-0.1.11.jar:$APP_HOME/lib/google-cloud-pubsublite-1.7.1.jar:$APP_HOME/lib/google-cloud-pubsub-1.120.20.jar:$APP_HOME/lib/jersey-media-json-jackson-2.35.jar:$APP_HOME/lib/forgerock-audit-core-26.1.0-20210222151344-4109148.jar:$APP_HOME/lib/bundle-1.0-SNAPSHOT.jar:$APP_HOME/lib/json-resource-26.1.0-20210222151344-4109148.jar:$APP_HOME/lib/api-descriptor-26.1.0-20210222151344-4109148.jar:$APP_HOME/lib/chf-http-core-26.1.0-20210222151344-4109148.jar:$APP_HOME/lib/jackson-dataformat-csv-2.13.4.jar:$APP_HOME/lib/jackson-jaxrs-yaml-provider-2.13.4.jar:$APP_HOME/lib/elasticsearch-rest-high-level-client-7.17.6.jar:$APP_HOME/lib/elasticsearch-7.17.6.jar:$APP_HOME/lib/elasticsearch-x-content-7.17.6.jar:$APP_HOME/lib/helidon-microprofile-2.5.3.jar:$APP_HOME/lib/helidon-microprofile-openapi-2.5.3.jar:$APP_HOME/lib/helidon-openapi-2.5.3.jar:$APP_HOME/lib/smallrye-open-api-jaxrs-2.0.26.jar:$APP_HOME/lib/smallrye-open-api-core-2.0.26.jar:$APP_HOME/lib/jackson-dataformat-yaml-2.13.4.jar:$APP_HOME/lib/jackson-datatype-jsr310-2.13.4.jar:$APP_HOME/lib/jackson-datatype-jsr353-2.13.4.jar:$APP_HOME/lib/jackson-jaxrs-json-provider-2.13.4.jar:$APP_HOME/lib/jackson-module-jaxb-annotations-2.13.4.jar:$APP_HOME/lib/jackson-module-parameter-names-2.13.4.jar:$APP_HOME/lib/jackson-module-scala_2.12-2.13.4.jar:$APP_HOME/lib/jackson-jaxrs-base-2.13.4.jar:$APP_HOME/lib/jackson-module-jsonSchema-2.13.4.jar:$APP_HOME/lib/jackson-databind-2.13.4.2.jar:$APP_HOME/lib/swagger-models-1.5.16.jar:$APP_HOME/lib/jackson-annotations-2.13.4.jar:$APP_HOME/lib/google-cloud-storage-2.13.0.jar:$APP_HOME/lib/google-cloud-datastore-2.11.5.jar:$APP_HOME/lib/jackson-core-2.13.4.jar:$APP_HOME/lib/jackson-datatype-jdk8-2.13.4.jar:$APP_HOME/lib/jersey-media-json-binding-2.35.jar:$APP_HOME/lib/microprofile-openapi-api-1.2.jar:$APP_HOME/lib/slf4j-simple-1.7.32.jar:$APP_HOME/lib/cron-utils-9.1.6.jar:$APP_HOME/lib/security-26.1.0-20210222151344-4109148.jar:$APP_HOME/lib/secrets-api-26.1.0-20210222151344-4109148.jar:$APP_HOME/lib/json-schema-core-26.1.0-20210222151344-4109148.jar:$APP_HOME/lib/forgerock-util-26.1.0-20210222151344-4109148.jar:$APP_HOME/lib/log4j-slf4j18-impl-2.17.2.jar:$APP_HOME/lib/simple-java-mail-6.5.0.jar:$APP_HOME/lib/handlebars-4.3.1.jar:$APP_HOME/lib/kafka-clients-2.8.2.jar:$APP_HOME/lib/client-java-11.0.2.jar:$APP_HOME/lib/log4j-slf4j-impl-2.19.0.jar:$APP_HOME/lib/java-driver-mapper-runtime-4.15.0.jar:$APP_HOME/lib/java-driver-query-builder-4.15.0.jar:$APP_HOME/lib/java-driver-core-4.15.0.jar:$APP_HOME/lib/core-module-6.5.0.jar:$APP_HOME/lib/jetbrains-runtime-annotations-1.0.0.jar:$APP_HOME/lib/jose4j-0.7.3.jar:$APP_HOME/lib/metrics-core-4.1.18.jar:$APP_HOME/lib/emailaddress-rfc2822-2.2.0.jar:$APP_HOME/lib/slf4j-api-1.7.30.jar:$APP_HOME/lib/google-cloud-bigtable-2.14.1.jar:$APP_HOME/lib/google-api-services-dataflow-v1b3-rev20220920-2.0.0.jar:$APP_HOME/lib/google-api-client-2.0.0.jar:$APP_HOME/lib/google-cloud-bigtable-emulator-0.151.1.jar:$APP_HOME/lib/google-cloud-secretmanager-2.3.10.jar:$APP_HOME/lib/gax-grpc-2.19.2.jar:$APP_HOME/lib/google-cloud-bigtable-stats-2.14.1.jar:$APP_HOME/lib/grpc-googleapis-1.49.2.jar:$APP_HOME/lib/grpc-xds-1.49.2.jar:$APP_HOME/lib/grpc-alts-1.49.2.jar:$APP_HOME/lib/gax-2.19.2.jar:$APP_HOME/lib/google-auth-library-oauth2-http-1.11.0.jar:$APP_HOME/lib/google-http-client-gson-1.42.2.jar:$APP_HOME/lib/google-http-client-apache-v2-1.42.2.jar:$APP_HOME/lib/google-http-client-1.42.2.jar:$APP_HOME/lib/elasticsearch-rest-client-7.17.6.jar:$APP_HOME/lib/httpclient-4.5.13.jar:$APP_HOME/lib/commons-codec-1.15.jar:$APP_HOME/lib/client-java-api-11.0.2.jar:$APP_HOME/lib/commons-lang3-3.11.jar:$APP_HOME/lib/commons-csv-1.8.jar:$APP_HOME/lib/jmx_prometheus_javaagent-0.17.2.jar:$APP_HOME/lib/groovy-json-4.0.10.jar:$APP_HOME/lib/groovy-4.0.10.jar:$APP_HOME/lib/helidon-microprofile-jwt-auth-2.5.3.jar:$APP_HOME/lib/helidon-microprofile-security-2.5.3.jar:$APP_HOME/lib/helidon-security-integration-jersey-2.5.3.jar:$APP_HOME/lib/helidon-security-integration-jersey-client-2.5.3.jar:$APP_HOME/lib/helidon-bundles-security-2.5.3.jar:$APP_HOME/lib/helidon-security-abac-time-2.5.3.jar:$APP_HOME/lib/helidon-security-abac-role-2.5.3.jar:$APP_HOME/lib/helidon-security-providers-oidc-2.5.3.jar:$APP_HOME/lib/helidon-security-abac-scope-2.5.3.jar:$APP_HOME/lib/helidon-security-abac-policy-2.5.3.jar:$APP_HOME/lib/helidon-security-providers-abac-2.5.3.jar:$APP_HOME/lib/commons-compress-1.21.jar:$APP_HOME/lib/bcprov-ext-jdk15on-1.67.jar:$APP_HOME/lib/helidon-microprofile-core-2.5.3.jar:$APP_HOME/lib/helidon-microprofile-metrics-2.5.3.jar:$APP_HOME/lib/helidon-microprofile-fault-tolerance-2.5.3.jar:$APP_HOME/lib/helidon-microprofile-tracing-2.5.3.jar:$APP_HOME/lib/helidon-service-common-rest-cdi-2.5.3.jar:$APP_HOME/lib/helidon-microprofile-server-2.5.3.jar:$APP_HOME/lib/helidon-microprofile-config-2.5.3.jar:$APP_HOME/lib/helidon-microprofile-cdi-2.5.3.jar:$APP_HOME/lib/helidon-config-yaml-mp-2.5.3.jar:$APP_HOME/lib/helidon-config-yaml-2.5.3.jar:$APP_HOME/lib/snakeyaml-1.33.jar:$APP_HOME/lib/grpc-google-cloud-bigtable-v2-2.14.1.jar:$APP_HOME/lib/grpc-google-cloud-pubsublite-v1-1.7.1.jar:$APP_HOME/lib/api-common-2.2.1.jar:$APP_HOME/lib/proto-google-cloud-pubsub-v1-1.102.20.jar:$APP_HOME/lib/proto-google-cloud-bigtable-v2-2.14.1.jar:$APP_HOME/lib/proto-google-cloud-bigtable-admin-v2-2.14.1.jar:$APP_HOME/lib/proto-google-cloud-pubsublite-v1-1.7.1.jar:$APP_HOME/lib/proto-google-cloud-secretmanager-v1-2.3.10.jar:$APP_HOME/lib/proto-google-cloud-secretmanager-v1beta1-2.3.10.jar:$APP_HOME/lib/auto-value-annotations-1.9.jar:$APP_HOME/lib/grpc-auth-1.49.2.jar:$APP_HOME/lib/grpc-grpclb-1.49.2.jar:$APP_HOME/lib/opencensus-proto-0.2.0.jar:$APP_HOME/lib/grpc-services-1.49.2.jar:$APP_HOME/lib/grpc-protobuf-1.49.2.jar:$APP_HOME/lib/grpc-stub-1.49.2.jar:$APP_HOME/lib/grpc-netty-shaded-1.49.2.jar:$APP_HOME/lib/grpc-core-1.49.2.jar:$APP_HOME/lib/grpc-google-cloud-datastore-admin-v1-2.11.5.jar:$APP_HOME/lib/grpc-protobuf-lite-1.49.2.jar:$APP_HOME/lib/grpc-api-1.49.2.jar:$APP_HOME/lib/opencensus-contrib-http-util-0.31.1.jar:$APP_HOME/lib/opencensus-api-0.31.1.jar:$APP_HOME/lib/grpc-context-1.49.2.jar:$APP_HOME/lib/grpc-rls-1.49.2.jar:$APP_HOME/lib/gax-httpjson-0.104.2.jar:$APP_HOME/lib/google-oauth-client-1.34.1.jar:$APP_HOME/lib/protobuf-java-util-3.21.7.jar:$APP_HOME/lib/guava-31.1-jre.jar:$APP_HOME/lib/mysql-connector-java-8.0.28.jar:$APP_HOME/lib/client-java-proto-11.0.2.jar:$APP_HOME/lib/proto-google-common-protos-2.9.6.jar:$APP_HOME/lib/protobuf-java-3.21.7.jar:$APP_HOME/lib/google-cloud-core-2.8.20.jar:$APP_HOME/lib/google-cloud-core-http-2.8.20.jar:$APP_HOME/lib/google-auth-library-credentials-1.11.0.jar:$APP_HOME/lib/google-http-client-appengine-1.42.2.jar:$APP_HOME/lib/google-http-client-jackson2-1.42.2.jar:$APP_HOME/lib/google-http-client-protobuf-1.42.2.jar:$APP_HOME/lib/gson-fire-1.8.5.jar:$APP_HOME/lib/gson-2.9.1.jar:$APP_HOME/lib/proto-google-iam-v1-1.6.2.jar:$APP_HOME/lib/google-cloud-bigtable-emulator-core-0.151.1.jar:$APP_HOME/lib/proto-google-cloud-datastore-v1-0.102.5.jar:$APP_HOME/lib/proto-google-cloud-datastore-admin-v1-2.11.5.jar:$APP_HOME/lib/google-cloud-monitoring-3.4.6.jar:$APP_HOME/lib/proto-google-cloud-monitoring-v3-3.4.6.jar:$APP_HOME/lib/helidon-webserver-static-content-2.5.3.jar:$APP_HOME/lib/helidon-webserver-jersey-2.5.3.jar:$APP_HOME/lib/helidon-security-providers-oidc-common-2.5.3.jar:$APP_HOME/lib/helidon-microprofile-health-2.5.3.jar:$APP_HOME/lib/helidon-health-checks-2.5.3.jar:$APP_HOME/lib/helidon-health-2.5.3.jar:$APP_HOME/lib/helidon-metrics-2.5.3.jar:$APP_HOME/lib/helidon-metrics-service-api-2.5.3.jar:$APP_HOME/lib/helidon-service-common-rest-2.5.3.jar:$APP_HOME/lib/helidon-webserver-cors-2.5.3.jar:$APP_HOME/lib/helidon-webserver-2.5.3.jar:$APP_HOME/lib/helidon-tracing-jersey-2.5.3.jar:$APP_HOME/lib/helidon-tracing-jersey-client-2.5.3.jar:$APP_HOME/lib/helidon-webclient-jaxrs-2.5.3.jar:$APP_HOME/lib/helidon-jersey-common-2.5.3.jar:$APP_HOME/lib/helidon-jersey-server-2.5.3.jar:$APP_HOME/lib/helidon-microprofile-rest-client-2.5.3.jar:$APP_HOME/lib/helidon-jersey-client-2.5.3.jar:$APP_HOME/lib/helidon-jersey-media-jsonp-2.5.3.jar:$APP_HOME/lib/helidon-webclient-security-2.5.3.jar:$APP_HOME/lib/helidon-webclient-tracing-2.5.3.jar:$APP_HOME/lib/helidon-webclient-2.5.3.jar:$APP_HOME/lib/helidon-fault-tolerance-2.5.3.jar:$APP_HOME/lib/helidon-media-jsonp-2.5.3.jar:$APP_HOME/lib/helidon-media-common-2.5.3.jar:$APP_HOME/lib/helidon-security-integration-webserver-2.5.3.jar:$APP_HOME/lib/helidon-security-integration-common-2.5.3.jar:$APP_HOME/lib/helidon-security-annotations-2.5.3.jar:$APP_HOME/lib/helidon-security-providers-header-2.5.3.jar:$APP_HOME/lib/helidon-security-providers-http-auth-2.5.3.jar:$APP_HOME/lib/helidon-security-providers-http-sign-2.5.3.jar:$APP_HOME/lib/helidon-security-providers-jwt-2.5.3.jar:$APP_HOME/lib/helidon-security-providers-common-2.5.3.jar:$APP_HOME/lib/helidon-security-2.5.3.jar:$APP_HOME/lib/helidon-tracing-config-2.5.3.jar:$APP_HOME/lib/helidon-security-jwt-2.5.3.jar:$APP_HOME/lib/helidon-security-util-2.5.3.jar:$APP_HOME/lib/helidon-config-encryption-2.5.3.jar:$APP_HOME/lib/helidon-common-key-util-2.5.3.jar:$APP_HOME/lib/helidon-common-configurable-2.5.3.jar:$APP_HOME/lib/helidon-config-mp-2.5.3.jar:$APP_HOME/lib/helidon-config-object-mapping-2.5.3.jar:$APP_HOME/lib/helidon-metrics-api-2.5.3.jar:$APP_HOME/lib/helidon-tracing-tracer-resolver-2.5.3.jar:$APP_HOME/lib/helidon-tracing-2.5.3.jar:$APP_HOME/lib/helidon-config-2.5.3.jar:$APP_HOME/lib/helidon-config-metadata-2.5.3.jar:$APP_HOME/lib/weld-se-core-2.5.3.jar:$APP_HOME/lib/helidon-health-common-2.5.3.jar:$APP_HOME/lib/helidon-common-http-2.5.3.jar:$APP_HOME/lib/helidon-common-context-2.5.3.jar:$APP_HOME/lib/helidon-logging-common-2.5.3.jar:$APP_HOME/lib/helidon-common-media-type-2.5.3.jar:$APP_HOME/lib/helidon-common-reactive-2.5.3.jar:$APP_HOME/lib/helidon-common-mapper-2.5.3.jar:$APP_HOME/lib/helidon-common-service-loader-2.5.3.jar:$APP_HOME/lib/helidon-common-crypto-2.5.3.jar:$APP_HOME/lib/helidon-common-2.5.3.jar:$APP_HOME/lib/ojdbc8-21.3.0.0.jar:$APP_HOME/lib/jersey-mp-rest-client-2.35.jar:$APP_HOME/lib/jersey-weld2-se-2.35.jar:$APP_HOME/lib/jersey-server-2.35.jar:$APP_HOME/lib/jersey-client-2.35.jar:$APP_HOME/lib/jersey-hk2-2.35.jar:$APP_HOME/lib/jersey-media-json-processing-2.35.jar:$APP_HOME/lib/jersey-common-2.35.jar:$APP_HOME/lib/jersey-entity-filtering-2.35.jar:$APP_HOME/lib/jersey-cdi1x-2.35.jar:$APP_HOME/lib/jersey-media-sse-2.35.jar:$APP_HOME/lib/jackson-dataformat-cbor-2.13.4.jar:$APP_HOME/lib/jackson-dataformat-smile-2.13.4.jar:$APP_HOME/lib/opentracing-util-0.33.0.jar:$APP_HOME/lib/opentracing-noop-0.33.0.jar:$APP_HOME/lib/opentracing-tracerresolver-0.1.8.jar:$APP_HOME/lib/opentracing-api-0.33.0.jar:$APP_HOME/lib/jakarta.xml.bind-api-2.3.3.jar:$APP_HOME/lib/jakarta.ws.rs-api-2.1.6.jar:$APP_HOME/lib/weld-spi-3.1.SP2.jar:$APP_HOME/lib/weld-api-3.1.SP2.jar:$APP_HOME/lib/jakarta.enterprise.cdi-api-2.0.2.jar:$APP_HOME/lib/jakarta.el-api-3.0.3.jar:$APP_HOME/lib/jakarta.interceptor-api-1.2.5.jar:$APP_HOME/lib/jakarta.annotation-api-1.3.5.jar:$APP_HOME/lib/jakarta.inject-api-1.0.jar:$APP_HOME/lib/yasson-1.0.11.jar:$APP_HOME/lib/jakarta.json.bind-api-1.0.2.jar:$APP_HOME/lib/jakarta.activation-api-1.2.2.jar:$APP_HOME/lib/jakarta.json-1.1.6.jar:$APP_HOME/lib/jakarta.json-1.1.6-module.jar:$APP_HOME/lib/netty-codec-http2-4.1.86.Final.jar:$APP_HOME/lib/netty-handler-proxy-4.1.86.Final.jar:$APP_HOME/lib/netty-codec-http-4.1.86.Final.jar:$APP_HOME/lib/netty-resolver-dns-4.1.86.Final.jar:$APP_HOME/lib/netty-handler-4.1.86.Final.jar:$APP_HOME/lib/netty-transport-native-unix-common-4.1.86.Final.jar:$APP_HOME/lib/netty-codec-socks-4.1.86.Final.jar:$APP_HOME/lib/netty-codec-dns-4.1.86.Final.jar:$APP_HOME/lib/netty-codec-4.1.86.Final.jar:$APP_HOME/lib/netty-transport-4.1.86.Final.jar:$APP_HOME/lib/netty-buffer-4.1.86.Final.jar:$APP_HOME/lib/config-1.4.2.jar:$APP_HOME/lib/perfmark-api-0.25.0.jar:$APP_HOME/lib/simpleclient_httpserver-0.9.0.jar:$APP_HOME/lib/simpleclient_common-0.9.0.jar:$APP_HOME/lib/simpleclient-0.9.0.jar:$APP_HOME/lib/microprofile-config-api-1.4.jar:$APP_HOME/lib/microprofile-health-api-2.2.jar:$APP_HOME/lib/microprofile-jwt-auth-api-1.1.1.jar:$APP_HOME/lib/microprofile-fault-tolerance-api-2.1.1.jar:$APP_HOME/lib/microprofile-opentracing-api-1.3.3.jar:$APP_HOME/lib/microprofile-rest-client-api-2.0.jar:$APP_HOME/lib/microprofile-metrics-api-2.3.2.jar:$APP_HOME/lib/log4j-core-2.19.0.jar:$APP_HOME/lib/log4j-api-2.19.0.jar:$APP_HOME/lib/jakarta.validation-api-2.0.2.jar:$APP_HOME/lib/postgresql-42.4.3.jar:$APP_HOME/lib/weld-environment-common-3.1.6.Final.jar:$APP_HOME/lib/jboss-classfilewriter-1.2.5.Final.jar:$APP_HOME/lib/jboss-logging-3.4.1.Final.jar:$APP_HOME/lib/rxjava-3.0.10.jar:$APP_HOME/lib/reactive-streams-1.0.3.jar:$APP_HOME/lib/netty-resolver-4.1.86.Final.jar:$APP_HOME/lib/netty-common-4.1.86.Final.jar:$APP_HOME/lib/error_prone_annotations-2.15.0.jar:$APP_HOME/lib/commons-logging-1.2.jar:$APP_HOME/lib/logging-interceptor-3.14.9.jar:$APP_HOME/lib/okhttp-3.14.9.jar:$APP_HOME/lib/okio-1.17.5.jar:$APP_HOME/lib/mssql-jdbc-9.4.1.jre8.jar:$APP_HOME/lib/spotbugs-annotations-3.1.12.jar:$APP_HOME/lib/jsr305-3.0.2.jar:$APP_HOME/lib/javax.json.bind-api-1.0.jar:$APP_HOME/lib/javax.json-api-1.1.4.jar:$APP_HOME/lib/validation-api-1.1.0.Final.jar:$APP_HOME/lib/picocli-4.1.0.jar:$APP_HOME/lib/mongodb-driver-sync-4.6.1.jar:$APP_HOME/lib/commons-cli-1.2.jar:$APP_HOME/lib/jandex-3.0.5.jar:$APP_HOME/lib/javax.annotation-api-1.3.2.jar:$APP_HOME/lib/failureaccess-1.0.1.jar:$APP_HOME/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar:$APP_HOME/lib/checker-qual-3.25.0.jar:$APP_HOME/lib/j2objc-annotations-1.3.jar:$APP_HOME/lib/conscrypt-openjdk-uber-2.5.2.jar:$APP_HOME/lib/re2j-1.6.jar:$APP_HOME/lib/threetenbp-1.6.2.jar:$APP_HOME/lib/annotations-4.1.1.4.jar:$APP_HOME/lib/animal-sniffer-annotations-1.22.jar:$APP_HOME/lib/httpcore-4.4.15.jar:$APP_HOME/lib/google-api-services-storage-v1-rev20220705-2.0.0.jar:$APP_HOME/lib/joda-time-2.10.10.jar:$APP_HOME/lib/org.apache.servicemix.bundles.javax-inject-1_2.jar:$APP_HOME/lib/jcip-annotations-1.0-1.jar:$APP_HOME/lib/mongodb-driver-core-4.6.1.jar:$APP_HOME/lib/bson-record-codec-4.6.1.jar:$APP_HOME/lib/bson-4.6.1.jar:$APP_HOME/lib/mapper-extras-client-7.17.6.jar:$APP_HOME/lib/parent-join-client-7.17.6.jar:$APP_HOME/lib/aggs-matrix-stats-client-7.17.6.jar:$APP_HOME/lib/rank-eval-client-7.17.6.jar:$APP_HOME/lib/lang-mustache-client-7.17.6.jar:$APP_HOME/lib/zstd-jni-1.4.9-1.jar:$APP_HOME/lib/elasticsearch-lz4-7.17.6.jar:$APP_HOME/lib/lz4-java-1.8.0.jar:$APP_HOME/lib/snappy-java-1.1.8.1.jar:$APP_HOME/lib/hk2-locator-2.6.1.jar:$APP_HOME/lib/javassist-3.25.0-GA.jar:$APP_HOME/lib/jsonp-jaxrs-1.1.6.jar:$APP_HOME/lib/commons-io-2.8.0.jar:$APP_HOME/lib/bcpkix-jdk15on-1.67.jar:$APP_HOME/lib/commons-collections4-4.4.jar:$APP_HOME/lib/scala-library-2.12.15.jar:$APP_HOME/lib/paranamer-2.8.jar:$APP_HOME/lib/annotations-3.0.0.jar:$APP_HOME/lib/jakarta.inject-2.6.1.jar:$APP_HOME/lib/osgi-resource-locator-1.0.3.jar:$APP_HOME/lib/native-protocol-1.5.1.jar:$APP_HOME/lib/java-driver-shaded-guava-25.1-jre-graal-sub-1.jar:$APP_HOME/lib/jnr-posix-3.1.15.jar:$APP_HOME/lib/HdrHistogram-2.1.12.jar:$APP_HOME/lib/elasticsearch-cli-7.17.6.jar:$APP_HOME/lib/elasticsearch-core-7.17.6.jar:$APP_HOME/lib/elasticsearch-secure-sm-7.17.6.jar:$APP_HOME/lib/elasticsearch-geo-7.17.6.jar:$APP_HOME/lib/lucene-core-8.11.1.jar:$APP_HOME/lib/lucene-analyzers-common-8.11.1.jar:$APP_HOME/lib/lucene-backward-codecs-8.11.1.jar:$APP_HOME/lib/lucene-grouping-8.11.1.jar:$APP_HOME/lib/lucene-highlighter-8.11.1.jar:$APP_HOME/lib/lucene-join-8.11.1.jar:$APP_HOME/lib/lucene-memory-8.11.1.jar:$APP_HOME/lib/lucene-misc-8.11.1.jar:$APP_HOME/lib/lucene-queries-8.11.1.jar:$APP_HOME/lib/lucene-queryparser-8.11.1.jar:$APP_HOME/lib/lucene-sandbox-8.11.1.jar:$APP_HOME/lib/lucene-spatial3d-8.11.1.jar:$APP_HOME/lib/lucene-suggest-8.11.1.jar:$APP_HOME/lib/hppc-0.8.1.jar:$APP_HOME/lib/t-digest-3.2.jar:$APP_HOME/lib/jna-5.10.0.jar:$APP_HOME/lib/elasticsearch-plugin-classloader-7.17.6.jar:$APP_HOME/lib/httpasyncclient-4.1.4.jar:$APP_HOME/lib/httpcore-nio-4.4.12.jar:$APP_HOME/lib/compiler-0.9.6.jar:$APP_HOME/lib/bcprov-jdk15on-1.67.jar:$APP_HOME/lib/google-extensions-0.7.4.jar:$APP_HOME/lib/flogger-0.7.4.jar:$APP_HOME/lib/checker-compat-qual-2.5.3.jar:$APP_HOME/lib/flogger-system-backend-0.7.4.jar:$APP_HOME/lib/datastore-v1-proto-client-2.11.5.jar:$APP_HOME/lib/disruptor-3.4.2.jar:$APP_HOME/lib/jakarta.mail-1.6.5.jar:$APP_HOME/lib/jakarta.activation-1.2.1.jar:$APP_HOME/lib/hk2-api-2.6.1.jar:$APP_HOME/lib/aopalliance-repackaged-2.6.1.jar:$APP_HOME/lib/hk2-utils-2.6.1.jar:$APP_HOME/lib/swagger-annotations-1.6.2.jar:$APP_HOME/lib/joda-convert-2.2.1.jar:$APP_HOME/lib/weld-core-impl-2.5.3.jar:$APP_HOME/lib/jnr-ffi-2.2.11.jar:$APP_HOME/lib/jnr-constants-0.10.3.jar:$APP_HOME/lib/jopt-simple-5.0.2.jar:$APP_HOME/lib/jffi-1.3.9.jar:$APP_HOME/lib/jffi-1.3.9-native.jar:$APP_HOME/lib/asm-commons-9.2.jar:$APP_HOME/lib/asm-util-9.2.jar:$APP_HOME/lib/asm-analysis-9.2.jar:$APP_HOME/lib/asm-tree-9.2.jar:$APP_HOME/lib/asm-9.2.jar:$APP_HOME/lib/jnr-a64asm-1.0.0.jar:$APP_HOME/lib/jnr-x86asm-1.0.2.jar

Looks like we are importing it from Helidon, so maybe I need to update Helidon?

So, I updated Helidon from 2.3.2 to 2.6.0, but that did not help.

Updating to Helidon 3.0.0 caused more problems, but that makes sense.

(No horse in this race; just for the convenience of current and future readers I parsed that long CLASSPATH setting and determined that the SmallRye OpenAPI version in use is 2.0.26. Additionally, contrary to other version numbers mentioned in this discussion thread, the Helidon-related version numbers in that CLASSPATH setting appear to be 2.5.3. (And Helidon 2.5.3 does indeed use SmallRye OpenAPI version 2.0.26.)

From looking at SmallRye OpenAPI version 2.0.26's TypeResolver, it seems that line 717 cannot compile/run with Jandex 3.0.5: https://github.com/smallrye/smallrye-open-api/blob/2.0.26/core/src/main/java/io/smallrye/openapi/runtime/scanner/dataobject/TypeResolver.java#L717 (The type of an individual method parameter resulting from method.parameters() in Jandex 3.0.5 is not a Type as is expected on line 717 but a MethodParameterInfo (reference: https://javadoc.io/doc/io.smallrye/jandex/latest/org/jboss/jandex/MethodInfo.html#parameters()). Perhaps an earlier version of Jandex was used by SmallRye OpenAPI version 2.0.26 where this assignment was legal? Indeed, the SmallRye parent pom shows this: https://github.com/smallrye/smallrye-parent/blob/26/pom.xml#L31.

And indeed, MethodInfo#parameters() in Jandex version 2.2.3.Final returns a List<Type>, not a List<MethodParameterInfo> (https://github.com/smallrye/jandex/blob/2.2.3.Final/src/main/java/org/jboss/jandex/MethodInfo.java#L181-L189).

I'm not a gradle user, so I'm not sure how to ask this in gradle-friendly terms: Can you post the dependency tree for your application? I'm looking for the equivalent of the output from mvn dependency:tree.

My guess is that your dependencies might be pulling in more than one release of jandex, leading to the class cast exception.

We build and test each Helidon release with specific compatible releases of (among many others) SmallRye OpenAPI and Jandex. The Helidon + SmallRye OpenAPI part of this is expecting Jandex 2.1.1.Final; I'm not sure what other releases it might be able to tolerate but that's what we build and support 2.3.2 with.

dpendencies.txt

Warning, this file is over 3600 lines...

I hope this helps.

I don't know why or how but your dependencies pull in Jandex version 2.3.1 (by way of Helidon 2.6.0) and then, later, deliberately and directly, it seems, for reasons unrelated to SmallRye OpenAPI or Helidon, 3.0.5:

|    +--- io.helidon.microprofile.openapi:helidon-microprofile-openapi:2.6.0
|    |    +--- org.eclipse.microprofile.config:microprofile-config-api:1.4
|    |    +--- io.helidon.microprofile.server:helidon-microprofile-server:2.6.0 (*)
|    |    \--- io.helidon.openapi:helidon-openapi:2.6.0
|    |         +--- io.helidon.webserver:helidon-webserver:2.6.0 (*)
|    |         +--- io.smallrye:smallrye-open-api-core:2.0.26
|    |         |    +--- org.eclipse.microprofile.openapi:microprofile-openapi-api:1.1.3-RC1 -> 1.2
|    |         |    +--- org.eclipse.microprofile.config:microprofile-config-api:1.4
|    |         |    +--- com.fasterxml.jackson.core:jackson-core:2.12.2 -> 2.13.4 (*)
|    |         |    +--- com.fasterxml.jackson.core:jackson-databind:2.12.2 -> 2.13.4.2 (*)
|    |         |    +--- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.12.2 -> 2.13.4
|    |         |    |    +--- com.fasterxml.jackson.core:jackson-databind:2.13.4 -> 2.13.4.2 (*)
|    |         |    |    +--- org.yaml:snakeyaml:1.31 -> 2.0
|    |         |    |    +--- com.fasterxml.jackson.core:jackson-core:2.13.4 (*)
|    |         |    |    \--- com.fasterxml.jackson:jackson-bom:2.13.4 (*)
|    |         |    +--- org.jboss:jandex:2.2.3.Final -> 2.3.1.Final

[snip]

jandex
\--- io.smallrye:jandex:3.0.5

Why that is is entirely due to your project, not Jandex itself or Helidon or SmallRye OpenAPI. Good luck!

🤔

The way I read that, Helidon is pulling in org.jboss:jandex:2.2.3

Am I reading that correctly. There is nothing in my entire GitLab repo that refers to jandex:2.2.3 explicitly.

(We are currently abusing the Jandex issue system. This issue has nothing to do with Jandex (or Helidon, or SmallRye's OpenAPI project. One last comment here and then I suggest the Jandex maintainers close this issue as "not a bug" and you move your questions to a better/more appropriate venue (perhaps StackOverflow? perhaps a Gradle help forum?).)

Helidon 2.6.0 version-manages Jandex to 2.3.1.Final: https://github.com/helidon-io/helidon/blob/2.6.0/dependencies/pom.xml#L76

The graph I quoted above from your own dependencies output indicates that, left to its own devices, SmallRye's OpenAPI project version 2.0.26 would pull in Jandex version 2.2.3.Final. But it is not left to its own devices: it, in turn, is pulled in by Helidon 2.6.0, which, as just mentioned, manages Jandex's version to be 2.3.1.Final. That's what this line says:

|    |         |    +--- org.jboss:jandex:2.2.3.Final -> 2.3.1.Final

Then, later, for reasons that I cannot guess at, your own project deliberately depends on Jandex 3.0.5 (i.e. it's not pulled in by anything):

jandex
\--- io.smallrye:jandex:3.0.5

(Note the indentation level of jandex: it's "up at the top".)

Part of what makes this harder than perhaps it should be is the fact that when Jandex went to version 3.x, it changed Maven coordinates but not package names, so as far as Gradle or Maven is concerned, these are two completely independent artifacts with nothing to do with each other.

Anyway, your explicit inclusion of Jandex 3.0.5 with components that cannot use it is the source of your problem: you have overruled all the components to say: "I know better: use Jandex 3.0.5, even though it is not compatible with anything in this dependency tree that uses Jandex." It's not Helidon's problem, or Jandex's, or SmallRye OpenAPI's problem. It's a decision that is made in your project's build.gradle (I presume). Good luck!

Sorry for the spam here, but I really do appreciate your help, as you have helped me understand things much better than before.

This exception

class org.jboss.jandex.MethodParameterInfo cannot be cast to class org.jboss.jandex.Type

is a very direct (to me; less so to others I assume) sign that something was compiled against Jandex 2.x but is running against Jandex 3.x. There are some breaking changes in Jandex 3, a lot of which I was able to paper over using synthetic bridge methods, but this one couldn't be hidden like this.

As @ljnelson correctly points out (thanks!), you use a platform that requires Jandex 2, but you explicitly add dependencies on Jandex 3. That won't work. If you use Jandex yourself, you need to stick to whatever version your platform provides. When it comes to the kordamp Jandex Gradle plugin, you can use the latest 0.x version, which is based on Jandex 2.

For the record, and for everyone's convenience, I've started publishing extensive release notes since Jandex 3.0.0 over at the SmallRye blog. Here's the one for 3.0.0: https://smallrye.io/blog/jandex-3-0-0/