This is an automated email from the ASF dual-hosted git repository.

zhfeng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git


The following commit(s) were added to refs/heads/main by this push:
     new 2f94ab701f Fix #4710 to register reflection for FastStringBuffer and 
resource bundle for XMLErrorResources (#4720)
2f94ab701f is described below

commit 2f94ab701f26de7acc02c5f9b6f1f5cc8fda36d1
Author: Zheng Feng <[email protected]>
AuthorDate: Thu Mar 30 21:05:47 2023 +0800

    Fix #4710 to register reflection for FastStringBuffer and resource bundle 
for XMLErrorResources (#4720)
---
 .../support/xalan/deployment/XalanNativeImageProcessor.java        | 5 +++--
 .../org/apache/camel/quarkus/component/xml/it/XmlRouteBuilder.java | 7 ++++++-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git 
a/extensions-support/xalan/deployment/src/main/java/org/apache/camel/quarkus/support/xalan/deployment/XalanNativeImageProcessor.java
 
b/extensions-support/xalan/deployment/src/main/java/org/apache/camel/quarkus/support/xalan/deployment/XalanNativeImageProcessor.java
index 5998ffb3cb..638f15a1d0 100644
--- 
a/extensions-support/xalan/deployment/src/main/java/org/apache/camel/quarkus/support/xalan/deployment/XalanNativeImageProcessor.java
+++ 
b/extensions-support/xalan/deployment/src/main/java/org/apache/camel/quarkus/support/xalan/deployment/XalanNativeImageProcessor.java
@@ -53,7 +53,7 @@ class XalanNativeImageProcessor {
                 "org.apache.xml.dtm.ref.DTMManagerDefault",
                 "org.apache.xml.serializer.OutputPropertiesFactory",
                 "org.apache.xml.serializer.CharInfo",
-                "org.apache.xml.serializer.XMLEntities").methods().build();
+                "org.apache.xml.utils.FastStringBuffer").methods().build();
     }
 
     @BuildStep
@@ -61,7 +61,8 @@ class XalanNativeImageProcessor {
         return Arrays.asList(
                 new 
NativeImageResourceBundleBuildItem("org.apache.xalan.xsltc.compiler.util.ErrorMessages"),
                 new 
NativeImageResourceBundleBuildItem("org.apache.xml.serializer.utils.SerializerMessages"),
-                new 
NativeImageResourceBundleBuildItem("org.apache.xml.serializer.XMLEntities"));
+                new 
NativeImageResourceBundleBuildItem("org.apache.xml.serializer.XMLEntities"),
+                new 
NativeImageResourceBundleBuildItem("org.apache.xml.res.XMLErrorResources"));
     }
 
     @BuildStep
diff --git 
a/integration-tests/xml/src/main/java/org/apache/camel/quarkus/component/xml/it/XmlRouteBuilder.java
 
b/integration-tests/xml/src/main/java/org/apache/camel/quarkus/component/xml/it/XmlRouteBuilder.java
index 1383f2172e..4a186f396c 100644
--- 
a/integration-tests/xml/src/main/java/org/apache/camel/quarkus/component/xml/it/XmlRouteBuilder.java
+++ 
b/integration-tests/xml/src/main/java/org/apache/camel/quarkus/component/xml/it/XmlRouteBuilder.java
@@ -22,6 +22,7 @@ import io.quarkus.runtime.annotations.RegisterForReflection;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.xslt.saxon.XsltSaxonAggregationStrategy;
 import org.apache.camel.support.builder.Namespaces;
+import org.apache.xpath.XPathAPI;
 
 // These reflections registrations should be removed with fixing 
https://github.com/apache/camel-quarkus/issues/1615
 @RegisterForReflection(classNames = {
@@ -50,7 +51,11 @@ public class XmlRouteBuilder extends RouteBuilder {
         from(DIRECT_XML_CBR)
                 .choice()
                 .when(xpath("//order/country = 'UK'"))
-                .setBody(constant("Country UK"))
+                .process(exchange -> {
+                    Document body = exchange.getIn().getBody(Document.class);
+                    String country = XPathAPI.eval(body, 
"//order/country").toString();
+                    exchange.getIn().setBody("Country " + country);
+                })
                 .otherwise()
                 .setBody(constant("Invalid country code"));
 

Reply via email to