[camel] branch camel-2.25.x updated: CAMEL-14788: Jetty server OSGi problem workaround. Requires Jetty 9.4.25 or better to not have OSGi problem but Jetty is API incompatible in their 9.4.xx patches.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[camel] branch camel-2.25.x updated: CAMEL-14788: Jetty server OSGi problem workaround. Requires Jetty 9.4.25 or better to not have OSGi problem but Jetty is API incompatible in their 9.4.xx patches.

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

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


The following commit(s) were added to refs/heads/camel-2.25.x by this push:
     new 6ca0601  CAMEL-14788: Jetty server OSGi problem workaround. Requires Jetty 9.4.25 or better to not have OSGi problem but Jetty is API incompatible in their 9.4.xx patches.
6ca0601 is described below

commit 6ca0601827a5585af5228c344241a476092a9101
Author: Claus Ibsen <[hidden email]>
AuthorDate: Wed Mar 25 19:45:46 2020 +0100

    CAMEL-14788: Jetty server OSGi problem workaround. Requires Jetty 9.4.25 or better to not have OSGi problem but Jetty is API incompatible in their 9.4.xx patches.
---
 .../org/apache/camel/component/jetty/JettyHttpComponent.java     | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java b/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java
index 4e738f2..9b5932e 100644
--- a/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java
+++ b/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java
@@ -1367,8 +1367,13 @@ public abstract class JettyHttpComponent extends HttpCommonComponent implements
         camelServlet.setServletResolveConsumerStrategy(new HttpRestServletResolveConsumerStrategy());
         
         //must make RFC7578 as default to avoid using the deprecated MultiPartInputStreamParser
-        connector.getConnectionFactory(HttpConnectionFactory.class).getHttpConfiguration()
-             .setMultiPartFormDataCompliance(MultiPartFormDataCompliance.RFC7578);
+        try {
+            connector.getConnectionFactory(HttpConnectionFactory.class).getHttpConfiguration()
+                    .setMultiPartFormDataCompliance(MultiPartFormDataCompliance.RFC7578);
+        } catch (Throwable e) {
+            // ignore this due to OSGi problems
+            LOG.debug("Cannot set MultiPartFormDataCompliance to RFC7578 due to " + e.getMessage() + ". This exception is ignored.", e);
+        }
 
         return camelServlet;
     }