Hi David,
You don't have to use Resty-GWT. I misunderstood your setup. I thought
you were trying to reach CXF from the GWT client side.
Unfortunately I don't know why it doesn't work from GWT server side. It
should work... Maybe check dependencies - GWT jars bundle some
dependencies inline...
Vassilis
On 10/16/2014 01:28 PM, David Roldan Puig wrote:
Hello Vassilis.
Yes I know it, My client is in the server side of GWT (2.6.1)
I have a service that is called in a Async way and the code is inside it,
just in the server part of the project
The error is generated when the thread executes the line: Response
response = resource.getDomains();
But is it necessary to import resty-gwt jar to the project?
Is it necessary to define<inherits name="org.fusesource.restygwt.RestyGWT"/>
in my gwt.xml?
thanks
*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
2014-10-16 12:05 GMT+02:00 Vassilis Virvilis <[email protected]>:
Hi David,
I am not 100% sure but looks like that you try to use cxf jax-rs client in
GWT client side. I am afraid this is not possible. GWT is a java to
javascript compiler and only certain - blessed/specially crafted GWT
specific jars are allowed client side.
I have used Resty-GWT http://resty-gwt.github.io/ as a client for CXF
services with great success.
Vassilis
On 10/16/2014 12:59 PM, David Roldan Puig 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
--
__________________________________
Vassilis Virvilis Ph.D.
Head of IT
Biovista Inc.
US Offices
2421 Ivy Road
Charlottesville, VA 22903
USA
T: +1.434.971.1141
F: +1.434.971.1144
European Offices
34 Rodopoleos Street
Ellinikon, Athens 16777
GREECE
T: +30.210.9629848
F: +30.210.9647606
www.biovista.com
Biovista is a privately held biotechnology company that finds novel uses
for existing drugs, and profiles their side effects using their mechanism
of action. Biovista develops its own pipeline of drugs in CNS, oncology,
auto-immune and rare diseases. Biovista is collaborating with
biopharmaceutical companies on indication expansion and de-risking of their
portfolios and with the FDA on adverse event prediction.
--
__________________________________
Vassilis Virvilis Ph.D.
Head of IT
Biovista Inc.
US Offices
2421 Ivy Road
Charlottesville, VA 22903
USA
T: +1.434.971.1141
F: +1.434.971.1144
European Offices
34 Rodopoleos Street
Ellinikon, Athens 16777
GREECE
T: +30.210.9629848
F: +30.210.9647606
www.biovista.com
Biovista is a privately held biotechnology company that finds novel uses
for existing drugs, and profiles their side effects using their
mechanism of action. Biovista develops its own pipeline of drugs in CNS,
oncology, auto-immune and rare diseases. Biovista is collaborating with
biopharmaceutical companies on indication expansion and de-risking of
their portfolios and with the FDA on adverse event prediction.