Apache CXF + JavaFX No conduit initiator was found for the namespace -


i'm triying run javafx rest client using cxf. simple test. when try url org.apache.cxf.busexception: no conduit initiator found namespace http://cxf.apache.org/transports/http. took @ related questions here, no luck. appreciated. maven dependency added cxf-rt-rs-client 3.1.0 code is:

webclient client = webclient.create("http://www.stackoverflow.com"); client.type("text/html").accept("text/html"); system.out.println(client.get());

stacktrace:

caused by: org.apache.cxf.busexception: no conduit initiator found namespace http://cxf.apache.org/transports/http. @ org.apache.cxf.bus.managers.conduitinitiatormanagerimpl.getconduitinitiator(conduitinitiatormanagerimpl.java:110) @ org.apache.cxf.endpoint.abstractconduitselector.getselectedconduit(abstractconduitselector.java:104) @ org.apache.cxf.endpoint.upfrontconduitselector.selectconduit(upfrontconduitselector.java:77) @ org.apache.cxf.message.exchangeimpl.getconduit(exchangeimpl.java:159) @ org.apache.cxf.interceptor.messagesenderinterceptor.getconduit(messagesenderinterceptor.java:71) @ org.apache.cxf.interceptor.messagesenderinterceptor.handlemessage(messagesenderinterceptor.java:46) @ org.apache.cxf.phase.phaseinterceptorchain.dointercept(phaseinterceptorchain.java:307) @ org.apache.cxf.jaxrs.client.abstractclient.doruninterceptorchain(abstractclient.java:624) @ org.apache.cxf.jaxrs.client.webclient.dochainedinvocation(webclient.java:1100) 

the shading overwrites bus-extension.txt file. programmatically can fix initializing it.

void initializecxf() {     final bus defaultbus = busfactory.getdefaultbus();     final conduitinitiatormanager extension = defaultbus.getextension(conduitinitiatormanager.class);     extension.registerconduitinitiator("http://cxf.apache.org/transports/http", new httptransportfactory()); } 

based on comment @hba can try following in case above not work

extension.registerconduitinitiator("http://cxf.apache.org/transports/http", new httptransportfactory(defaultbus)); 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -