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

camel-cxf namespace parser has hard dependency on jaxrs client

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • 2.17.0
    • None
    • camel-cxf
    • None
    • Unknown

    Description

      I am trying to declare an endpoint like this in my spring context:

          <cxf:cxfEndpoint  
               xmlns:cxf="http://camel.apache.org/schema/cxf"
               id="myEndpoint" address="${myUrl}"/>
      

      I want to use it in a route like this: .to("cxf:bean:myEndpoint?dataFormat=PAYLOAD")

      I am not using rs, but the cxf NamespaceHandler has a dependency CxfRsClientFactoryBeanDefinitionParser which again has a dependency on org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean so I get a java.lang.NoClassDefFoundError.

      I found a workaround - not using the cxf namespace and declaring a bean of class org.apache.camel.component.cxf.CxfSpringEndpoint.
      But the error was a bit hard to diagnose.

      Could the NamespaceHandler lazy-load the xxxBeanDefinitionParser instances so that the class CxfRsClientFactoryBeanDefinitionParser doesn't get loaded if I don't have a cxf:rsClient tag?

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            niels@harremoes.dk Niels Ull Harremoes
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: