davsclaus opened a new pull request, #24544: URL: https://github.com/apache/camel/pull/24544
## Summary _Claude Code on behalf of davsclaus_ - Fix `DelegatingSchemaResolver` failing with `NoClassDefFoundError` when running Kamelets via Camel CLI - The class has hard imports to `AvroSchemaResolver`, `ProtobufSchemaResolver`, `JsonSchemaResolver` from `provided`-scope dependencies that are downloaded into a child classloader at runtime - Add a try/catch fallback: direct `new` is tried first (works on flat classpaths like Spring Boot), and on `NoClassDefFoundError` the resolver is loaded reflectively via `CamelContext.getClassResolver()` which can see dynamically downloaded JARs - Implement `CamelContextAware` to get access to the `ClassResolver` ## Root Cause When `DelegatingSchemaResolver` was moved from `camel-kamelets` into `camel-kamelet` (CAMEL-21249), it ended up on the boot classpath while its `provided` dependencies (`camel-jackson-avro`, `camel-jackson-protobuf`, `camel-jackson`) are dynamically downloaded into a child `DependencyDownloaderClassLoader`. Parent-first delegation means the parent classloader (which loaded `DelegatingSchemaResolver`) cannot see the child's JARs. ## Test plan - [x] Existing `camel-kamelet` tests pass (flat classpath path exercised) - [ ] Manual verification with `camel run` using a Kamelet that declares `camel:jackson-avro` dependency 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.6 <[email protected]> -- 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]
