resteasy

How are you supposed to access EJB when using Easyrest?

I have been trying to get Resteasy to work (and not it dose). However I now have another headache with accessing the EJB:s. I have tried injecting them, looking them up with jndi and most other solutions but none of them works. I get massages like: java.lang.RuntimeException: Class is not a root resource. Or: java.lang.IllegalArgumentE...

Using an EJB inside a JAX-RS resource class in RestEasy?

I would like to have the following kind of resource class work when deployed under RestEasy in JBoss 6: @Path("Something") public class Foo { @EJB private SomeService service @GET public Object frobnicate() { assert service != null; // JBoss blows up here return result; } } Two questions: It is a limitation ...

Using RestEasy with Windows Live Service, how do you unmarshall the list of Contacts returned?

I'm trying to get my contacts from Windows Live using RestEasy After succesfully authenticating my user, I've made the call to https://livecontacts.services.live.com/users/@L@/rest/livecontacts Set the authentication header, added my id and my tokens If i make the call from command line using cUrl I get the expected output, but in my w...

What do you guys think of RestEASY?

So I wrote a sample REST resource that works like a charm in Jersey/Tomcat, but when I take it to RestEASY/Tomcat it blows. I mean really? what happened to working out of the box. Anyway a little frustrated. I get this error when trying to access the resource(http://localhost:7070/mg/mytest) "content-type was null and expecting to extra...

How to get details of ClientResponseFailure in RestEasy Client ?

How to get http response contents when status >=400 is returned. That's my code sample : try { ChatService client = ProxyFactory.create(ChatService.class, apiUrl); client.putMessage(dto); } catch (ClientResponseFailure ex) { System.out.println(ex.getResponse().getEntity().toString()); } This throws...

RESTEasy-Spring integrated webapp throws cryptic error: NoResourceFoundFailure

I am working on a webapp that uses both the Spring Framework and RESTEasy. The app has been configured to send REST requests for some time, but I recently set it up to receive REST requests as well. I configured my web.xml appropriately, and the app has received and processed REST requests with no problem. here is a web.xml snippet, det...

ExceptionMapper issue in RESTEasy

So in my JAXRS application, I have 2 ExceptionMapper registered as @Provider public class MyExceptionMapper implements ExceptionMapper<Exception> {...} public class MyCustomRuntimeExceptionMapper implements ExceptionMapper<MyCustomRuntimeException> {...} When my application throws a new "MyCustomRuntimeException", the exception is ca...

Call ExceptionMapper from another ExceptionMapper in JAX-RS

In my RESTEasy application I'm getting a java.lang.reflect.UndeclaredThrowableException, because a checked exception is being thrown from a method that doesn't declare the exception in the throws clause. So I'm writing an UndeclaredThrowableExceptionMapper. The UndeclaredThrowableException wraps the real exception; I call e.getCause() ...

RestEasy csv file upload (multipart / form-data) garbles iso-8859-1 characters in FireFox

I have a multipart / form-data form to upload a csv file to a rest easy (JAX RS) webservice. This file can contain iso-8859-1 characters like for example é. When I upload the file through Firefox these characters are garbled and they end up like a ?. When I upload the file through Internet Explorer everything works fine. I've done a lot...

How to choose between Jersey, Apache Wink and JBoss RESTEasy?

I just heard about Apache Wink, and I was wondering what differences it had compared to Jersey or JBoss RESTEasy. What can be done in one that the other two can't? We've been using Jersey for some of our internal projects mostly for it's simplicity, but I can't really figure out what makes these other two any better that I would consid...

RESTEasy client framework authentication credentials

I looked for the ways, how a client can send authentication credentials to a webservice (e.g. Tomcat Manager) and found this topic http://stackoverflow.com/questions/1885844/resteasy-client-framework-authentication-credentials Just have some questions after reading: 1. Are there other possibilities to do that? 2. What imports are neede...

Advantage of RESTEasy over Apache CXF ?

I have Restful web-service implemented using Apache CXF. Since I am going to use JBoss for deployment, I am thinking of moving to RESTEasy as it provides better JBoss integration. What are the advantages of RESTEasy over Apache cxf apart from better server integration? ...

RestEasy ClientRequest followRedirect behaviour on POST

To my knowledge the correct way, in a restful sense, to handle creation of a new resource is to POST the request and then redirect the client to the result via header location field. It seems ClientRequest does not support this. I cannot get the ClientRequest to automatically follow the see other (303) redirect after a post. When a Post...

Is RestEasy the right choice?

Of the JAX-RS implementations it seems RestEasy is the most difficult to get help for. If you look at the mailing list archive for the project at SourceForge you will notice almost none of the questions are answered or at least I have not seen one that was answered. On the JBoss community site there is very little discussion regarding th...

RESTEasy client works stand-alone but fails within Tomcat

I have with me the client interface for a web service that was built using JBoss/RESTeasy. The web service calls work fine when they are invoked from a stand-alone app, but as soon as I put them into a webapp running in a Tomcat container (on the same machine), they start behaving weirdly. Some of the calls return empty results while som...

Why writer for media type application/json missing

Basically I have a restful service (post) that consumes(application/json) and produces (application/json). The single param for this service is an annotated java object. I am using org.jboss.resteasy.client.ClientRequest to send the request to the service. However, I am getting this exception in the client end and the exception: ...

RESTEasy and client IP address

Hello! I'm using RESTEasy services in my application and now I'm forced to get the clients IP addresses. So the question is... how can I do that?. Thanks in advance EDITED I've just came to a solution with servlet filter... but still.. can that be done inside of RESTEasy service? ...

Mapping xml-attribute using resteasy

Hi all. I'm using resteasy and have some problem. There is some service on remote server. For example, when I go to url "http://some.site.com/Login/my_login/my_passowrd" service returns me xml: < LoginToken> < success>true< /success> < token>23324473-897b-408b-b096-bf2cddad33< /token> < /LoginToken> I've wrote class for mapping:...

Dynamically change RESTEasy service return type.

Am I able to change the value of @Produces annotation parameter in my RESTEasy services?? The task I'm given is to integrate multiple format reporting to an existing reporting system. So changing the @Produces annotation parameter dynamically would help me a lot. Thanks in advance! ...

Using JAXB to pass subclass instances as superclass

What I have is a set of Java classes (close to 25) representing message types. They all inherit from a Message class which I'd like to be abstract. Each message type adds a few additional fields to the set provided by the Message superclass. I'm implementing some RESTful web services using RESTeasy and would like to have methods like ...