Claus Ibsen created CAMEL-26220:
-----------------------------------
Summary: camel-ibm-watson-discovery - query always fails with
NoClassDefFoundError for Gson $Gson$Types (gson version in camel-parent vs IBM
sdk-core)
Key: CAMEL-26220
URL: https://issues.apache.org/jira/browse/CAMEL-26220
Project: Camel
Issue Type: Bug
Components: camel-ai
Reporter: Claus Ibsen
Fix For: 4.24.0
Found while adding the catalog body types of ibm-watson-discovery (CAMEL-24961,
PR #28402).
h4. 1. query always fails with NoClassDefFoundError
com/google/gson/internal/$Gson$Types
This is a dependency alignment issue. camel-parent manages {{gson}} at 2.14.0
({{parent/pom.xml}}, main 2a465aa4814c, line 224), and the IBM Watson SDK
16.2.0 brings {{com.ibm.cloud:sdk-core}} 9.20.0, whose
{{DynamicModelTypeAdapterFactory}} still uses the Gson internal class
{{$Gson$Types}}, renamed to {{GsonTypes}} in newer Gson. Parsing the query
response therefore fails in {{WatsonDiscoveryProducer.query}} (line 89) with
{{InvalidServiceResponseException}} caused by {{NoClassDefFoundError:
com/google/gson/internal/$Gson$Types}}, even for {{\{"matching_results":0\}}}.
Other operations whose response models use dynamic properties (and
camel-ibm-watsonx-data, which uses sdk-core 9.18.4) may fail the same way.
Checked on 4.24.0-SNAPSHOT with a JDK HttpServer stub as the Discovery service.
Proposed: align the versions: manage {{com.ibm.cloud:sdk-core}} at 9.24.3 or
later (these use {{GsonTypes}}) in the camel-ibm modules, or upgrade the IBM
SDKs to versions built on it, and add a test that parses a query response.
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)