I'm creating an Apache CXF JAX-RS client and adding an inInterceptor
MyProxy proxy = JAXRSClientFactory.create("http://path.to.url", MyProxy.class);
ClientConfiguration config = WebClient.getConfig(service);
config.getInInterceptors().add(new RemoveAlertsInterceptor());
How can I set a parameter inside the RemoveAlertsInterceptor, which I can read from the proxy?
Related
I'm trying to use CXF 3.5.5 API for creating a WebClient to be able to invoke the CXF REST API.
When I create a WebClient, in CXF 3.5.5 , it gives the following exception.
While WebClient.create method is invoked in cxf 3.5.5, the ClassLoader throws Exception:
Caused by: java.lang.IncompatibleClassChangeError: org.apache.cxf.common.util.ASMHelper
This was working with CXF 3.3.7 version.
Any help is highly appreciated.
I'm trying to invoke the CXF REST API using CXF Client API WebClient.
List<Object> providers = new ArrayList<Object>();
providers.add(new com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider());
WebClient client = WebClient.create(serviceURL, providers);
client.encoding("UTF-8");
client.type(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON);
While WebClient.create method is invoked in cxf 3.5.5, the ClassLoader throws Exception:
Caused by: java.lang.IncompatibleClassChangeError: org.apache.cxf.common.util.ASMHelper
I am trying to turn off chunking for my java web application. We use apache cxf and are hitting a soap service.
I changed the conduit setting in the config file
<http-conf:conduit
name="*.http-conduit">
<http-conf:client
ConnectionTimeout="2000"
ReceiveTimeout="60000"
MaxRetransmits="2"
ChunkingThreshold="700000"
AllowChunking="false"/>
</http-conf:conduit>
Set it manually
HTTPConduit http = (HTTPConduit)client.getConduit();
HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
httpClientPolicy.setConnectionTimeout(2000);
httpClientPolicy.setReceiveTimeout(60000);
httpClientPolicy.setMaxRetransmits(2);
httpClientPolicy.setAllowChunking(false);
http.setClient(httpClientPolicy);
None of them work and any request above 4k I see transfer-encoding: chunked
Another side question: Is there a different setting for HTTPS and HTTP in cxf?
I am try to use CXF 2.7.11 and Spring to develop Restfull web service. get this Cannot create a secure XMLInputFactory when try to implement JAX-RS Security
Caused By:
java.lang.RuntimeException: Cannot create a secure XMLInputFactory
at org.apache.cxf.staxutils.StaxUtils.createXMLInputFactory(StaxUtils.java:314)
at org.apache.cxf.staxutils.StaxUtils.getXMLInputFactory(StaxUtils.java:264)
at org.apache.cxf.staxutils.StaxUtils.createXMLStreamReader(StaxUtils.java:1549)
at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:1122)
at
org.apache.cxf.transport.http_jetty.spring.JettySpringTypesFactory.createTLSServerParametersMap(JettyS
pringTypesFactory.java:101)
WEB-INF/lib floder contain the following jar
asm-3.3.1.jar
commons-codec-1.9.jar
commons-collections-3.2.1.jar
commons-lang-2.6.jar
commons-logging-1.1.1.jar
commons-logging-1.1.jar
cxf-2.7.11.jar
cxf-bundle-jaxrs-2.7.11.jar
cxf-manifest.jar
geronimo-activation_1.1_spec-1.1.jar
geronimo-javamail_1.4_spec-1.7.1.jar
geronimo-jaxws_2.2_spec-1.1.jar
geronimo-stax-api_1.0_spec-1.0.1.jar
geronimo-ws-metadata_2.0_spec-1.1.3.jar
javax.ws.rs-api-2.0-m10.jar
jaxb-api-2.2.5.jar
jaxb-impl-2.2.5.1.jar
jetty-server-8.1.14.v20131031.jar
jetty-util-8.1.14.v20131031.jar
neethi-3.0.3.jar
ojdbc6.jar
spring-aop-3.2.6.RELEASE.jar
spring-beans-3.2.6.RELEASE.jar
spring-context-3.2.6.RELEASE.jar
spring-core-3.2.6.RELEASE.jar
spring-expression-3.2.6.RELEASE.jar
spring-jdbc-3.2.6.RELEASE.jar
spring-jms-3.2.6.RELEASE.jar
spring-tx-3.2.6.RELEASE.jar
spring-web-3.2.6.RELEASE.jar
stax2-api-3.1.4.jar
woodstox-core-asl-4.2.1.jar
wsdl4j-1.6.3.jar
I have Apache2 SSL which is fronting Spring webapp as follows:
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
All works fine... i mean all links ... are correct, and in general webapp works, so the problem is not a matter of an application or SSL..
Except starting/cancelling webflows: they produce http URLs instead of https://
I found one topic here:
forum.springsource.org/showthread.php?70730-Webflow-2-0-and-reverse-proxy
They say it is not a problem of Spring WebFlow...
What is a workaround in this situation?
Providing that all requests to the Tomcat connector are received via SSL terminated at httpd then you can add the following to your connector:
scheme="https" secure="true"
This tells Tomcat to treat the connection as if it was received over an SSL connection direct to Tomcat. This is required when proxying over http since there is no mechanism within http to pass the SSL info to Tomcat. There are ways to pass some of this info via http headers. Look at the SSLValve docs in Tomcat.
Alternatively, using AJP will work since AJP passes SSL information from httpd to Tomcat.
We are using Apache CXF 2.5.2 for webservice client proxies. We use weblogic 10.3.4. To override the CXF logger we use the following option:
-Dorg.apache.cxf.Logger=org.apache.cxf.common.logging.Slf4jLogger
For the org.apache.cxf.common.logging.Slf4jLogger, we've included the cxf-common-utilities-2.5.2 in our build.
When we try to deploy to weblogic we get the following exception:
[ERROR] Target state: deploy failed on Server AdminServer
[ERROR] java.lang.NoClassDefFoundError: weblogic/wsee/jaxws/spi/WLSProvider
According to documentation, your WebService client should have wseeclient.jar as it's runtime dependency. If the problems is still there, then include wlfullclient.jar (see Creating a wlfullclient.jar for JDK 1.6 client applications ).