You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Wang Yan <wy...@gmail.com> on 2019/02/18 15:35:31 UTC
httpj:engine-factory setting in JAVADSL way
My CXF Endpoint Provider need to using https.
I found setting like below should work, but i did not found how to do it in
JAVADSL
because my route is JAVADSL
Any hints are more than welcome!
<httpj:engine port="${https}">
<httpj:tlsServerParameters>
<sec:keyManagers keyPassword="${keyStorePass}">
<sec:keyStore type="JKS" password="${keyStorePass}"
file="${keyStorePath}"/>
</sec:keyManagers>
</httpj:tlsServerParameters>
</httpj:engine>
</httpj:engine-factory>
Fwd: httpj:engine-factory setting in JAVADSL way
Posted by Wang Yan <wy...@gmail.com>.
-I found one soultion , sslconfig.xml is the xml defined httpj-enginge stuff
* @ImportResource( value= { "classpath:config/sslconfig.xml",
* "classpath:META-INF/cxf/cxf.xml"})
i followd the example below
did something like cxfProducerEndpoint.setSslContextParameters(
producerSslContextParameters);
but i when i want to dynamically load those xml files , it does not work,
it looks the GenericApplicationContext does not know ApplicationContext and
CamelContext.
therefore bean loaded in GenericApplicationContext could not be used
/accessed by camelcontext
Any idea how to dynamically load those xml defination files?
@PostConstruct
public void init() throws Exception {
if (isSoapProviderSSL) {
PathMatchingResourcePatternResolver pmrl = new
PathMatchingResourcePatternResolver(
context.getClassLoader());
List<Resource> resources = new ArrayList<Resource>();
resources.add(pmrl.getResource("classpath:config/sslconfig.xml"));
resources.add(pmrl.getResource("classpath:META-INF/cxf/cxf.xml"));
GenericApplicationContext createdContext = new
GenericApplicationContext(context);
resources.forEach(r -> {
XmlBeanDefinitionReader reader = new
XmlBeanDefinitionReader(createdContext);
int beanCount = reader.loadBeanDefinitions(r);
LOG.info("Bean loaded number {} ", beanCount);
createdContext.refresh();
});
}
}
https://www.programcreek.com/java-api-examples/?code=wildfly-extras/wildfly-camel-examples/wildfly-camel-examples-master/camel-cxf-jaxws-cdi-secure/src/main/java/org/wildfly/camel/examples/cxf/jaxws/Application.java
but got problme like Caused by: java.io.IOException: Protocol mismatch for
port 9009: engine's protocol is http, the url protocol is https
at
org.apache.cxf.transport.http_jetty.JettyHTTPServerEngineFactory.createJettyHTTPServerEngine(JettyHTTPServerEngineFactory.java:277)
~[cxf-rt-transports
at
org.apache.cxf.transport.http_jetty.JettyHTTPServerEngineFactory.createJettyHTTPServerEngine(JettyHTTPServerEngineFactory.java:307)
~[cxf-rt-transports
at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.retrieveEngine(JettyHTTPDestination.java:134)
~[cxf-rt-transports-http-jetty-3.2.7.jar!/:3.2.7
at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.finalizeConfig(JettyHTTPDestination.java:166)
~[cxf-rt-transports-http-jetty-3.2.7.jar!/:3.2.7
---------- Forwarded message ---------
From: Wang Yan <[hidden email]
<http:///user/SendEmail.jtp?type=node&node=5830489&i=0>>
Date: Mon, Feb 18, 2019 at 4:35 PM
Subject: httpj:engine-factory setting in JAVADSL way
To: <[hidden email] <http:///user/SendEmail.jtp?type=node&node=5830489&i=1>>
My CXF Endpoint Provider need to using https.
I found setting like below should work, but i did not found how to do it in
JAVADSL
because my route is JAVADSL
Any hints are more than welcome!
<httpj:engine port="${https}">
<httpj:tlsServerParameters>
<sec:keyManagers keyPassword="${keyStorePass}">
<sec:keyStore type="JKS" password="${keyStorePass}"
file="${keyStorePath}"/>
</sec:keyManagers>
</httpj:tlsServerParameters>
</httpj:engine>
</httpj:engine-factory>
------------------------------
If you reply to this email, your message will be added to the discussion
below:
http://camel.465427.n5.nabble.com/httpj-engine-factory-setting-in-JAVADSL-way-tp5830438p5830489.html
To unsubscribe from httpj:engine-factory setting in JAVADSL way, click here
<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5830438&code=d3lhbmJveEBnbWFpbC5jb218NTgzMDQzOHwxMTU1MzAzODM=>
.
NAML
<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
Fwd: httpj:engine-factory setting in JAVADSL way
Posted by Wang Yan <wy...@gmail.com>.
i followd the example below
did something like cxfProducerEndpoint.setSslContextParameters(
producerSslContextParameters);
https://www.programcreek.com/java-api-examples/?code=wildfly-extras/wildfly-camel-examples/wildfly-camel-examples-master/camel-cxf-jaxws-cdi-secure/src/main/java/org/wildfly/camel/examples/cxf/jaxws/Application.java
but got problme like Caused by: java.io.IOException: Protocol mismatch for
port 9009: engine's protocol is http, the url protocol is https
at
org.apache.cxf.transport.http_jetty.JettyHTTPServerEngineFactory.createJettyHTTPServerEngine(JettyHTTPServerEngineFactory.java:277)
~[cxf-rt-transports
at
org.apache.cxf.transport.http_jetty.JettyHTTPServerEngineFactory.createJettyHTTPServerEngine(JettyHTTPServerEngineFactory.java:307)
~[cxf-rt-transports
at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.retrieveEngine(JettyHTTPDestination.java:134)
~[cxf-rt-transports-http-jetty-3.2.7.jar!/:3.2.7
at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.finalizeConfig(JettyHTTPDestination.java:166)
~[cxf-rt-transports-http-jetty-3.2.7.jar!/:3.2.7
---------- Forwarded message ---------
From: Wang Yan <wy...@gmail.com>
Date: Mon, Feb 18, 2019 at 4:35 PM
Subject: httpj:engine-factory setting in JAVADSL way
To: <us...@camel.apache.org>
My CXF Endpoint Provider need to using https.
I found setting like below should work, but i did not found how to do it in
JAVADSL
because my route is JAVADSL
Any hints are more than welcome!
<httpj:engine port="${https}">
<httpj:tlsServerParameters>
<sec:keyManagers keyPassword="${keyStorePass}">
<sec:keyStore type="JKS" password="${keyStorePass}"
file="${keyStorePath}"/>
</sec:keyManagers>
</httpj:tlsServerParameters>
</httpj:engine>
</httpj:engine-factory>