You can subscribe to this list here.
| 2008 |
Jan
|
Feb
|
Mar
(16) |
Apr
(18) |
May
(13) |
Jun
(100) |
Jul
(165) |
Aug
(53) |
Sep
(41) |
Oct
(84) |
Nov
(113) |
Dec
(171) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2009 |
Jan
(84) |
Feb
(30) |
Mar
(75) |
Apr
(113) |
May
(87) |
Jun
(96) |
Jul
(127) |
Aug
(106) |
Sep
(191) |
Oct
(142) |
Nov
(106) |
Dec
(83) |
| 2010 |
Jan
(62) |
Feb
(93) |
Mar
(92) |
Apr
(58) |
May
(52) |
Jun
(104) |
Jul
(109) |
Aug
(94) |
Sep
(75) |
Oct
(54) |
Nov
(65) |
Dec
(38) |
| 2011 |
Jan
(53) |
Feb
(84) |
Mar
(95) |
Apr
(24) |
May
(10) |
Jun
(49) |
Jul
(74) |
Aug
(23) |
Sep
(67) |
Oct
(21) |
Nov
(62) |
Dec
(50) |
| 2012 |
Jan
(26) |
Feb
(7) |
Mar
(9) |
Apr
(5) |
May
(13) |
Jun
(7) |
Jul
(18) |
Aug
(48) |
Sep
(58) |
Oct
(79) |
Nov
(19) |
Dec
(15) |
| 2013 |
Jan
(33) |
Feb
(21) |
Mar
(10) |
Apr
(22) |
May
(39) |
Jun
(31) |
Jul
(15) |
Aug
(6) |
Sep
(8) |
Oct
(1) |
Nov
(4) |
Dec
(3) |
| 2014 |
Jan
(17) |
Feb
(18) |
Mar
(15) |
Apr
(12) |
May
(11) |
Jun
(3) |
Jul
(10) |
Aug
(2) |
Sep
(3) |
Oct
(4) |
Nov
(4) |
Dec
(1) |
| 2015 |
Jan
|
Feb
(6) |
Mar
(5) |
Apr
(13) |
May
(2) |
Jun
(3) |
Jul
(1) |
Aug
(2) |
Sep
(6) |
Oct
(12) |
Nov
(12) |
Dec
(12) |
| 2016 |
Jan
(10) |
Feb
(3) |
Mar
(8) |
Apr
(4) |
May
(2) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
|
| 2017 |
Jan
(6) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
|
From: Bill B. <bb...@re...> - 2013-09-05 15:42:32
|
Resteasy 3.0.4.Final has been released today. Besides some bug fixes, this ended up being a major feature release specifically: * Netty 4 integration thanks to Kristoffer Sjoegren * Undertow integration * JOSE JSON Web Encryption (JWE) Support * A new Servlet 3.0 ServerContainerInitializer for Resteasy. This allows you to take advantage of JAX-RS integration within a standalone Servlet 3.0 environment. This means you can work solely with Application classes, use automatic scanning, and not have to write anything in your web.xml files for Tomcat and Jetty deployments!. * I also published the new revised examples for my up-and-coming Restful Java With JAX-RS 2.0 book. As usual, check out http://jboss.org/resteasy for how to download the distro and view documentation. -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |
|
From: Solomon D. <sd...@gm...> - 2013-08-23 13:53:56
|
XmlJavaAdapter is useful, but it's somewhat limited. You can use it for
things like converting Currency or Date objects into Strings and vice
versa. It's not all that helpful for more complicated scenarios, like
adding fields from a database or complicated XML conversions.
-Solomon
On Fri, Aug 23, 2013 at 9:48 AM, Adrian Mitev <adr...@gm...>wrote:
> Is there something like the XmlJavaAdapter in JAXB?
>
>
> On Fri, Aug 23, 2013 at 3:55 PM, Gregor Jarisch <gr...@ja...>wrote:
>
>> Hey Adrian,
>>
>> if you cannot/don't want to change it in the GET method directly but want
>> to deal with it at server side I would tunnel it..
>> Make a second Rest method, which calls your GET method via client api,
>> then change what you need to change and return the modified version to your
>> client.
>>
>> If your application is not a high performance app, this approach is a
>> good, clean choice..
>>
>> - Gregor
>>
>>
>> ------------------------------
>> *From: *"Adrian Mitev" <adr...@gm...>
>> *To: *res...@li...
>> *Sent: *Friday, August 23, 2013 2:02:41 PM
>> *Subject: *[Resteasy-developers] Converting object fields when
>> serializing to JSON
>>
>>
>> Hi all! I'm using the resteasy that comes with jboss 7.2 (EAP 6 alpha). I
>> have a @GET method that produces application/json where i return an object
>> (JPA entity) which contains a String field with the username of the user
>> who created the object. However on the client i need to provide more
>> information - username and full name. Is there a way to configure some kind
>> of converter so from:
>> class MyClass {
>> String title;
>> String username;
>> }
>> i should produce:
>> {
>> "title" : "something",
>> "username" : "amitev"
>> "fullname" : "Adrian Mitev"
>> }
>> or
>> {
>> "title" : "something",
>> "user" : {
>> "username" : "amitev"
>> "fullname" : "Adrian Mitev"
>> }
>> }
>>
>>
>> ------------------------------------------------------------------------------
>> Introducing Performance Central, a new site from SourceForge and
>> AppDynamics. Performance Central is your source for news, insights,
>> analysis and resources for efficient Application Performance Management.
>> Visit us today!
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Resteasy-developers mailing list
>> Res...@li...
>> https://lists.sourceforge.net/lists/listinfo/resteasy-developers
>>
>>
>
>
> ------------------------------------------------------------------------------
> Introducing Performance Central, a new site from SourceForge and
> AppDynamics. Performance Central is your source for news, insights,
> analysis and resources for efficient Application Performance Management.
> Visit us today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
> _______________________________________________
> Resteasy-developers mailing list
> Res...@li...
> https://lists.sourceforge.net/lists/listinfo/resteasy-developers
>
>
|
|
From: Adrian M. <adr...@gm...> - 2013-08-23 13:48:07
|
Is there something like the XmlJavaAdapter in JAXB?
On Fri, Aug 23, 2013 at 3:55 PM, Gregor Jarisch <gr...@ja...> wrote:
> Hey Adrian,
>
> if you cannot/don't want to change it in the GET method directly but want
> to deal with it at server side I would tunnel it..
> Make a second Rest method, which calls your GET method via client api,
> then change what you need to change and return the modified version to your
> client.
>
> If your application is not a high performance app, this approach is a
> good, clean choice..
>
> - Gregor
>
>
> ------------------------------
> *From: *"Adrian Mitev" <adr...@gm...>
> *To: *res...@li...
> *Sent: *Friday, August 23, 2013 2:02:41 PM
> *Subject: *[Resteasy-developers] Converting object fields when
> serializing to JSON
>
>
> Hi all! I'm using the resteasy that comes with jboss 7.2 (EAP 6 alpha). I
> have a @GET method that produces application/json where i return an object
> (JPA entity) which contains a String field with the username of the user
> who created the object. However on the client i need to provide more
> information - username and full name. Is there a way to configure some kind
> of converter so from:
> class MyClass {
> String title;
> String username;
> }
> i should produce:
> {
> "title" : "something",
> "username" : "amitev"
> "fullname" : "Adrian Mitev"
> }
> or
> {
> "title" : "something",
> "user" : {
> "username" : "amitev"
> "fullname" : "Adrian Mitev"
> }
> }
>
>
> ------------------------------------------------------------------------------
> Introducing Performance Central, a new site from SourceForge and
> AppDynamics. Performance Central is your source for news, insights,
> analysis and resources for efficient Application Performance Management.
> Visit us today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
> _______________________________________________
> Resteasy-developers mailing list
> Res...@li...
> https://lists.sourceforge.net/lists/listinfo/resteasy-developers
>
>
|
|
From: Gregor J. <gr...@ja...> - 2013-08-23 13:11:28
|
Hey Adrian,
if you cannot/don't want to change it in the GET method directly but want to deal with it at server side I would tunnel it..
Make a second Rest method, which calls your GET method via client api, then change what you need to change and return the modified version to your client.
If your application is not a high performance app, this approach is a good, clean choice..
- Gregor
----- Original Message -----
From: "Adrian Mitev" <adr...@gm...>
To: res...@li...
Sent: Friday, August 23, 2013 2:02:41 PM
Subject: [Resteasy-developers] Converting object fields when serializing to JSON
Hi all! I'm using the resteasy that comes with jboss 7.2 (EAP 6 alpha). I have a @GET method that produces application/json where i return an object (JPA entity) which contains a String field with the username of the user who created the object. However on the client i need to provide more information - username and full name. Is there a way to configure some kind of converter so from:
class MyClass {
String title;
String username;
}
i should produce:
{
"title" : "something",
"username" : "amitev"
"fullname" : "Adrian Mitev"
}
or
{
"title" : "something",
"user" : {
"username" : "amitev"
"fullname" : "Adrian Mitev"
}
}
------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and
AppDynamics. Performance Central is your source for news, insights,
analysis and resources for efficient Application Performance Management.
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
Resteasy-developers mailing list
Res...@li...
https://lists.sourceforge.net/lists/listinfo/resteasy-developers
|
|
From: Adrian M. <adr...@gm...> - 2013-08-23 12:02:49
|
Hi all! I'm using the resteasy that comes with jboss 7.2 (EAP 6 alpha). I
have a @GET method that produces application/json where i return an object
(JPA entity) which contains a String field with the username of the user
who created the object. However on the client i need to provide more
information - username and full name. Is there a way to configure some kind
of converter so from:
class MyClass {
String title;
String username;
}
i should produce:
{
"title" : "something",
"username" : "amitev"
"fullname" : "Adrian Mitev"
}
or
{
"title" : "something",
"user" : {
"username" : "amitev"
"fullname" : "Adrian Mitev"
}
}
|
|
From: Bill B. <bb...@re...> - 2013-08-21 21:36:56
|
Man, I upgraded maven-compiler-plugin from 2.3.1 to 3.1. 25% build time improvement. Also, a lot less memory is being used by maven....Wish I knew that a long time ago. -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |
|
From: Bill B. <bb...@re...> - 2013-08-07 02:34:55
|
Follow the links at http://jboss.org/resteasy to download and view release notes. The was just a maintenance release fixing a few minor bugs in async and cookie parsing. -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |
|
From: Bill B. <bb...@re...> - 2013-07-22 15:01:55
|
Resteasy 3.0.2 uses 3.6.4 right now, 2.3.7 bundles 3.4.4. I don't know if there were any changes needed to go from 3.4 to 3.6. On 7/22/2013 7:08 AM, Даниел Симеонов wrote: > Hallo, > We are using Netty in a memory restricted environment. Is it possible > to use Resteasy and its Netty integration, but to use only the following > jars from it : > resteasy-jaxrs, resteasy-netty and jaxrs-api and to omit the httpclient, > commons-io, commons-code, scannotation, jsr250 jars. That way we would > add ~700kb of new jar files to the project which is ok. > The version of the Netty we use currently is 3.6.6, what would happen if > we use resteasy 2.3.7 with Netty 3.6.6? > I see that there is Netty 4.0, would there be an integration between > Resteasy and netty 4.0? > Thank you very much! > Best regards, Daniel. > > > ------------------------------------------------------------------------------ > See everything from the browser to the database with AppDynamics > Get end-to-end visibility with application monitoring from AppDynamics > Isolate bottlenecks and diagnose root cause in seconds. > Start your free trial of AppDynamics Pro today! > http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk > > > > _______________________________________________ > Resteasy-developers mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-developers > -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |
|
From: Даниел С. <dsi...@gm...> - 2013-07-22 11:08:37
|
Hallo, We are using Netty in a memory restricted environment. Is it possible to use Resteasy and its Netty integration, but to use only the following jars from it : resteasy-jaxrs, resteasy-netty and jaxrs-api and to omit the httpclient, commons-io, commons-code, scannotation, jsr250 jars. That way we would add ~700kb of new jar files to the project which is ok. The version of the Netty we use currently is 3.6.6, what would happen if we use resteasy 2.3.7 with Netty 3.6.6? I see that there is Netty 4.0, would there be an integration between Resteasy and netty 4.0? Thank you very much! Best regards, Daniel. |
|
From: Josiah H. <jos...@gm...> - 2013-07-18 04:45:17
|
Hi folks,
The issue turned out to be that I did not add a content-type header to the
request. Bit of a silly oversight, but the fact that it was being parsed
into a map (the Jackson default behavior, I understand) made me think that
it was being handled by the correct handlers.
Thanks!
Josiah
On Sat, Jul 13, 2013 at 9:32 PM, Josiah Haswell <jos...@gm...>wrote:
> Hi Folks,
>
> For some reason, I cannot seem to get RESTEasy to deserialize an object
> into the correct type. Here's what I'm trying to do:
>
>
> I have the class:
>
>
> @XmlRootElement
> public class Category {
> private String id;
> private String name;
> private String description;
>
> public String getId() {
> return id;
> }
>
> public void setId(String id) {
> this.id = id;
> }
>
> public String getName() {
> return name;
> }
>
> public void setName(String name) {
> this.name = name;
> }
>
> public String getDescription() {
> return description;
> }
>
> public void setDescription(String description) {
> this.description = description;
> }
> }
>
> And the REST Service:
>
> @Path("cat")
> public class DefaultCatEndpoint {
> @PUT
> @Path("save")
> @Consumes(MediaType.APPLICATION_JSON)
> @Produces(MediaType.APPLICATION_JSON)
> public Category save(Category cat) {
> return cat;
> }
> }
>
>
> And I keep getting the exception:
>
>
>
> Bad arguments passed to public rest.Category
> rest.DefaultCatEndpoint.save(rest.Category) (
> java.util.LinkedHashMap {id=4c7e2662-0095-4c92-9e7f-7f43af62daee,
> name=testname,
> description=description}
>
>
> My web.xml file is:
>
>
> <web-app
> version="3.0"
> xmlns="http://java.sun.com/xml/ns/javaee"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
> http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
> >
>
> <context-param>
> <param-name>resteasy.scan</param-name>
> <param-value>true</param-value>
> </context-param>
>
> <context-param>
> <param-name>resteasy.servlet.mapping.prefix</param-name>
> <param-value>/test</param-value>
> </context-param>
> <context-param>
> <param-name>resteasy.resource.method-interceptors</param-name>
> <param-value>
> org.jboss.resteasy.core.ResourceMethodSecurityInterceptor
> </param-value>
> </context-param>
>
> <listener>
>
> <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
> </listener>
>
> <servlet>
> <servlet-name>Resteasy</servlet-name>
>
> <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
> <init-param>
> <param-name>javax.ws.rs.Application</param-name>
> <param-value>app.RestApplication</param-value>
> </init-param>
> </servlet>
>
> <servlet-mapping>
> <servlet-name>Resteasy</servlet-name>
> <url-pattern>/*</url-pattern>
> </servlet-mapping>
> </web-app>
>
> And I have:
>
> <dependency>
> <groupId>org.jboss.resteasy</groupId>
> <artifactId>resteasy-jaxrs</artifactId>
> <version>${resteasy.version}</version>
> <scope>provided</scope>
> </dependency>
>
>
> <dependency>
> <groupId>org.jboss.resteasy</groupId>
> <artifactId>resteasy-jackson-provider</artifactId>
> <version>${resteasy.version}</version>
> </dependency>
>
>
> As my dependencies.
>
> Any help would be very much appreciated! I'm testing this on JBoss AS 7.1
>
> Josiah
>
>
|
|
From: Bill B. <bb...@re...> - 2013-07-17 23:43:17
|
Mostly a small maintenance release. I did add a forward() method to HttpRequest. If you tried to forward() using a RequestDispatcher, Resteasy would still try and send a response. The HttpRequest.forward() method makes sure this happens and gives you an abstraction too. Special thanks to Alexey Ogarkov for adding java.net.URL support for JAX-RS 2.0 client framework too. See http://jboss.org/resteasy for where to download and view release notes. -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |
|
From: Bill B. <bb...@re...> - 2013-07-15 12:13:56
|
You want to generate a URL? Look at UriBuilder. It has methods for passing in a Class and/or a Java method. It will look for @Path annotations and add to the URI path as needed. On 7/15/2013 7:32 AM, Sushil Kr. Vishwanathan wrote: > Hello: > I am trying to implement proper HATEOS using Resteasy as my framework of > choice. However, I am encountering situations where I am manually having > to hard-code links instead of calculating them from the JAX-RS classes > themselves. As an example, let us say I have a root resource /a which > has a sub-resource /b which in turn has a sub-resource /c. So the full > path to C is /a/b/c. Now from another resource D, I want to create a > link to C as part of my response representation but I am not able to > find the full link to C without hard-coding the same. How do I implement > this? > > > ------------------------------------------------------------------------------ > See everything from the browser to the database with AppDynamics > Get end-to-end visibility with application monitoring from AppDynamics > Isolate bottlenecks and diagnose root cause in seconds. > Start your free trial of AppDynamics Pro today! > http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk > > > > _______________________________________________ > Resteasy-developers mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-developers > -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |
|
From: Sushil K. V. <sus...@ya...> - 2013-07-15 11:34:32
|
Hello: I am trying to implement proper HATEOS using Resteasy as my framework of choice. However, I am encountering situations where I am manually having to hard-code links instead of calculating them from the JAX-RS classes themselves. As an example, let us say I have a root resource /a which has a sub-resource /b which in turn has a sub-resource /c. So the full path to C is /a/b/c. Now from another resource D, I want to create a link to C as part of my response representation but I am not able to find the full link to C without hard-coding the same. How do I implement this? |
|
From: Josiah H. <jos...@gm...> - 2013-07-14 03:32:21
|
Hi Folks,
For some reason, I cannot seem to get RESTEasy to deserialize an object
into the correct type. Here's what I'm trying to do:
I have the class:
@XmlRootElement
public class Category {
private String id;
private String name;
private String description;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}
And the REST Service:
@Path("cat")
public class DefaultCatEndpoint {
@PUT
@Path("save")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Category save(Category cat) {
return cat;
}
}
And I keep getting the exception:
Bad arguments passed to public rest.Category
rest.DefaultCatEndpoint.save(rest.Category) (
java.util.LinkedHashMap {id=4c7e2662-0095-4c92-9e7f-7f43af62daee,
name=testname,
description=description}
My web.xml file is:
<web-app
version="3.0"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
>
<context-param>
<param-name>resteasy.scan</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>resteasy.servlet.mapping.prefix</param-name>
<param-value>/test</param-value>
</context-param>
<context-param>
<param-name>resteasy.resource.method-interceptors</param-name>
<param-value>
org.jboss.resteasy.core.ResourceMethodSecurityInterceptor
</param-value>
</context-param>
<listener>
<listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
</listener>
<servlet>
<servlet-name>Resteasy</servlet-name>
<servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
<init-param>
<param-name>javax.ws.rs.Application</param-name>
<param-value>app.RestApplication</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>Resteasy</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
And I have:
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>${resteasy.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jackson-provider</artifactId>
<version>${resteasy.version}</version>
</dependency>
As my dependencies.
Any help would be very much appreciated! I'm testing this on JBoss AS 7.1
Josiah
|
|
From: Bruno O. <br...@ab...> - 2013-07-10 17:36:21
|
It's ok, the argument is for scenarios where SSL is not configured and this layer just doesn't exist. Two-way SSL is a great solution if we believe that most of our devs knows how to properly configure it. Either way it's fine. Bill Burke wrote: > Why reinvent two-way SSL? Just use two-way SSL. > > On 7/2/2013 10:57 AM, Bruno Oliveira wrote: >> Hi Bill only the "exp" attribute from >> http://tools.ietf.org/html/draft-ietf-jose-json-web-signature-11 >> >> I'm not sure if makes some sense, but I would like to make use of your >> lib on the client side (Android - extracting bits or the whole jose-jwt >> module) and into the server side. >> >> Each application would have its own signature, for non repudiation >> against the server and prevent replay attacks. >> >> Makes some sense? If not it's ok, I can dig more into the API. >> >> >> Bill Burke wrote: >>> You want timestamp and exp in the JWS? IMO, this is not needed, its up >>> to the entity embedded/encoded in the JWS to provide this information. >> > -- abstractj |
|
From: Bill B. <bb...@re...> - 2013-07-10 17:27:52
|
You still have to create and share keys and know how to use JWT. Might as well do SSL. On 7/10/2013 1:04 PM, Bruno Oliveira wrote: > It's ok, the argument is for scenarios where SSL is not configured and > this layer just doesn't exist. > > Two-way SSL is a great solution if we believe that most of our devs > knows how to properly configure it. > > Either way it's fine. > > Bill Burke wrote: >> Why reinvent two-way SSL? Just use two-way SSL. >> >> On 7/2/2013 10:57 AM, Bruno Oliveira wrote: >>> Hi Bill only the "exp" attribute from >>> http://tools.ietf.org/html/draft-ietf-jose-json-web-signature-11 >>> >>> I'm not sure if makes some sense, but I would like to make use of your >>> lib on the client side (Android - extracting bits or the whole jose-jwt >>> module) and into the server side. >>> >>> Each application would have its own signature, for non repudiation >>> against the server and prevent replay attacks. >>> >>> Makes some sense? If not it's ok, I can dig more into the API. >>> >>> >>> Bill Burke wrote: >>>> You want timestamp and exp in the JWS? IMO, this is not needed, its up >>>> to the entity embedded/encoded in the JWS to provide this information. >>> >> > -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |
|
From: Gregor J. <gr...@ja...> - 2013-07-05 14:43:55
|
Hi,
I have made some custom exceptions (including their mappers) for the rest interfaces in order to allow java clients to catch them explicitly and react to it accordingly rather than receiving an 500 for any error.
I am using the client api to call a remote method (which ends up throwing a custom exception) surrounded by a try-catch-block. Unfortunately my custom exception won't be caught, instead I receive the follow exception:
Jul 05, 2013 4:25:16 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [Resteasy] in context with path [] threw exception
java.lang.IllegalStateException: Response is closed.
at org.jboss.resteasy.specimpl.BuiltResponse.abortIfClosed(BuiltResponse.java:254)
at org.jboss.resteasy.client.jaxrs.internal.ClientResponse.getEntity(ClientResponse.java:76)
at org.jboss.resteasy.core.ExceptionHandler.unwrapException(ExceptionHandler.java:125)
at org.jboss.resteasy.core.ExceptionHandler.handleApplicationException(ExceptionHandler.java:74)
at org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:212)
at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:149)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:372)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:179)
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:220)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1008)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Here is a code snippet clarifying what I am doing:
RestInterface {
@GET
@Path("/{id}")
public SomeObject getSomeObject(@PathParam("id") String id) throws MyCustomException;
}
RestProxyInterface {
@GET
@Path("/{id}")
public SomeObject getSomeObject(@PathParam("id") String id){
// create client proxy ... --> remoteRestInterface
try {
SomeObject someObject = remoteRestInterface.getSomeObject(id);
}catch (MyCustomException e) {
logger.error(e); // won't get here.. instead throws the above described exception
}
}
}
Is it possible to achieve what I am trying to do? If yes, how?
Thanks.
Gregor
|
|
From: Bill B. <bb...@re...> - 2013-07-04 14:10:51
|
Why reinvent two-way SSL? Just use two-way SSL. On 7/2/2013 10:57 AM, Bruno Oliveira wrote: > Hi Bill only the "exp" attribute from > http://tools.ietf.org/html/draft-ietf-jose-json-web-signature-11 > > I'm not sure if makes some sense, but I would like to make use of your > lib on the client side (Android - extracting bits or the whole jose-jwt > module) and into the server side. > > Each application would have its own signature, for non repudiation > against the server and prevent replay attacks. > > Makes some sense? If not it's ok, I can dig more into the API. > > > Bill Burke wrote: >> You want timestamp and exp in the JWS? IMO, this is not needed, its up >> to the entity embedded/encoded in the JWS to provide this information. > -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |
|
From: Bruno O. <br...@ab...> - 2013-07-02 14:57:59
|
Hi Bill only the "exp" attribute from http://tools.ietf.org/html/draft-ietf-jose-json-web-signature-11 I'm not sure if makes some sense, but I would like to make use of your lib on the client side (Android - extracting bits or the whole jose-jwt module) and into the server side. Each application would have its own signature, for non repudiation against the server and prevent replay attacks. Makes some sense? If not it's ok, I can dig more into the API. Bill Burke wrote: > You want timestamp and exp in the JWS? IMO, this is not needed, its up > to the entity embedded/encoded in the JWS to provide this information. -- abstractj |
|
From: Bill B. <bb...@re...> - 2013-07-02 13:23:10
|
You want timestamp and exp in the JWS? IMO, this is not needed, its up to the entity embedded/encoded in the JWS to provide this information. On 7/2/2013 5:07 AM, Bruno Oliveira wrote: > Just correcting myself into the previous e-mail. I was talking about JWS > and iat is not necessary. > > iat and exp was already implemented into JsonWebToken class, sorry. > > Bruno Oliveira wrote: >> Good morning everyone. >> >> I've been working to include security on AeroGear and make use of >> RESTEasy, to be more specific I would like to include JWT/JWS support, >> the API is pretty straightforward and I think is a good fit for mobile. >> >> Before move forward on AeroGear I'd like to suggest (implement if you >> guys agree) the inclusion two new attributes: >> >> - iat: claim identifies the time at which the JWT was issued. This claim >> can be used to determine the age of the JWT. Its value MUST be a number >> containing an IntDate value >> >> - exp: claim identifies the expiration time on or after which the JWT >> MUST NOT be accepted for processing. The processing of the exp claim >> requires that the current date/time MUST be before the expiration >> date/time listed in the exp claim. Implementers MAY provide for some >> small leeway, usually no more than a few minutes, to account for clock >> skew. Its value MUST be a number containing an IntDate value. >> >> This is important, because I wouldn't like to trust on SSL/TLS only. If >> for some reason this layer is broken (wrong configuration, lack of >> understanding from some developers) , would be nice to have an >> additional layer of security (it won't solve all the problems, but might >> help). >> >> What do you guys think? Makes sense? >> > -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |
|
From: Bruno O. <br...@ab...> - 2013-07-02 09:22:00
|
Good morning everyone. I've been working to include security on AeroGear and make use of RESTEasy, to be more specific I would like to include JWT/JWS support, the API is pretty straightforward and I think is a good fit for mobile. Before move forward on AeroGear I'd like to suggest (implement if you guys agree) the inclusion two new attributes: - iat: claim identifies the time at which the JWT was issued. This claim can be used to determine the age of the JWT. Its value MUST be a number containing an IntDate value - exp: claim identifies the expiration time on or after which the JWT MUST NOT be accepted for processing. The processing of the exp claim requires that the current date/time MUST be before the expiration date/time listed in the exp claim. Implementers MAY provide for some small leeway, usually no more than a few minutes, to account for clock skew. Its value MUST be a number containing an IntDate value. This is important, because I wouldn't like to trust on SSL/TLS only. If for some reason this layer is broken (wrong configuration, lack of understanding from some developers) , would be nice to have an additional layer of security (it won't solve all the problems, but might help). What do you guys think? Makes sense? -- abstractj |
|
From: Bruno O. <br...@ab...> - 2013-07-02 09:12:58
|
Just correcting myself into the previous e-mail. I was talking about JWS and iat is not necessary. iat and exp was already implemented into JsonWebToken class, sorry. Bruno Oliveira wrote: > Good morning everyone. > > I've been working to include security on AeroGear and make use of > RESTEasy, to be more specific I would like to include JWT/JWS support, > the API is pretty straightforward and I think is a good fit for mobile. > > Before move forward on AeroGear I'd like to suggest (implement if you > guys agree) the inclusion two new attributes: > > - iat: claim identifies the time at which the JWT was issued. This claim > can be used to determine the age of the JWT. Its value MUST be a number > containing an IntDate value > > - exp: claim identifies the expiration time on or after which the JWT > MUST NOT be accepted for processing. The processing of the exp claim > requires that the current date/time MUST be before the expiration > date/time listed in the exp claim. Implementers MAY provide for some > small leeway, usually no more than a few minutes, to account for clock > skew. Its value MUST be a number containing an IntDate value. > > This is important, because I wouldn't like to trust on SSL/TLS only. If > for some reason this layer is broken (wrong configuration, lack of > understanding from some developers) , would be nice to have an > additional layer of security (it won't solve all the problems, but might > help). > > What do you guys think? Makes sense? > -- abstractj |
|
From: Gregor J. <gr...@ja...> - 2013-06-21 15:51:46
|
I am just routing it through without reading the Entity explicitly.
Remote {
@GET
Response getInputStream(){
return Response.ok(<InputStream>).type(<MediaType>).build();
}
}
Proxy {
@GET
Response getInputStream() {
//create client api instance ...
return remote.getInputStream();
}
}
----- Original Message -----
From: "Bill Burke" <bb...@re...>
To: "Gregor Jarisch" <gr...@ja...>
Cc: res...@li...
Sent: Friday, June 21, 2013 5:43:57 PM
Subject: Re: [Resteasy-developers] Unable to fetch StreamingOutput via Client Api
How are you using the response?
InputStream is = response.readEntity(InputStream.class);
On 6/21/2013 10:56 AM, Gregor Jarisch wrote:
> I have changed my return type to InputStream to make it work for the moment.
>
> I have encountered something else that could be consider as a bug or of course an enhancement for a future version:
> If the return type is explicitly set to InputStream it works as you said - the stream won't get closed.
> If the return type is wrapped in a Response though and an InputStream is set as its Entity it doesn't work (Stream gets closed).
>
> Would be also nice if this would work in a future release..
>
> ----- Original Message -----
> From: "Bill Burke" <bb...@re...>
> To: "Gregor Jarisch" <gr...@ja...>
> Cc: res...@li...
> Sent: Thursday, June 20, 2013 7:00:54 PM
> Subject: Re: [Resteasy-developers] Unable to fetch StreamingOutput via Client Api
>
> StreamingOutput is a server-side callback interface implemented by the
> application. But, Yeah, you're right, apologies. I guess the framework
> could implement this and you pass in your output stream or let the
> runtime do the callback as you've shown.
>
> You can't just plug in a MessageBodyReader for StreamingOutput because
> Response.readEntity() closes the InputStream automatically if the return
> type isn't a InputSTream or Reader.
>
> Log a jira and we can get it implemented sometime.
>
> On 6/20/2013 11:35 AM, Gregor Jarisch wrote:
>> Although this might appear to you like a stupid question, it is not meant to waste anyone's time - so why are you bother answering if you don't include any helpful information?
>> I might misuse the concept of OutputStream here - if so, I'd be happy to learn more about it.
>>
>> IMO, fetching a stream from one resource and routing it through to serve another one is a legitimate use case.
>>
>> ----- Original Message -----
>> From: "Bill Burke" <bb...@re...>
>> To: res...@li...
>> Sent: Thursday, June 20, 2013 4:10:09 PM
>> Subject: Re: [Resteasy-developers] Unable to fetch StreamingOutput via Client Api
>>
>> Of course you can't obtain a StreamingOutput from the client api....
>>
>> On 6/20/2013 7:14 AM, Gregor Jarisch wrote:
>>> Hi,
>>>
>>> I have to proxy a request from one Jax-RS resource to another (secured) one.
>>>
>>> RestInterface {
>>>
>>> @GET
>>> @Path("/{id}")
>>> @Produces({"image/jpeg"})
>>> public StreamingOutput getImage(@PathParam("id") String id);
>>>
>>> }
>>>
>>> RestProxyInterface {
>>>
>>> @GET
>>> @Path("/{id}")
>>> @Produces({"image/jpeg"})
>>> public StreamingOutput getImage(@PathParam("id") String id){
>>> // create client proxy ... --> remoteRestInterface
>>> StreamingOutput image = remoteRestInterface.getImage(id);
>>> return image;
>>> }
>>> }
>>>
>>> Client api causes following exception:
>>> Caused by: javax.ws.rs.ProcessingException: Unable to find a MessageBodyReader of content-type image/jpeg and type interface javax.ws.rs.core.StreamingOutput
>>> at org.jboss.resteasy.core.interception.ClientReaderInterceptorContext.throwReaderNotFound(ClientReaderInterceptorContext.java:39)
>>> at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.getReader(AbstractReaderInterceptorContext.java:73)
>>> at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:50)
>>> at org.jboss.resteasy.plugins.interceptors.encoding.GZIPDecodingInterceptor.aroundReadFrom(GZIPDecodingInterceptor.java:59)
>>> at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:53)
>>> at org.jboss.resteasy.client.jaxrs.internal.ClientResponse.readFrom(ClientResponse.java:244)
>>> at org.jboss.resteasy.client.jaxrs.internal.ClientResponse.readEntity(ClientResponse.java:178)
>>> at org.jboss.resteasy.specimpl.BuiltResponse.readEntity(BuiltResponse.java:211)
>>> at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.extractResult(ClientInvocation.java:104)
>>> ... 35 more
>>>
>>> So, obviously there is no reader for StreamingOutput.
>>> Creating on:
>>>
>>> @Provider
>>> @Consumes("image/jpeg")
>>> public class StreamingOutputReader implements MessageBodyReader<StreamingOutput> {
>>> @Override
>>> public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
>>> return StreamingOutput.class.isAssignableFrom(type);
>>> }
>>>
>>> @Override
>>> public StreamingOutput readFrom(Class<StreamingOutput> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, final InputStream entityStream) throws IOException, WebApplicationException {
>>> return new StreamingOutput() {
>>> @Override
>>> public void write(OutputStream output) throws IOException, WebApplicationException {
>>> byte[] buffer = new byte[1024];
>>> int bytesRead;
>>> while ((bytesRead = entityStream.read(buffer)) != -1) {
>>> output.write(buffer, 0, bytesRead);
>>> }
>>> }
>>> };
>>> }
>>> }
>>>
>>> Unfortunately I cannot get it to be invoked by the Client Api. Scanning providers is on and according to the logs it is recognized by resteasy.. Debugging through the code, indeed the providerFactory of ClientReaderInterceptorContext doesn't have my StreamingOutputReader...
>>>
>>> What am I doing wrong here?
>>>
>>> Thanks,
>>>
>>> Gregor
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> This SF.net email is sponsored by Windows:
>>>
>>> Build for Windows Store.
>>>
>>> http://p.sf.net/sfu/windows-dev2dev
>>> _______________________________________________
>>> Resteasy-developers mailing list
>>> Res...@li...
>>> https://lists.sourceforge.net/lists/listinfo/resteasy-developers
>>>
>>
>
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com
|
|
From: Bill B. <bb...@re...> - 2013-06-21 15:44:05
|
How are you using the response?
InputStream is = response.readEntity(InputStream.class);
On 6/21/2013 10:56 AM, Gregor Jarisch wrote:
> I have changed my return type to InputStream to make it work for the moment.
>
> I have encountered something else that could be consider as a bug or of course an enhancement for a future version:
> If the return type is explicitly set to InputStream it works as you said - the stream won't get closed.
> If the return type is wrapped in a Response though and an InputStream is set as its Entity it doesn't work (Stream gets closed).
>
> Would be also nice if this would work in a future release..
>
> ----- Original Message -----
> From: "Bill Burke" <bb...@re...>
> To: "Gregor Jarisch" <gr...@ja...>
> Cc: res...@li...
> Sent: Thursday, June 20, 2013 7:00:54 PM
> Subject: Re: [Resteasy-developers] Unable to fetch StreamingOutput via Client Api
>
> StreamingOutput is a server-side callback interface implemented by the
> application. But, Yeah, you're right, apologies. I guess the framework
> could implement this and you pass in your output stream or let the
> runtime do the callback as you've shown.
>
> You can't just plug in a MessageBodyReader for StreamingOutput because
> Response.readEntity() closes the InputStream automatically if the return
> type isn't a InputSTream or Reader.
>
> Log a jira and we can get it implemented sometime.
>
> On 6/20/2013 11:35 AM, Gregor Jarisch wrote:
>> Although this might appear to you like a stupid question, it is not meant to waste anyone's time - so why are you bother answering if you don't include any helpful information?
>> I might misuse the concept of OutputStream here - if so, I'd be happy to learn more about it.
>>
>> IMO, fetching a stream from one resource and routing it through to serve another one is a legitimate use case.
>>
>> ----- Original Message -----
>> From: "Bill Burke" <bb...@re...>
>> To: res...@li...
>> Sent: Thursday, June 20, 2013 4:10:09 PM
>> Subject: Re: [Resteasy-developers] Unable to fetch StreamingOutput via Client Api
>>
>> Of course you can't obtain a StreamingOutput from the client api....
>>
>> On 6/20/2013 7:14 AM, Gregor Jarisch wrote:
>>> Hi,
>>>
>>> I have to proxy a request from one Jax-RS resource to another (secured) one.
>>>
>>> RestInterface {
>>>
>>> @GET
>>> @Path("/{id}")
>>> @Produces({"image/jpeg"})
>>> public StreamingOutput getImage(@PathParam("id") String id);
>>>
>>> }
>>>
>>> RestProxyInterface {
>>>
>>> @GET
>>> @Path("/{id}")
>>> @Produces({"image/jpeg"})
>>> public StreamingOutput getImage(@PathParam("id") String id){
>>> // create client proxy ... --> remoteRestInterface
>>> StreamingOutput image = remoteRestInterface.getImage(id);
>>> return image;
>>> }
>>> }
>>>
>>> Client api causes following exception:
>>> Caused by: javax.ws.rs.ProcessingException: Unable to find a MessageBodyReader of content-type image/jpeg and type interface javax.ws.rs.core.StreamingOutput
>>> at org.jboss.resteasy.core.interception.ClientReaderInterceptorContext.throwReaderNotFound(ClientReaderInterceptorContext.java:39)
>>> at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.getReader(AbstractReaderInterceptorContext.java:73)
>>> at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:50)
>>> at org.jboss.resteasy.plugins.interceptors.encoding.GZIPDecodingInterceptor.aroundReadFrom(GZIPDecodingInterceptor.java:59)
>>> at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:53)
>>> at org.jboss.resteasy.client.jaxrs.internal.ClientResponse.readFrom(ClientResponse.java:244)
>>> at org.jboss.resteasy.client.jaxrs.internal.ClientResponse.readEntity(ClientResponse.java:178)
>>> at org.jboss.resteasy.specimpl.BuiltResponse.readEntity(BuiltResponse.java:211)
>>> at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.extractResult(ClientInvocation.java:104)
>>> ... 35 more
>>>
>>> So, obviously there is no reader for StreamingOutput.
>>> Creating on:
>>>
>>> @Provider
>>> @Consumes("image/jpeg")
>>> public class StreamingOutputReader implements MessageBodyReader<StreamingOutput> {
>>> @Override
>>> public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
>>> return StreamingOutput.class.isAssignableFrom(type);
>>> }
>>>
>>> @Override
>>> public StreamingOutput readFrom(Class<StreamingOutput> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, final InputStream entityStream) throws IOException, WebApplicationException {
>>> return new StreamingOutput() {
>>> @Override
>>> public void write(OutputStream output) throws IOException, WebApplicationException {
>>> byte[] buffer = new byte[1024];
>>> int bytesRead;
>>> while ((bytesRead = entityStream.read(buffer)) != -1) {
>>> output.write(buffer, 0, bytesRead);
>>> }
>>> }
>>> };
>>> }
>>> }
>>>
>>> Unfortunately I cannot get it to be invoked by the Client Api. Scanning providers is on and according to the logs it is recognized by resteasy.. Debugging through the code, indeed the providerFactory of ClientReaderInterceptorContext doesn't have my StreamingOutputReader...
>>>
>>> What am I doing wrong here?
>>>
>>> Thanks,
>>>
>>> Gregor
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> This SF.net email is sponsored by Windows:
>>>
>>> Build for Windows Store.
>>>
>>> http://p.sf.net/sfu/windows-dev2dev
>>> _______________________________________________
>>> Resteasy-developers mailing list
>>> Res...@li...
>>> https://lists.sourceforge.net/lists/listinfo/resteasy-developers
>>>
>>
>
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com
|
|
From: Gregor J. <gr...@ja...> - 2013-06-21 14:56:15
|
I have changed my return type to InputStream to make it work for the moment.
I have encountered something else that could be consider as a bug or of course an enhancement for a future version:
If the return type is explicitly set to InputStream it works as you said - the stream won't get closed.
If the return type is wrapped in a Response though and an InputStream is set as its Entity it doesn't work (Stream gets closed).
Would be also nice if this would work in a future release..
----- Original Message -----
From: "Bill Burke" <bb...@re...>
To: "Gregor Jarisch" <gr...@ja...>
Cc: res...@li...
Sent: Thursday, June 20, 2013 7:00:54 PM
Subject: Re: [Resteasy-developers] Unable to fetch StreamingOutput via Client Api
StreamingOutput is a server-side callback interface implemented by the
application. But, Yeah, you're right, apologies. I guess the framework
could implement this and you pass in your output stream or let the
runtime do the callback as you've shown.
You can't just plug in a MessageBodyReader for StreamingOutput because
Response.readEntity() closes the InputStream automatically if the return
type isn't a InputSTream or Reader.
Log a jira and we can get it implemented sometime.
On 6/20/2013 11:35 AM, Gregor Jarisch wrote:
> Although this might appear to you like a stupid question, it is not meant to waste anyone's time - so why are you bother answering if you don't include any helpful information?
> I might misuse the concept of OutputStream here - if so, I'd be happy to learn more about it.
>
> IMO, fetching a stream from one resource and routing it through to serve another one is a legitimate use case.
>
> ----- Original Message -----
> From: "Bill Burke" <bb...@re...>
> To: res...@li...
> Sent: Thursday, June 20, 2013 4:10:09 PM
> Subject: Re: [Resteasy-developers] Unable to fetch StreamingOutput via Client Api
>
> Of course you can't obtain a StreamingOutput from the client api....
>
> On 6/20/2013 7:14 AM, Gregor Jarisch wrote:
>> Hi,
>>
>> I have to proxy a request from one Jax-RS resource to another (secured) one.
>>
>> RestInterface {
>>
>> @GET
>> @Path("/{id}")
>> @Produces({"image/jpeg"})
>> public StreamingOutput getImage(@PathParam("id") String id);
>>
>> }
>>
>> RestProxyInterface {
>>
>> @GET
>> @Path("/{id}")
>> @Produces({"image/jpeg"})
>> public StreamingOutput getImage(@PathParam("id") String id){
>> // create client proxy ... --> remoteRestInterface
>> StreamingOutput image = remoteRestInterface.getImage(id);
>> return image;
>> }
>> }
>>
>> Client api causes following exception:
>> Caused by: javax.ws.rs.ProcessingException: Unable to find a MessageBodyReader of content-type image/jpeg and type interface javax.ws.rs.core.StreamingOutput
>> at org.jboss.resteasy.core.interception.ClientReaderInterceptorContext.throwReaderNotFound(ClientReaderInterceptorContext.java:39)
>> at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.getReader(AbstractReaderInterceptorContext.java:73)
>> at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:50)
>> at org.jboss.resteasy.plugins.interceptors.encoding.GZIPDecodingInterceptor.aroundReadFrom(GZIPDecodingInterceptor.java:59)
>> at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:53)
>> at org.jboss.resteasy.client.jaxrs.internal.ClientResponse.readFrom(ClientResponse.java:244)
>> at org.jboss.resteasy.client.jaxrs.internal.ClientResponse.readEntity(ClientResponse.java:178)
>> at org.jboss.resteasy.specimpl.BuiltResponse.readEntity(BuiltResponse.java:211)
>> at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.extractResult(ClientInvocation.java:104)
>> ... 35 more
>>
>> So, obviously there is no reader for StreamingOutput.
>> Creating on:
>>
>> @Provider
>> @Consumes("image/jpeg")
>> public class StreamingOutputReader implements MessageBodyReader<StreamingOutput> {
>> @Override
>> public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
>> return StreamingOutput.class.isAssignableFrom(type);
>> }
>>
>> @Override
>> public StreamingOutput readFrom(Class<StreamingOutput> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, final InputStream entityStream) throws IOException, WebApplicationException {
>> return new StreamingOutput() {
>> @Override
>> public void write(OutputStream output) throws IOException, WebApplicationException {
>> byte[] buffer = new byte[1024];
>> int bytesRead;
>> while ((bytesRead = entityStream.read(buffer)) != -1) {
>> output.write(buffer, 0, bytesRead);
>> }
>> }
>> };
>> }
>> }
>>
>> Unfortunately I cannot get it to be invoked by the Client Api. Scanning providers is on and according to the logs it is recognized by resteasy.. Debugging through the code, indeed the providerFactory of ClientReaderInterceptorContext doesn't have my StreamingOutputReader...
>>
>> What am I doing wrong here?
>>
>> Thanks,
>>
>> Gregor
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by Windows:
>>
>> Build for Windows Store.
>>
>> http://p.sf.net/sfu/windows-dev2dev
>> _______________________________________________
>> Resteasy-developers mailing list
>> Res...@li...
>> https://lists.sourceforge.net/lists/listinfo/resteasy-developers
>>
>
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com
|