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

jbonofre pushed a commit to branch camel-karaf-4.18.x
in repository https://gitbox.apache.org/repos/asf/camel-karaf.git


The following commit(s) were added to refs/heads/camel-karaf-4.18.x by this 
push:
     new c1cb55aeb fix(#755): remove http-whiteboard from the camel-cxf feature 
(backport of #757) (#762)
c1cb55aeb is described below

commit c1cb55aeb9ca2f11b02bfdcbb244d2a331447fdf
Author: JB Onofré <[email protected]>
AuthorDate: Tue Dec 1 14:48:00 2026 +0000

    fix(#755): remove http-whiteboard from the camel-cxf feature (backport of 
#757) (#762)
    
    camel-cxf unconditionally installed http-whiteboard, and so a running
    Pax Web/Jetty instance, that producers and consumers using another HTTP
    transport don't need.
    
    Add a test checking that the Pax Web whiteboard extender is not installed
    by camel-cxf, make the CXF servlet registration log accurate and document
    the change.
---
 .../component/cxf/transport/http/osgi/ServletExporter.java |  4 +++-
 docs/modules/ROOT/pages/index.adoc                         | 14 ++++++++++++++
 features/src/main/feature/camel-features.xml               |  1 -
 .../java/org/apache/karaf/camel/itest/CamelCxfITest.java   |  7 +++++++
 4 files changed, 24 insertions(+), 2 deletions(-)

diff --git 
a/components/camel-cxf/camel-cxf-all/src/main/java/org/apache/camel/component/cxf/transport/http/osgi/ServletExporter.java
 
b/components/camel-cxf/camel-cxf-all/src/main/java/org/apache/camel/component/cxf/transport/http/osgi/ServletExporter.java
index dd4cbbb12..11316fbee 100644
--- 
a/components/camel-cxf/camel-cxf-all/src/main/java/org/apache/camel/component/cxf/transport/http/osgi/ServletExporter.java
+++ 
b/components/camel-cxf/camel-cxf-all/src/main/java/org/apache/camel/component/cxf/transport/http/osgi/ServletExporter.java
@@ -99,7 +99,9 @@ class ServletExporter implements ManagedService {
                 getProp(properties, CXF_SERVLET_PREFIX + 
"use-x-forwarded-headers", "false"));
 
         try {
-            LOG.log(Level.INFO, "Registering CXF servlet on " + context + " 
via Servlet Whiteboard");
+            LOG.log(Level.INFO, "Registering CXF servlet on " + context
+                    + " as a Servlet Whiteboard service, it is only served if 
a Servlet Whiteboard implementation"
+                    + " supporting jakarta.servlet is installed");
             servletServiceRegistration = 
bundleContext.registerService(Servlet.class, servlet, whiteboardProps);
         } catch (Exception e) {
             LOG.log(Level.WARNING, "Error registering CXF OSGi servlet " + 
e.getMessage(), e);
diff --git a/docs/modules/ROOT/pages/index.adoc 
b/docs/modules/ROOT/pages/index.adoc
index 9453275be..cbfdfa7cf 100644
--- a/docs/modules/ROOT/pages/index.adoc
+++ b/docs/modules/ROOT/pages/index.adoc
@@ -49,6 +49,20 @@ And so on, for example if you use the sql, and http 
components:
 karaf@root> feature:install camel-sql camel-http
 ----
 
+[NOTE]
+====
+The `camel-cxf` feature no longer installs `http-whiteboard`. If other bundles
+relied on it to get the OSGi HTTP service, install `http-whiteboard` 
explicitly:
+
+[source,sh]
+----
+karaf@root> feature:install http-whiteboard
+----
+
+CXF consumers need an HTTP transport, for example the one provided by the
+`camel-cxf-jetty` feature.
+====
+
 == Camel Karaf commands
 
 When you install the camel feature, new Camel Karaf commands become available
diff --git a/features/src/main/feature/camel-features.xml 
b/features/src/main/feature/camel-features.xml
index 94efb629b..5e947fe7c 100644
--- a/features/src/main/feature/camel-features.xml
+++ b/features/src/main/feature/camel-features.xml
@@ -1018,7 +1018,6 @@
         <feature version='${camel-osgi-version-range}'>camel-spring</feature>
         <feature 
version="${camel-osgi-jakarta-annotation2-version}">jakarta-annotation</feature>
         <feature version="[6,7)">jakarta-servlet</feature>
-        <feature>http-whiteboard</feature>
         <feature version="[3,4)">jakarta-validation</feature>
         <feature 
version="${camel-osgi-saaj-version}">jakarta-soap-implementation</feature>
         <bundle 
dependency="true">mvn:org.glassfish.hk2/osgi-resource-locator/${osgi-resource-locator-version}</bundle>
diff --git 
a/tests/features/camel-cxf/src/test/java/org/apache/karaf/camel/itest/CamelCxfITest.java
 
b/tests/features/camel-cxf/src/test/java/org/apache/karaf/camel/itest/CamelCxfITest.java
index 049a8af34..4cfb704ec 100644
--- 
a/tests/features/camel-cxf/src/test/java/org/apache/karaf/camel/itest/CamelCxfITest.java
+++ 
b/tests/features/camel-cxf/src/test/java/org/apache/karaf/camel/itest/CamelCxfITest.java
@@ -44,6 +44,7 @@ import org.ops4j.pax.exam.spi.reactors.PerClass;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.ops4j.pax.exam.OptionUtils.combine;
 
@@ -84,6 +85,12 @@ public class CamelCxfITest extends 
AbstractCamelSingleFeatureRouteITest {
         testGetCustomerOnlyHeadersInBlueprint();
     }
 
+    @Test
+    public void testHttpWhiteboardNotInstalled() {
+        assertNull("The camel-cxf feature must not install the Pax Web 
whiteboard extender",
+                
findBundleByName("org.ops4j.pax.web.pax-web-extender-whiteboard"));
+    }
+
     private String getPortPathRs() {
         return ExternalResourceProviders.getCxfRsPort() + 
"/CamelCxfRsRouteSupplier/rest";
     }

Reply via email to