1
votes

cannot figure out what is going on with this - trying to set up a route to just see cxf connect to a soap web service (I don't care about the actual data and don't expect the data to actually 'work', but it keeps throwing an exception I don't understand:

I wonder if I'm configuring it correctly. I was thinking it might be a missing jar, but strated causing dependency conflicts when I tried to bring in other Jars

I'm using a maven dependency "camel-cxf" to load in all my jar configuration

"Reason: org.apache.cxf.bus.extension.ExtensionException: Could not load extension class org.apache.cxf.ws.policy.AssertionBuilderRegistryImpl."

The exact error is

"Failed to create Producer for endpoint: Endpoint[cxf://http://wsf.cdyne.com/WeatherWS/Weather.asmx?dataFormat=MESSAGE&portName=WeatherSoap&serviceClass=prototypes.CxfExample%24GetWeatherInformationSoapIn&serviceName=Weather&wsdlURL=http%3A%2F%2Fwsf.cdyne.com%2FWeatherWS%2FWeather.asmx%3FWSDL]. Reason: org.apache.cxf.bus.extension.ExtensionException: Could not load extension class org.apache.cxf.ws.policy.AssertionBuilderRegistryImpl."

The code I'm using to cause this is

        camel.addComponent( "cxf", new CxfComponent() );

        camel.addRoutes( new RouteBuilder() {

            @Override
            public void configure() throws Exception {
                from( "timer://sometimer?delay=1s")
                .to( "cxf://http://wsf.cdyne.com/WeatherWS/Weather.asmx"
                     +"?wsdlURL=http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL"
                     +"&dataFormat=MESSAGE"
                     +"&serviceClass=prototypes.CxfExample$GetWeatherInformationSoapIn"
                     +"&serviceName=Weather"
                     +"&portName=WeatherSoap"


                   );
            }
        });
        camel.start();
        Thread.sleep( 10000 );
        camel.stop();
1

1 Answers

3
votes

I think I have 'solved' it -

mvn:camel-cfx dependency is not enough

you need mvn:neethi dependency too

the AssertationBuildImpl class extends from a class that is not included in the jar-set for mvn:camel-cfx, which makes AssertationBuildImpl appear listed as a known class in the ide, but doesn't get class-loaded at runtime

this was a horrendous problem to track down, by analysing source-code of third-parties