resteasy

Resteasy Client keeping connection allocated after a method throws an Exception

假装没事ソ 提交于 2019-12-12 02:46:33
问题 I'm currently using TJWSEmbeddedJaxrsServer to help me with my RESTful API tests (created with Resteasy) and it works sweetly. But a problem happens when any of the called methods throws an Exception: the Reasteasy Client becomes "lost" and still holds the connection, not allowing for the other test methods to call the RESTful service. It happens even if you instanciate a Provider that can Unwrap the Exception and use it in the embedded server. Can anyone help me, please? To simulate the

How can I get resteasy MultipartFormDataInput to decode strings using UTF-8?

╄→гoц情女王★ 提交于 2019-12-12 01:37:09
问题 I'm using resteasy 2.3.4-Final and having UTF-8 problems in calls that accept multipart/form-data. The consumers of my API are iOS and Android devices. Any string params that are sent, don't contain a charset so resteasy seems to be decoding the strings with us-ascii encoding. I've done plenty of work to fix everything else involved from the db layer up to create a filter that will force the character encoding to utf-8. This solved the problem for all form-url-encoded POSTs, but now two calls

RESTful webservices: query parameters

强颜欢笑 提交于 2019-12-12 01:29:06
问题 I am using JAX-RS with RESTEasy. I want to know if we can have represent different resources with path differentiated only by order and number of query parameters? e.g. /customer/1234 /customer?id=1234 /customer?name=James Can I create three different methods e.g. @Path("customer/{id}") public Response get(@PathParam("id") final Long id) { .. } @Path("customer?id={id}") public Response get(@QueryParam("id") final Long id) { .. } @Path("customer?name={name}") public Response get(@QueryParam(

java.lang.NoSuchMethodError: org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver: method <init>()V not found

无人久伴 提交于 2019-12-12 00:38:08
问题 I am developing Spring + MVC + RestEasy example. I was successfully able to developed the code, but I see the below error. It looks like to dependency mismatched issue. I already frusted to solve this issue, but unable to fixed it yet. I uploaded source code here: https://github.com/test512/RestEasy-Spring-MVC-Hibernate org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter':

Java REST - Correct parameters for JQuery multipart/form-data file upload?

人盡茶涼 提交于 2019-12-11 23:20:37
问题 We've come across a problem in our websites file upload functionality for Safari 5.x. JQuery normally sends the file to the REST service as a File with the correct Content-Type (e.g. image/png) assigned, however with Safari 5.x it appears it can only send it as "multipart/form-data" I've tried adding the new endpoint to accept this via both Jersey and RestEasy, but I have had no success. I believe the problem is simply that I'm having trouble determining what the parameters should be. No

How to add more jax-rs components to the application?

梦想与她 提交于 2019-12-11 20:40:56
问题 I want to add a @Provider ContainerRequestFilter to my web project which is already defined in another project on which my current project has dependency on. So, all the providers of that project are available to this project. Both wars are packaged as ear and deployed to wildfly. But since, context-roots are different for both the web projects (or both are different web applications), the @Provider is only working for the jax-rs resources in the first project. So, I want to manually add the

Resteasy: java.lang.NoClassDefFoundError: javax/servlet/ServletContext

青春壹個敷衍的年華 提交于 2019-12-11 18:07:33
问题 I have Resteasy servlet and listener configured in web.xml <servlet-mapping> <servlet-name>resteasy-servlet</servlet-name> <url-pattern>/rest/*</url-pattern> </servlet-mapping> <!-- Auto scan REST service --> <context-param> <param-name>resteasy.scan</param-name> <param-value>true</param-value> </context-param> <!-- this should be the same URL pattern as the servlet-mapping property --> <context-param> <param-name>resteasy.servlet.mapping.prefix</param-name> <param-value>/rest</param-value> <

resteasy providers missing after mvn package

风流意气都作罢 提交于 2019-12-11 16:58:00
问题 I have written some code that uses some resteasy libraries. The code works fine in Eclipse but produces exceptions when excecuted as fat-jar build with the maven shade plugin. The reason: in the created jar under META-INF/services/javax.ws.rs.ext.Providers only the providers from resteasy-client are listed. I however also need the providers from resteasy-jackson2-provider and from resteasy-jaxrs. I think the issue might be, that all 3 libraries (resteasy-client, resteasy-jackson2-provider,

resteasy invoke service inside another service

人盡茶涼 提交于 2019-12-11 16:13:21
问题 I have a services X and Y. If I want to invoke Y inside X. Is there a way to do that thru annotations. I don't want to configure a bean for X/Y, as all the other resources are Autowired for X. Thanks! 回答1: Spring can only inject managed instances: @Service public class X { @Resource private Y y; } @Service public class Y { } If you do not like to add @Service to class Y, then you could use this (X will be the same) @Configuration public class AppConfig { @Bean public Y y { return new Y(); } }

Class xxx does not contain a public constructor needed to autobuild when xxx become a Tapestry Service

别等时光非礼了梦想. 提交于 2019-12-11 15:12:39
问题 I'm discovering the wonderful integration work made by Tynamo's team between Tapestry and Resteasy . I'm trying to activate Liveclass Reloading on webservices. As per doc says : Documentation The only thing you need to do to enable live class reloading for your REST services is to bind them as regular Tapestry IoC services and contribute them to javax.ws.rs.core.Application.class. Read more about how service implementation reloading works in: http://tapestry.apache.org/reload.html Here is an