You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Ragavan Thiru <sk...@gmail.com> on 2014/10/01 09:57:20 UTC

Couldn't invoke a service with webclient through local transport in CXF 3.0

Hi,

I tried to access a service through local transport, but when I tried to
access it is giving the following exception[1]. I am exposing the service
as follows,

<jaxrs:server publishedEndpointUrl="local://test">
<jaxrs:providers>
<ref bean="jsonProvider" />
</jaxrs:providers>
<jaxrs:serviceBeans>
<ref bean="testBean" />
</jaxrs:serviceBeans>
</jaxrs:server>

and accessing as,

WebClient client = WebClient.create("local://test",
                Collections.singletonList(new JacksonJsonProvider()));
        path.append('/').append(operation);

        client = client.path(path);

        response = client.get();

I have added the following to the cxf-servlet as well,

 <bean class="org.apache.cxf.transport.local.LocalTransportFactory"
lazy-init="false">
      <property name="transportIds">
          <list>
              <value>http://cxf.apache.org/transports/local</value>
              <value>http://schemas.xmlsoap.org/soap/http</value>
              <value>http://schemas.xmlsoap.org/wsdl/soap/http</value>
          </list>
      </property>
  </bean>

I didn't do any other configurations. What am I missing?

I feel it is a version mismatch but all the cxf jars are of 3.0 and
jaxrs-bundle jar is 2.7.12
[1]
java.lang.AbstractMethodError:
org.apache.cxf.transport.local.LocalTransportFactory.getConduit(Lorg/apache/cxf/service/model/EndpointInfo;)Lorg/apache/cxf/transport/Conduit;
at
org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:103)
at
org.apache.cxf.endpoint.UpfrontConduitSelector.prepare(UpfrontConduitSelector.java:63)
at
org.apache.cxf.jaxrs.client.ClientConfiguration.prepareConduitSelector(ClientConfiguration.java:108)
at
org.apache.cxf.jaxrs.client.AbstractClient.prepareConduitSelector(AbstractClient.java:847)
at
org.apache.cxf.jaxrs.client.AbstractClient.createMessage(AbstractClient.java:946)
at
org.apache.cxf.jaxrs.client.WebClient.finalizeMessage(WebClient.java:1095)
at
org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:1069)
at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:878)
at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:852)
at org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:410)
at org.apache.cxf.jaxrs.client.WebClient.get(WebClient.java:594)
-- 
Regards,
T.Ragavan.

Re: Couldn't invoke a service with webclient through local transport in CXF 3.0

Posted by Daniel Kulp <dk...@apache.org>.
On Oct 1, 2014, at 8:57 AM, Ragavan Thiru <sk...@gmail.com> wrote:

> 
> I didn't do any other configurations. What am I missing?
> 
> I feel it is a version mismatch but all the cxf jars are of 3.0 and
> jaxrs-bundle jar is 2.7.12

That’s exactly the issue.   You need to use all 3.0 jars or all 2.7.12 jars.  

Dan



> [1]
> java.lang.AbstractMethodError:
> org.apache.cxf.transport.local.LocalTransportFactory.getConduit(Lorg/apache/cxf/service/model/EndpointInfo;)Lorg/apache/cxf/transport/Conduit;
> at
> org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:103)
> at
> org.apache.cxf.endpoint.UpfrontConduitSelector.prepare(UpfrontConduitSelector.java:63)
> at
> org.apache.cxf.jaxrs.client.ClientConfiguration.prepareConduitSelector(ClientConfiguration.java:108)
> at
> org.apache.cxf.jaxrs.client.AbstractClient.prepareConduitSelector(AbstractClient.java:847)
> at
> org.apache.cxf.jaxrs.client.AbstractClient.createMessage(AbstractClient.java:946)
> at
> org.apache.cxf.jaxrs.client.WebClient.finalizeMessage(WebClient.java:1095)
> at
> org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:1069)
> at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:878)
> at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:852)
> at org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:410)
> at org.apache.cxf.jaxrs.client.WebClient.get(WebClient.java:594)
> -- 
> Regards,
> T.Ragavan.

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com