This is an automated email from the ASF dual-hosted git repository. jiriondrusek pushed a commit to branch camel-main in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/camel-main by this push: new 1dc7b8a534 Fix of salesforce native failure caused by upgrade of jetty-version - not sure about the fix 1dc7b8a534 is described below commit 1dc7b8a534af147932be1958c7ed32bd074e1a5f Author: Jiri Ondrusek <ondrusek.j...@gmail.com> AuthorDate: Wed May 7 11:23:46 2025 +0200 Fix of salesforce native failure caused by upgrade of jetty-version - not sure about the fix --- extensions/salesforce/runtime/pom.xml | 5 +++ .../graalvm/JettyJSONContextSubstitute.java | 40 ++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/extensions/salesforce/runtime/pom.xml b/extensions/salesforce/runtime/pom.xml index 42e3c34095..4570d1dc57 100644 --- a/extensions/salesforce/runtime/pom.xml +++ b/extensions/salesforce/runtime/pom.xml @@ -67,6 +67,11 @@ <groupId>org.apache.camel</groupId> <artifactId>camel-salesforce</artifactId> </dependency> + <dependency> + <groupId>org.graalvm.sdk</groupId> + <artifactId>nativeimage</artifactId> + <scope>provided</scope> + </dependency> </dependencies> <build> diff --git a/extensions/salesforce/runtime/src/main/java/org/apache/camel/quarkus/component/salesforce/graalvm/JettyJSONContextSubstitute.java b/extensions/salesforce/runtime/src/main/java/org/apache/camel/quarkus/component/salesforce/graalvm/JettyJSONContextSubstitute.java new file mode 100644 index 0000000000..ab96906c6f --- /dev/null +++ b/extensions/salesforce/runtime/src/main/java/org/apache/camel/quarkus/component/salesforce/graalvm/JettyJSONContextSubstitute.java @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.component.salesforce.graalvm; + +import java.text.ParseException; +import java.util.List; + +import com.oracle.svm.core.annotate.Substitute; +import com.oracle.svm.core.annotate.TargetClass; +import org.cometd.common.JettyJSONContext; +import org.eclipse.jetty.util.ajax.JSON; + +@TargetClass(JettyJSONContext.class) +final class JettyJSONContextSubstitute { + + @Substitute + public List parse(String json) throws ParseException { + try { + Object o = new JSON.StringSource(json); + //method adapt is private, therefore it can not be used + return List.of(o); + } catch (Exception x) { + throw (ParseException) new ParseException(json, -1).initCause(x); + } + } +}