Error after updating camel-cxf to 2.15.2. Cast class exception

After upgrading to apache camel-cxf to 2.15.2 and cxf 3.0.4, I have the following problem when running my camel routes.

The route integrates soap with a payment gateway.

Has any body found a workaround for this?

See below for the stack trace.

Thrown: javax.ejb.EJBException: org.apache.camel.FailedToCreateProducerException: Failed to create Producer for endpoint: Endpoint [cxf: // https://staging.payu.co.za/service/PayUAPI?dataFormat=PAYLOAD&portN =% 7Bhttp% 3A% 2F% 2Fsoap.api.controller.web.payjar.com% 2F% 7DEnterpriseAPISoapPort & serviceName =% 7Bhttp% 3A% 2F% 2Fsoap.api.controller.web.payjar.com% 3FISLUR = 7DEsapter % 2F% 2Fstaging.payu.co.za% 2Fservice% 2FPayUAPI% 3Fwsdl]... Reason: org.apache.camel.RuntimeCamelException: java.lang.ClassCastException: Unable to execute org.apache.cxf.wsdl11.WSDLManagerImpl to org.apache.cxf.wsdl.WSDLManager .wsdl.WSDLManager at org.jboss.x.jborcept handleExceptionInOurTx (CMTTxInterceptor.java:187) at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx (CMTTxInterceptor.java:277) at org.jboss.as.ejb3.tInquter.CMTavaTorx at org.jboss.as.ejb3.tx.LifecycleCMTTxInterceptor.processInvocation (LifecycleCMTTxInterceptor.java:66) at org.jboss.invocation.InterceptorContext.proceed (InterceptorContext.java:340) at org. .processInvocation (WeldInjectionContextInterceptor.java:43) at org.jboss.invocation.InterceptorContext.proceed (InterceptorContext.java:340) at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation (CurrentInvocationContextInterceptor.java:41) at org.jboss.invocation.InterceptorContext.proceed (InterceptorContext.java:340) at org.jboceptorrent.as.ee.contextorxtocation at org.jboss.invocation.InterceptorContext.proceed (InterceptorContext.java:340) at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation (ContextClassLoaderInterceptor.java:64) at org.jboss.invocation.ContextClassLoaderInterceptor.java:64) at org.jboss.invocation ) at org.jboss.invocation.InterceptorContext.run (InterceptorContext.java:356) at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation (Privileged.WithCombinerInterceptor.javajava:80) at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation (Privileged.WithCombinerInterceptor.java:80) at org.jboss.invocation340) in org.jboss.invocation.ChainedInterceptor.processInvocation (ChainedInterceptor.java:61) in org.jboss.as.ee.component.BasicComponent.constructComponentInstance (BasicComponent.java:161) ... 11 more

Caused by: org.apache.camel.FailedToCreateProducerException: Failed to create Producer for endpoint:

      

Endpoint [cxf: // https://staging.payu.co.za/service/PayUAPI?dataFormat=PAYLOAD&portName=%7Bhttp%3A%2F%2Fsoap.api.controller.web.payjar.com%2F%7DEnterpriseAPISoNvice % 7Bhttp% 3A% 2F% 2Fsoap.api.controller.web.payjar.com% 2F% 7DEnterpriseAPISoapService & wsdlURL = https% 3A% 2F% 2Fstaging.payu.co.za% 2Fservice% 2FPayUAPI% 3Fwsd], Reason: org.apache.camel.RuntimeCamelException: java.lang.ClassCastException: Unable to execute org.apache.cxf.wsdl11.WSDLManagerImpl to org.apache.cxf.wsdl.WSDLManager at org.apache.Gameetl.CacheCache (ProducerCache.java:407) at org.apache.camel.impl.ProducerCache.acquireProducer (ProducerCache.java:123) at org.apache.camel.processor.SendProcessor.doStart (SendProcessor.java:219) at org.apache. camel.support.ServiceSupport.start (ServiceSupport.java:61) at org.apache.camel.util.ServiceHelper.startService (ServiceHelper.java:74) at org.apache.camel.util.ServiceHelper.startService (ServiceHelper.java:61) 59) at org.apache.camel.util.ServiceHelper.startServices (ServiceHelper.java:103) at org.apache.camel.util.ServiceHelper.startServices (ServiceHelper.java:89) at org.apache.camel.processor.DelegateAsynccamel.processorProcess ...doStart (DelegateAsyncProcessor.java:79) at org.apache.camel.support.ServiceSupport.start (ServiceSupport.java:61) at org.apache.camel.util.ServiceHelper.startService (ServiceHelper.java:74) at org.apache .camel.util.ServiceHelper.startService (ServiceHelper.java:59) at org.apache.camel.util.ServiceHelper.startServices (ServiceHelper.java:103) at org.apache.camel.util.ServiceHelper.startServices (ServiceHelava. : 89) at org.apache.camel.processor.RedeliveryErrorHandler.doStart (RedeliveryErrorHandler.java:1272) at org.apache.camel.support.ChildServiceSupport.start (ChildServiceSupport.java:44.cache ChildServiceSupport.start (ChildServiceSupport.java:31) at org.apache.camel.util.ServiceHelper.startService (ServiceHelper.java:74) at org.apache.camel.util.ServiceHelper.startService (ServiceHelper.java:59) .apache.camel.util.ServiceHelper.startServices (ServiceHelper.java:103) at org.apache.camel.util.ServiceHelper.startServices (ServiceHelper.java:89) at org.apache.camel.processor.interceptor.DefaultChannel.doStart (DefaultChannel 155) at org.apache.camel.support.ServiceSupport.start (ServiceSupport.java:61) at org.apache.camel.util.ServiceHelper.startService (ServiceHelper.java:74) at org.apache.camel.util.ServiceHelper .startService (ServiceHelper.java:59) at org.apache.camel.util.ServiceHelper.startServices (ServiceHelper.java:103) at org.apache.camel.util.ServiceHelper.startService (ServiceHelper.java:61) at org. apache.camel.util.ServiceHelper.startServices (ServiceHelper.java:103) at org.apache.camel.util.ServiceHelper.startServices (ServiceHelper.java:89) at org.apache.camel.processor.MulticastProcessor.doStart (. java: 1122) to org.apache.camel.support.ServiceSupport.start (ServiceSupport.java:61) at org.apache.camel.util.ServiceHelper.startService (ServiceHelper.java:74) at org.apache.camel.util.ServiceHelper.stelartService (ServiceHelper. java: 59) at org.apache.camel.util.ServiceHelper.startServices (ServiceHelper.java:103) at org.apache.camel.util.ServiceHelper.startServices (ServiceHelper.java:89) at org.apache.camel.processor .DelegateAsyncProcessor.doStart (DelegateAsyncProcessor.java:79) at org.apache.camel.support.ServiceSupport.start (ServiceSupport.java:61) at org.apache.camel.util.ServiceHelper.startService (ServiceHavaper74) at org.apache.camel.impl.RouteService.startChildService (RouteService.java:340) at org.apache.camel.impl.RouteService.warmUp (RouteService.java:182) at org.aparmConache.camel.impl.DefaultChild DefaultCamelContext.java:3090) at org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices (DefaultCamelContext.java:3020) at org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes (DefaultCamelConimaptext.java:Cefault.CamelConimaptext.java: .doStartCamel (DefaultCamelContext.java:2653) at org.apache.camel.impl.DefaultCamelContext.access $ 000 (DefaultCamelContext.java:167) at org.apache.camel.impl.DefaultCamelContext $ 2.call (Default.CamelContext) org.apache.camel.impl.DefaultCamelContext $ 2.call (DefaultCamelContext.java:2463) in org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader (DefaultCamelContext.java:2486) in org.apache.plart (DefaultCamelContext.java:2463) at org.apache.camel.support.ServiceSupport.start (ServiceSupport.java:61) at org.apache.camel.impl.DefaultCamelContext.start (DefaultCamelContext.java:2432) at com.unijunction.ordercloud.common.bootstrap.CamelInstantiator.init (CamelInstantiator.java:58) at sun.reflect.NativeMethodAccessorImpl.invoke0 (native method) in sun.unijunction.ordercloud.com invoke (NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:606) at org.jboent.as.ee.compon .ManagedReferenceLifecycleMethodInterceptor.processInvocation (ManagedReferenceLifecycleMethodInterceptor.java:96) at org.jboss.invocation.InterceptorContext.proceed (InterceptorContext.java:340) at org.jboss.bas.jeld.eception org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation (Jsr299BindingsInterceptor.java:103) at org.jboss.invocation.InterceptorContext.proceed (InterceptorContext.java:340) at org.jboss.invocation.InterceptorContext $ Invocation.procext .ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke (AbstractEJBRequestScopeActivationInterceptor.java:73) in org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation (EjbRequestScopeActivationInterceptor.java:83) in org.jboss.invocation.InterceptorContext.proceed (InterceptorContext.java:340 ) at org.jboss.as.weld.injection.WeldInjectionInterceptor.processInvocation (WeldInjectionInterceptor.java:53) at org.jboss.invocation.InterceptorContext.proceed (InterceptorContext.java:340) at org.jboss.as.ee.ManagedReferenceFieldInjectionInterceptorFactory $ ManagedReferenceFieldInjectionInterceptor.processInvocation (ManagedReferenceFieldInjectionInterceptorFactory.java:107) in org.jboss.invocation.InterceptorContext.proceed (InterceptorContext.java:340) in org.jboss.as.ee.component.AroundConstructInterceptorFactory $ 1.processInvocation (AroundConstructInterceptorFactory.java:28 ) in org.jboss.invocation.InterceptorContext.proceed (InterceptorContext.java:340) in org.jboss.as.weld.injection.WeldInterceptorInjectionInterceptor.processInvocation (WeldInterceptorInjectionInterceptor.javaboss InterceptorContext.java:340) at org.jboss.as.weld.ejb.Jsr299BindingsCreateInterceptor.processInvocation (Jsr299BindingsCreateInterceptor.java:100) at org.jboss.invocation.InterceptorContext.proceceptjava: 340) at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation (NamespaceContextInterceptor.java:50) at org.jboss.invocation.InterceptorContext.proceed (InterceptorContext.java:340) at org.jboss340 .tx.CMTTxInterceptor.invokeInOurTx (CMTTxInterceptor.java:275) ... 27 more

Caused by: org.apache.camel.RuntimeCamelException: java.lang.ClassCastException: Cannot cast

      

org.apache.cxf.wsdl11.WSDLManagerImpl to org.apache.cxf.wsdl.WSDLManager at org.apache.camel.component.cxf.WSDLServiceFactoryBean.getDefinition (WSDLServiceJaapBean. .WSDLServiceFactoryBean.buildServiceFromWSDL (WSDLServiceFactoryBean.java:101) at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.initializeServiceModel (ReflectionBean.Fan (ReflectionServiceFactoryBean.java:261) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create (JaxWsServiceFactoryBean.java:215) at org.apache.cxf.frontend.AbstractWsDec. apache.cxf.frontend.ClientFactoryBean.create (ClientFactoryBean.java:91) in org.apache.camel.component.cxf.CxfEndpoint.createClient (CxfEndpoint.java:634) at org.apache.camel.component.cxf.CxfProducer.doStart (CxfProducer.java:76) at org.apache.camel.support.ServiceSupport.start java: 61) in org.apache.camel.impl.DefaultCamelContext.startService (DefaultCamelContext.java:2869) in org.apache.camel.impl.DefaultCamelContext.doAddService (DefaultCamelContext.java:10imc.c .DefaultCamelContext.addService (DefaultCamelContext.java:1058) at org.apache.camel.impl.ProducerCache.doGetProducer (ProducerCache.java:405) ... 104 more2869) at org.apache.camel.impl.DefaultCamelContext.doAddService (DefaultCamelContext.java:1097) at org.apache.camel.impl.DefaultCamelContext.addService (DefaultCamelContext.java:1058) at org.apache. .doGetProducer (ProducerCache.java:405) ... 104 more2869) at org.apache.camel.impl.DefaultCamelContext.doAddService (DefaultCamelContext.java:1097) at org.apache.camel.impl.DefaultCamelContext.addService (DefaultCamelContext.java:1058) at org.apache. .doGetProducer (ProducerCache.java:405) ... 104 more

Caused by: java.lang.ClassCastException: Cannot cast org.apache.cxf.wsdl11.WSDLManagerImpl to

      

org.apache.cxf.wsdl.WSDLManager at java.lang.Class.cast (Class.java:3186) at org.apache.cxf.bus.extension.ExtensionManagerImpl.getBeanOfType (ExtensionManagerImpl.java:322) in org.apache. cxf.bus.extension.ExtensionManagerBus.getExtension (ExtensionManagerBus.java:216) at org.apache.camel.component.cxf.WSDLServiceFactoryBean.getDefinition (WSDLServiceFactoryBean.java:64) ... 117 more

+3


source to share


1 answer


Common problems with camel and cfx:

  • Duplicated camel / cfx versions on shaded jar files because I found problems with cxf - 3.0.12 and 3.1.10.
  • Camel TypeConverter issues.

Decision:

  • Maven dependencies, apache cxf version 2.7.18 and camel apache version 2.17.2.


CXF bundle

vein camel

camel-cxf

  • Include this in the shaded maven pom,

                <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                    <resource>META-INF/services/org/apache/camel/TypeConverter</resource>
                </transformer>
    
          

+1


source







All Articles