You aren’t doing something silly like creating some sort of uber-jar or 
combining jars together or similar, are you?   That would certainly cause this. 
 

In your code someplace, try doing something like:

System.out.println(Collections.list(getClass().getClassLoader()
                                            
.getResources("META-INF/cxf/bus-extensions.txt")));


(possibly with the Thread.contextClassloader() instead of the 
getClass().getClassLoader() call)

and make sure it’s printing out a bunch of locations and not one.   More 
importantly, make sure the one in cxf-rt-transports-http is in the list.


Dan



> On Oct 16, 2014, at 5:59 AM, David Roldan Puig <[email protected]> wrote:
> 
> Hello,
> 
> I would like to create an APIRest Client in a WebProject with Google Web
> toolkit (GWT 2.6.1). I am using CXF in order to use my interfaces to get
> the client.
> 
> I use this code to obtain the client in the serviceImplementation class
> inside a package in the server of GWT project:
> 
> 
> 
> DomainsAPI resource = JAXRSClientFactory.create("
> http://localhost:9998/api/v1/";, DomainsAPI.class, providers);
> WebClient.client(resource).header("X-USER",
> userKey).accept(MediaType.APPLICATION_JSON);
> ObjectMapper mapper = new ObjectMapper();
> Response response = resource.getDomains();
> String hp = response.readEntity(String.class);
> Domain[] dd = mapper.readValue(hp, Domain[].class);
> ...
> 
> 
> POM configuration:
> 
>           <dependencies>
> <dependency>
> <groupId>com.google.gwt</groupId>
> <artifactId>gwt-servlet</artifactId>
> <version>2.6.1</version>
> <scope>runtime</scope>
> </dependency>
> <dependency>
> <groupId>com.google.gwt</groupId>
> <artifactId>gwt-user</artifactId>
> <version>2.6.1</version>
> <scope>provided</scope>
> </dependency>
>                 <dependency>
> <groupId>org.apache.cxf</groupId>
> <artifactId>cxf-rt-transports-http</artifactId>
> <version>3.0.1</version>
> </dependency>
> <dependency>
>  <groupId>org.apache.cxf</groupId>
>  <artifactId>cxf-rt-rs-client</artifactId>
>  <version>3.0.1</version>
> </dependency>
> <dependency>
> <groupId>org.codehaus.jackson</groupId>
> <artifactId>jackson-jaxrs</artifactId>
> <version>1.9.13</version>
> </dependency>
>        </dependencies>
> 
> 
> This code is processed but when resource.getDomains() is called, I obtain
> the typical error with GWT and CXF:
> 
> Advertencia: Interceptor for {
> http://clientAPIRest.shared.us2p.uitu.com/}DomainsAPI has thrown exception,
> unwinding now
> org.apache.cxf.interceptor.Fault: No conduit initiator was found for the
> namespace http://cxf.apache.org/transports/http.
> 
> ....
> Caused by: org.apache.cxf.BusException: No conduit initiator was found for
> the namespace http://cxf.apache.org/transports/http.
> at
> org.apache.cxf.bus.managers.ConduitInitiatorManagerImpl.getConduitInitiator(ConduitInitiatorManagerImpl.java:110)
> at
> org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:104)
> ....
> 
> 
> But, if I try this code in a stand alone maven project with its
> dependencies works properly. The sample code is the same as above and the
> dependencies in POM maven are the following:
> 
> <dependencies>
> 
> <dependency>
> 
> <groupId>org.apache.cxf</groupId>
> 
> <artifactId>cxf-rt-transports-http</artifactId>
> 
> <version>3.0.1</version>
> 
> </dependency>
> 
> <dependency>
> 
> <groupId>org.apache.cxf</groupId>
> 
> <artifactId>cxf-rt-rs-client</artifactId>
> 
> <version>3.0.1</version>
> 
> </dependency>
> 
> </dependencies>
> 
> 
> 
> I don't know exactly where is the problem. I saw lots of comments about CXF
> dependencies but no one is the solution I amb looking for.
> The project works without GWT so the problem is in the integration between
> them, I don't know exactly.
> 
> I hope your help.
> Thanks a lot.
> 
> Regards
> 
> *David Roldán*
> 
> *UITU: Ubiquitous Internet Technologies Unit *
> http://fi2.cat/uitudesc
> 
> *i2CAT FOUNDATION*
> Gran Capità 2-4 (Nexus I building)
> 2nd Floor, office 203; 08034 Barcelona
> +34 93 553 26 33

-- 
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to