gnodet opened a new pull request, #30650: URL: https://github.com/apache/camel/pull/30650
## Summary `schemaRegistryVendor=apicurio` with `schemaFormat=json` now fails fast with a clear `IllegalArgumentException` instead of a cryptic `IncompatibleClassChangeError` at runtime. ## Root Cause The Apicurio Registry JSON Schema serde (`io.apicurio:apicurio-registry-jsonschema-serde-kafka` 3.x) depends on `com.networknt:json-schema-validator` **1.5.x**, while Camel modules such as `camel-yaml-dsl` and `camel-json-validator` use `com.networknt:json-schema-validator` **3.x** (upgraded for Jackson 3 in CAMEL-23172). In networknt 3.x, `SchemaLoader` changed from an **interface** to a **class**. The Apicurio serde JARs compiled against 1.5.x implement `SchemaLoader` as an interface; when the JVM loads those classes it finds a class instead, and throws `IncompatibleClassChangeError`. This hits any application that also uses `camel-yaml-dsl`, `camel-json-validator`, `camel-openai`, or `camel-mcp-server`. ## Fix `KafkaSchemaRegistry.vendor()` now rejects `apicurio` + `json` with an `IllegalArgumentException` whose message: - explains the dependency conflict - names both conflicting artifacts and versions - gives the two workarounds: use `schemaFormat=avro` or `schemaFormat=protobuf` with `apicurio`, or use `schemaRegistryVendor=confluent` with `schemaFormat=json` (the Confluent-compatible API of Apicurio Registry works with `confluent`) This follows the established pattern of `azure` + `json`/`protobuf`, which already throws for the same reason (no serde exists). ## Tests - `apicurioWithJsonFailsDueToNetworkntConflict()` — unit test: verifies `createProducerProperties()` and `createConsumerProperties()` throw with the expected message substrings - `producerFailsToStartForAnUnsupportedCombination()` — endpoint-level test extended to cover `apicurio+json` - Parameterized happy-path fixtures (`vendorsAndFormats`, `artifacts`) updated to remove the now-rejected combination - `KafkaSchemaRegistryVendorClassesTest` updated to remove `apicurio+json` (the class-existence check is no longer needed since the combo is rejected before the serde JARs are even consulted) Full suite: **1435 tests, 0 failures, 0 errors**. ## Documentation - Vendor table: `apicurio` now shows `avro, protobuf` only - Apicurio section NOTE updated with full explanation and workarounds - Upgrade guide entry in `camel-4x-upgrade-guide-4_24.adoc` - Catalog copy updated to match Fixes https://issues.apache.org/jira/browse/CAMEL-27175 --- _Hermes Agent (Claude Sonnet 4.6) on behalf of Guillaume Nodet_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
