Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

problem configuring cCxf component

Hello,
I have build a route with a cCxf endpoint that points to a soap webservice of a remote system.
The route works well if sending a request with header accept-encoding=txt/xml. If the cCxf component reaches a request with accept-encoding=gzip,deflate it failes with the following error
- java.io.CharConversionException: Invalid UTF-8 start byte 0x8b (at char #2, byte #-1)

To solve this, I have created an endpoint in the spring defininition. My Question is -> How to get this configuration into the cCxf Component?
<bean id="gzipFeature" class="org.apache.cxf.transport.common.gzip.GZIPFeature">
<property name="threshold">
<value>1</value>
</property>
</bean>

<cxf:cxfEndpoint id="serviceEndpoint"
address="http://localhost:8080"
wsdlURL="soap.wsdl"
endpointName="s:Port"
serviceClass="com.serviceclass
serviceName="s:Service"
xmlns:s="http://namespace/">
<cxf:properties>
<entry key="dataFormat" value="PAYLOAD"/>
</cxf:properties>
<cxf:features>
<ref bean="gzipFeature"></ref>
</cxf:features>
</cxf:cxfEndpoint>
Labels (5)
4 Replies
Anonymous
Not applicable
Author

Please create a change request in Jira ( https://jira.talendforge.org/) to allow custom features configuration on endpoint
Anonymous
Not applicable
Author

ATM you can try fillowing way:

1. Extend Route's spring config with

<beans ...
xmlns:util="http://www.springframework.org/schema/util"

xsi:schemaLocation="...
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"


<util:list id="features" value-type="org.apache.cxf.feature.Feature">
<bean class="org.apache.cxf.transport.common.gzip.GZIPFeature">
<property name="threshold">
<value>1</value>
</property>
</bean>
</util:list>

And add to cCXF Advanced Configuration 
key "features"
value "#features"
Anonymous
Not applicable
Author

Hi,
I have apply this solution in the studio and it's ok : but now I want to deploy on the runtime my route but there is an error :
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'features': Cannot create inner bean 'org.apache.cxf.transport.common.gzip.GZIPFeature#14cec704' of type [org.apache.cxf.transport.common.gzip.GZIPFeature] while setting bean property 'sourceList' with key [0]; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.apache.cxf.transport.common.gzip.GZIPFeature] for bean with name 'org.apache.cxf.transport.common.gzip.GZIPFeature#14cec704' defined in URL [bundleentry://320.fwk1345422073/META-INF/spring/poc_4_routes_soap_fault.xml]; nested exception is java.lang.ClassNotFoundException: org.apache.cxf.transport.common.gzip.GZIPFeature not found from bundle [france-visas-bus.POC_4_routes_soap_fault]
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:287)[223:org.apache.servicemix.bundles.spring-beans:3.2.14.RELEASE_1]
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:122)[223:org.apache.servicemix.bundles.spring-beans:3.2.14.RELEASE_1]
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:358)[223:org.apache.servicemix.bundles.spring-beans:3.2.14.RELEASE_1]
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:157)[223:org.apache.servicemix.bundles.spring-beans:3.2.14.RELEASE_1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1419)[223:org.apache.servicemix.bundles.spring-beans:3.2.14.RELEASE_1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1160)[223:org.apache.servicemix.bundles.spring-beans:3.2.14.RELEASE_1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)[223:org.apache.servicemix.bundles.spring-beans:3.2.14.RELEASE_1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)[223:org.apache.servicemix.bundles.spring-beans:3.2.14.RELEASE_1]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)[223:org.apache.servicemix.bundles.spring-beans:3.2.14.RELEASE_1]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)[223:org.apache.servicemix.bundles.spring-beans:3.2.14.RELEASE_1]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)[223:org.apache.servicemix.bundles.spring-beans:3.2.14.RELEASE_1]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191)[223:org.apache.servicemix.bundles.spring-beans:3.2.14.RELEASE_1]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:618)[223:org.apache.servicemix.bundles.spring-beans:3.2.14.RELEASE_1]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:934)[224:org.apache.servicemix.bundles.spring-context:3.2.14.RELEASE_1]
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)[235:org.springframework.osgi.core:1.2.1]
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)[235:org.springframework.osgi.core:1.2.1]
at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)[235:org.springframework.osgi.core:1.2.1]
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)[235:org.springframework.osgi.core:1.2.1]
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)[236:org.springframework.osgi.extender:1.2.1]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_111]
Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.apache.cxf.transport.common.gzip.GZIPFeature] for bean with name 'org.apache.cxf.transport.common.gzip.GZIPFeature#14cec704' defined in URL [bundleentry://320.fwk1345422073/META-INF/spring/poc_4_routes_soap_fault.xml]; nested exception is java.lang.ClassNotFoundException: org.apache.cxf.transport.common.gzip.GZIPFeature not found from bundle [france-visas-bus.POC_4_routes_soap_fault]
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1278)[223:org.apache.servicemix.bundles.spring-beans:3.2.14.RELEASE_1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:435)[223:org.apache.servicemix.bundles.spring-beans:3.2.14.RELEASE_1]
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:276)[223:org.apache.servicemix.bundles.spring-beans:3.2.14.RELEASE_1]
... 19 more
Caused by: java.lang.ClassNotFoundException: org.apache.cxf.transport.common.gzip.GZIPFeature not found from bundle [france-visas-bus.POC_4_routes_soap_fault]
at org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:103)[235:org.springframework.osgi.core:1.2.1]
at org.springframework.osgi.util.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:156)[235:org.springframework.osgi.core:1.2.1]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[:1.8.0_111]
at org.springframework.util.ClassUtils.forName(ClassUtils.java:265)[226:org.apache.servicemix.bundles.spring-core:3.2.14.RELEASE_1]
at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:419)[223:org.apache.servicemix.bundles.spring-beans:3.2.14.RELEASE_1]
at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1299)[223:org.apache.servicemix.bundles.spring-beans:3.2.14.RELEASE_1]
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1270)[223:org.apache.servicemix.bundles.spring-beans:3.2.14.RELEASE_1]
... 21 more
Caused by: java.lang.ClassNotFoundException: org.apache.cxf.transport.common.gzip.GZIPFeature cannot be found by france-visas-bus.POC_4_routes_soap_fault_0.1.0.SNAPSHOT
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:432)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:345)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:337)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[:1.8.0_111]
at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:568)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
at org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:99)[235:org.springframework.osgi.core:1.2.1]
... 27 more

So how can I configure my runtime to use this configuration ?

Thanks for help.
Anonymous
Not applicable
Author

Append org.apache.cxf.transport.common.gzip package to the Import-Packages manifest section