Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-18563

camel-karaf - ClassNotDefFoundError when an exception thrown from a cxfrs route

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • 3.18.2
    • 3.18.3, 3.20.0
    • came-cxf, camel-karaf
    • None
    • Unknown

    Description

      When a route started from a cxf:rsServer service throws an exception, an additional exception from Camel is thrown:

      2022-09-27T20:37:53,371 | WARN  | qtp1368588965-512 | HttpChannel                      | 184 - org.eclipse.jetty.util - 9.4.48.v20
      220622 | /cxf/abc/xxx
      java.lang.NoClassDefFoundError: org/apache/camel/component/cxf/util/CxfUtils
              at org.apache.camel.component.cxf.jaxrs.CxfRsConsumer.lambda$createServer$0(CxfRsConsumer.java:65) ~[?:?]
              at org.apache.cxf.phase.PhaseInterceptorChain.wrapExceptionAsFault(PhaseInterceptorChain.java:373) ~[?:?]

      [...]

      {{Caused by: java.lang.ClassNotFoundException: org.apache.camel.component.cxf.util.CxfUtils not found by org.apache.camel.camel-cxf-rest [90]
              ... 46 more}}

       

      CxfUtils is used by CxfRsConsumer.java on line 65, but in pom.xml the package is explicitly excluded from imports.

       

      I have put a demo code on https://github.com/jacekszymanski/cxfrstest

      to reproduce behavior load into camel-karaf, start and access /cxf/abc/anything with POST.

      As a workaround I removed exclusion and added explicit import instead, this sort of fixed it.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jsz Jacek Szymański
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: