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: Gregor J. <gr...@ja...> - 2013-06-21 10:21:36
|
https://issues.jboss.org/browse/RESTEASY-895 ----- 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-20 17:01:05
|
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: Solomon D. <sd...@gm...> - 2013-06-20 15:52:01
|
Routing from an inputStream to an outputStream of your choice makes
sense... Obviously, you can easily do that via getting an InputStream and
converting that to the StreamingOutput...
if you want to go with the registration route, try this at the time the app
starts up:
ResteasyProviderFactory.getInstance().register(StreamingOutputReader.class);
-Solomon
On Thu, Jun 20, 2013 at 11:35 AM, Gregor Jarisch <gr...@ja...> 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
>
>
> ------------------------------------------------------------------------------
> 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
>
>
> ------------------------------------------------------------------------------
> 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
>
|
|
From: Gregor J. <gr...@ja...> - 2013-06-20 15:35:11
|
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
------------------------------------------------------------------------------
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
|
|
From: Jason H. <ja...@gm...> - 2013-06-20 15:22:20
|
Hi,
I'm using RestEasy 2.3.5 and we have a situation where the parameter has a
forward slash. So I had to encode it and pass it in the URL on a POST.
The REST service looks something like this:
@POST
@Path("car/{carId}/manufacturers")
@Consumes("application/json")
@Produces("application/json")
public ManufacturerResponse findManufacturers(@PathParam("carId") @Encoded
String carId);
I get a 400 response, it cannot find resource. When I strip out the
forward slash in the parameter it works. So @Encoded is not working. Is
this a bug with the API ?
Jason Hall
|
|
From: Bill B. <bb...@re...> - 2013-06-20 15:05:39
|
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-20 11:14:25
|
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
|
|
From: Bill B. <bb...@re...> - 2013-06-19 13:41:25
|
I had a blocker bug. If you were deploying to Tomcat or Jetty and using scanning, one of the built in providers would have been scanned when it should not have. It was just a matter of removing @Provider from this class. New release is up, you know where to look... -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |
|
From: Bill B. <bb...@re...> - 2013-06-18 13:49:08
|
See my blog for more details: http://bill.burkecentral.com/2013/06/18/resteasy-3-0-final-released/ -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |
|
From: Bill B. <bb...@re...> - 2013-06-10 16:28:07
|
Resteasy 3.0-RC1 has been released today. We are fully TCK compliant now, just need to have Wildfly support HTTP DIGEST auth, then we can officially certify. RC1 will have a 1 week lifetime and we'll be doing a 3.0.Final release next week. So, *LAST CHANCE TO SUBMIT BUGS!*. Go to: http://jboss.org/resteasy to find the docs and downloads links. -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |
|
From: Arun A. <aru...@gm...> - 2013-06-10 15:42:13
|
All, Is there a way I can use RestEasy just for Marshalling/Unmarshalling (using it as HttpMessageConverter) instead of using it as a framework to deliver my REST APIs? If yes, how? My problem is Spring MVC doesn't do a good job if my REST response object doesn't contain @XmlRootElement annotation. This is handled beautifully by RestEasy!. Thanks Arun |
|
From: Gregor J. <gr...@ja...> - 2013-06-10 12:53:54
|
I don't necessarily need resteasy to deliver the jsp pages by itself, but I want resteasy to handle the request and at the response time define which jsp page should get delivered to the user. if resteasy cannot deliver the jsp - is there a way to forward to the JSP/servlet container (without redirecting to a different URI) ? ----- Original Message ----- From: "Bill Burke" <bb...@re...> To: res...@li... Sent: Monday, June 10, 2013 2:33:10 PM Subject: Re: [Resteasy-developers] returning JSPs as response Why would you want to deliver JSP pages via Resteasy? Let the servlet container do this. On 6/10/2013 8:21 AM, Gregor Jarisch wrote: > Hi there, > > I am trying to deliver jsp pages via resteasy. After some search in the web it seems to me that there is an option for this in jersey, but not in resteasy. > I am aware that resteasy integrates with seam and spring - but both are too heavy weight to be included only for the sake of delivering simple JSPs. > > I have found an interesting approach: http://code.google.com/p/htmleasy/ > > Simple, small library providing this feature. Unfortunately it doesn't work with resteasy 3.0 (beta-6). > > This class implements the MessageBodyWriter: http://code.google.com/p/htmleasy/source/browse/trunk/src/main/java/com/googlecode/htmleasy/provider/ViewWriter.java > This class includes the jsp: http://code.google.com/p/htmleasy/source/browse/trunk/src/main/java/com/googlecode/htmleasy/View.java > > ...but it ends up in an infinitive recursive stacktrace. > > I know that this is not an resteasy problem - but it would be great to be able to return JSPs without introducing other technologies. > > Can someone take a quick look at those two classes and give me a hint what the problem might be..? > It might be something easy to fix.. > > Second, wouldn't that be something to include into resteasy in a future release? > > Thanks. > > Gregor > > ------------------------------------------------------------------------------ > How ServiceNow helps IT people transform IT departments: > 1. A cloud service to automate IT design, transition and operations > 2. Dashboards that offer high-level views of enterprise services > 3. A single system of record for all IT processes > http://p.sf.net/sfu/servicenow-d2d-j > _______________________________________________ > 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 ------------------------------------------------------------------------------ How ServiceNow helps IT people transform IT departments: 1. A cloud service to automate IT design, transition and operations 2. Dashboards that offer high-level views of enterprise services 3. A single system of record for all IT processes http://p.sf.net/sfu/servicenow-d2d-j _______________________________________________ Resteasy-developers mailing list Res...@li... https://lists.sourceforge.net/lists/listinfo/resteasy-developers |
|
From: Bill B. <bb...@re...> - 2013-06-10 12:37:43
|
Ya, we're not supporting Spring's DeferredResult... You can take a look at the Resteasy Async API (2.3.x) or JAX-RS 2.0's Async API (Resteasy 3.0). Don't think it is exactly the same, but you can probably do what you need here. On 6/9/2013 9:22 PM, Solomon Duskis wrote: > That does seem like an interesting feature. Bill, is there anything > like that DeferedResult in the JAX-RS world? > > Arun: Wouldn't you be able to simply use Spring MVC's REST support for > that instead of RESTEasy? > > -Solomon > > > On Sun, Jun 9, 2013 at 9:03 PM, Arun Avanathan <aru...@gm... > <mailto:aru...@gm...>> wrote: > > Sorry I forgot to mention that. DeferredResult > (http://static.springsource.org/spring/docs/3.2.0.BUILD-SNAPSHOT/api/org/springframework/web/context/request/async/DeferredResult.html) > is Spring's way of handling Servlet 3.0 Async mechanism. I am > marking the method @ResponseBody & returning DeferredResult<T> as > per Spring documentation. This DeferredResult, is being completed by > another thread after completing actual process under the hood. > > > On Sun, Jun 9, 2013 at 5:50 PM, Bill Burke <bb...@re... > <mailto:bb...@re...>> wrote: > > If I knew what a DefferedResult was, I may be able to help you. > > On 6/9/2013 8:40 PM, Arun Avanathan wrote: > > Hi, > > > > I am using a Spring MVC application with resteasy-spring. > > > > I have this simple method, which is throwing an exception > when I call > > HTTP Post on the mapped URI. > > > > I am using JDK 1.7, with Jetty 8, Sevlet 3.0 web.xml. Spring > > - 3.2.3.RELEASE and resteasy-spring-2.3.6.Final. > > > > Do I need to use later versions of Rest easy? > > > > Thanks > > Arun > > > > @POST > > @Consumes({MediaType.APPLICATION_XML, > MediaType.APPLICATION_JSON}) > > @Produces({MediaType.APPLICATION_XML, > MediaType.APPLICATION_JSON}) > > @Path("/print/{realmId}/customer") > > @GZIP > > @ResponseBody > > public DeferredResult<Customer> > printAndEcho(@PathParam("realmId") > > String realmId, > > @QueryParam("requestId") > String requestId, > > Customer customer, > > > @HeaderParam("transport.type") String > > transportType) { > > > > LOGGER.info("realmId={}, requestId={}, transportType={}, > > customer={}", > > new Object[]{realmId, requestId, transportType, > > ToStringBuilder.reflectionToString(customer)}); > > DeferredResult<Customer> result = new > DeferredResult<Customer>(); > > cachedCustomer = customer; > > deferredResultMap.put(realmId+"-"+requestId, result); > > > > return result; > > } > > > > > > Exception : > > > > 2013-06-09 17:24:21,929 WARN > > [org.jboss.resteasy.core.SynchronousDispatcher#error():135] - > Failed > > executing POST /sample/print/253421978/customer > > org.jboss.resteasy.core.NoMessageBodyWriterFoundFailure: > Could not find > > MessageBodyWriter for response object of type: > > org.springframework.web.context.request.async.DeferredResult > of media > > type: application/xml > > at > org.jboss.resteasy.core.ServerResponse.writeTo(ServerResponse.java:216) > > at > org.jboss.resteasy.springmvc.ResteasyView$1.handle(ResteasyView.java:96) > > at > org.jboss.resteasy.springmvc.ResteasyView$1.handle(ResteasyView.java:81) > > at > > > org.jboss.resteasy.springmvc.ResteasyWebHandlerTemplate.handle(ResteasyWebHandlerTemplate.java:39) > > at > org.jboss.resteasy.springmvc.ResteasyView.render(ResteasyView.java:112) > > at > > > org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1208) > > at > > > org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:992) > > at > > > org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:939) > > at > > > org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) > > at > > > org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936) > > at > > > org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:838) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:755) > > at > > > org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) > > at > org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684) > > at > > > org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1448) > > at > net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:163) > > at > > > org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419) > > at > net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:206) > > at > net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:179) > > at > > > org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419) > > at > > > org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455) > > at > > > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137) > > at > > > org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:533) > > at > > > org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231) > > at > > > org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075) > > at > org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384) > > at > > > org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193) > > at > > > org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009) > > at > > > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) > > at > > > org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255) > > at > > > org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154) > > at > > > org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) > > at org.eclipse.jetty.server.Server.handle(Server.java:370) > > at > > > org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489) > > at > > > org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:960) > > at > > > org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1021) > > at > org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865) > > at > org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240) > > at > > > org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82) > > at > > > org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668) > > at > > > org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52) > > at > > > org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) > > at > > > org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) > > at java.lang.Thread.run(Thread.java:722) > > > > > > > > > ------------------------------------------------------------------------------ > > How ServiceNow helps IT people transform IT departments: > > 1. A cloud service to automate IT design, transition and > operations > > 2. Dashboards that offer high-level views of enterprise services > > 3. A single system of record for all IT processes > > http://p.sf.net/sfu/servicenow-d2d-j > > > > > > > > _______________________________________________ > > Resteasy-developers mailing list > > Res...@li... > <mailto:Res...@li...> > > https://lists.sourceforge.net/lists/listinfo/resteasy-developers > > > > -- > Bill Burke > JBoss, a division of Red Hat > http://bill.burkecentral.com > > ------------------------------------------------------------------------------ > How ServiceNow helps IT people transform IT departments: > 1. A cloud service to automate IT design, transition and operations > 2. Dashboards that offer high-level views of enterprise services > 3. A single system of record for all IT processes > http://p.sf.net/sfu/servicenow-d2d-j > _______________________________________________ > Resteasy-developers mailing list > Res...@li... > <mailto:Res...@li...> > https://lists.sourceforge.net/lists/listinfo/resteasy-developers > > > > ------------------------------------------------------------------------------ > How ServiceNow helps IT people transform IT departments: > 1. A cloud service to automate IT design, transition and operations > 2. Dashboards that offer high-level views of enterprise services > 3. A single system of record for all IT processes > http://p.sf.net/sfu/servicenow-d2d-j > _______________________________________________ > Resteasy-developers mailing list > Res...@li... > <mailto: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-10 12:33:18
|
Why would you want to deliver JSP pages via Resteasy? Let the servlet container do this. On 6/10/2013 8:21 AM, Gregor Jarisch wrote: > Hi there, > > I am trying to deliver jsp pages via resteasy. After some search in the web it seems to me that there is an option for this in jersey, but not in resteasy. > I am aware that resteasy integrates with seam and spring - but both are too heavy weight to be included only for the sake of delivering simple JSPs. > > I have found an interesting approach: http://code.google.com/p/htmleasy/ > > Simple, small library providing this feature. Unfortunately it doesn't work with resteasy 3.0 (beta-6). > > This class implements the MessageBodyWriter: http://code.google.com/p/htmleasy/source/browse/trunk/src/main/java/com/googlecode/htmleasy/provider/ViewWriter.java > This class includes the jsp: http://code.google.com/p/htmleasy/source/browse/trunk/src/main/java/com/googlecode/htmleasy/View.java > > ...but it ends up in an infinitive recursive stacktrace. > > I know that this is not an resteasy problem - but it would be great to be able to return JSPs without introducing other technologies. > > Can someone take a quick look at those two classes and give me a hint what the problem might be..? > It might be something easy to fix.. > > Second, wouldn't that be something to include into resteasy in a future release? > > Thanks. > > Gregor > > ------------------------------------------------------------------------------ > How ServiceNow helps IT people transform IT departments: > 1. A cloud service to automate IT design, transition and operations > 2. Dashboards that offer high-level views of enterprise services > 3. A single system of record for all IT processes > http://p.sf.net/sfu/servicenow-d2d-j > _______________________________________________ > 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-10 12:21:58
|
Hi there, I am trying to deliver jsp pages via resteasy. After some search in the web it seems to me that there is an option for this in jersey, but not in resteasy. I am aware that resteasy integrates with seam and spring - but both are too heavy weight to be included only for the sake of delivering simple JSPs. I have found an interesting approach: http://code.google.com/p/htmleasy/ Simple, small library providing this feature. Unfortunately it doesn't work with resteasy 3.0 (beta-6). This class implements the MessageBodyWriter: http://code.google.com/p/htmleasy/source/browse/trunk/src/main/java/com/googlecode/htmleasy/provider/ViewWriter.java This class includes the jsp: http://code.google.com/p/htmleasy/source/browse/trunk/src/main/java/com/googlecode/htmleasy/View.java ...but it ends up in an infinitive recursive stacktrace. I know that this is not an resteasy problem - but it would be great to be able to return JSPs without introducing other technologies. Can someone take a quick look at those two classes and give me a hint what the problem might be..? It might be something easy to fix.. Second, wouldn't that be something to include into resteasy in a future release? Thanks. Gregor |
|
From: Weinan Li <we...@re...> - 2013-06-10 10:26:48
|
Hi, As RESTEasy 3.x is supporting multiple application deployment in Wildfly via @ApplicationPath. Is there any docs/examples that I could follow to learn how to use this feature in a standalone environment? -- Weinan Li |
|
From: Solomon D. <sd...@gm...> - 2013-06-10 01:22:47
|
That does seem like an interesting feature. Bill, is there anything like that DeferedResult in the JAX-RS world? Arun: Wouldn't you be able to simply use Spring MVC's REST support for that instead of RESTEasy? -Solomon On Sun, Jun 9, 2013 at 9:03 PM, Arun Avanathan <aru...@gm...>wrote: > Sorry I forgot to mention that. DeferredResult ( > http://static.springsource.org/spring/docs/3.2.0.BUILD-SNAPSHOT/api/org/springframework/web/context/request/async/DeferredResult.html) > is Spring's way of handling Servlet 3.0 Async mechanism. I am marking > the method @ResponseBody & returning DeferredResult<T> as per Spring > documentation. This DeferredResult, is being completed by another thread > after completing actual process under the hood. > > > On Sun, Jun 9, 2013 at 5:50 PM, Bill Burke <bb...@re...> wrote: > >> If I knew what a DefferedResult was, I may be able to help you. >> >> On 6/9/2013 8:40 PM, Arun Avanathan wrote: >> > Hi, >> > >> > I am using a Spring MVC application with resteasy-spring. >> > >> > I have this simple method, which is throwing an exception when I call >> > HTTP Post on the mapped URI. >> > >> > I am using JDK 1.7, with Jetty 8, Sevlet 3.0 web.xml. Spring >> > - 3.2.3.RELEASE and resteasy-spring-2.3.6.Final. >> > >> > Do I need to use later versions of Rest easy? >> > >> > Thanks >> > Arun >> > >> > @POST >> > @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) >> > @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) >> > @Path("/print/{realmId}/customer") >> > @GZIP >> > @ResponseBody >> > public DeferredResult<Customer> printAndEcho(@PathParam("realmId") >> > String realmId, >> > @QueryParam("requestId") String >> requestId, >> > Customer customer, >> > @HeaderParam("transport.type") String >> > transportType) { >> > >> > LOGGER.info("realmId={}, requestId={}, transportType={}, >> > customer={}", >> > new Object[]{realmId, requestId, transportType, >> > ToStringBuilder.reflectionToString(customer)}); >> > DeferredResult<Customer> result = new >> DeferredResult<Customer>(); >> > cachedCustomer = customer; >> > deferredResultMap.put(realmId+"-"+requestId, result); >> > >> > return result; >> > } >> > >> > >> > Exception : >> > >> > 2013-06-09 17:24:21,929 WARN >> > [org.jboss.resteasy.core.SynchronousDispatcher#error():135] - Failed >> > executing POST /sample/print/253421978/customer >> > org.jboss.resteasy.core.NoMessageBodyWriterFoundFailure: Could not find >> > MessageBodyWriter for response object of type: >> > org.springframework.web.context.request.async.DeferredResult of media >> > type: application/xml >> > at >> org.jboss.resteasy.core.ServerResponse.writeTo(ServerResponse.java:216) >> > at >> org.jboss.resteasy.springmvc.ResteasyView$1.handle(ResteasyView.java:96) >> > at >> org.jboss.resteasy.springmvc.ResteasyView$1.handle(ResteasyView.java:81) >> > at >> > >> org.jboss.resteasy.springmvc.ResteasyWebHandlerTemplate.handle(ResteasyWebHandlerTemplate.java:39) >> > at >> org.jboss.resteasy.springmvc.ResteasyView.render(ResteasyView.java:112) >> > at >> > >> org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1208) >> > at >> > >> org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:992) >> > at >> > >> org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:939) >> > at >> > >> org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) >> > at >> > >> org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936) >> > at >> > >> org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:838) >> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:755) >> > at >> > >> org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812) >> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) >> > at >> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684) >> > at >> > >> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1448) >> > at >> net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:163) >> > at >> > >> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419) >> > at >> net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:206) >> > at >> net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:179) >> > at >> > >> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419) >> > at >> > >> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455) >> > at >> > >> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137) >> > at >> > >> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:533) >> > at >> > >> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231) >> > at >> > >> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075) >> > at >> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384) >> > at >> > >> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193) >> > at >> > >> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009) >> > at >> > >> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) >> > at >> > >> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255) >> > at >> > >> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154) >> > at >> > >> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) >> > at org.eclipse.jetty.server.Server.handle(Server.java:370) >> > at >> > >> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489) >> > at >> > >> org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:960) >> > at >> > >> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1021) >> > at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865) >> > at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240) >> > at >> > >> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82) >> > at >> > >> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668) >> > at >> > >> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52) >> > at >> > >> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) >> > at >> > >> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) >> > at java.lang.Thread.run(Thread.java:722) >> > >> > >> > >> > >> ------------------------------------------------------------------------------ >> > How ServiceNow helps IT people transform IT departments: >> > 1. A cloud service to automate IT design, transition and operations >> > 2. Dashboards that offer high-level views of enterprise services >> > 3. A single system of record for all IT processes >> > http://p.sf.net/sfu/servicenow-d2d-j >> > >> > >> > >> > _______________________________________________ >> > 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 >> >> >> ------------------------------------------------------------------------------ >> How ServiceNow helps IT people transform IT departments: >> 1. A cloud service to automate IT design, transition and operations >> 2. Dashboards that offer high-level views of enterprise services >> 3. A single system of record for all IT processes >> http://p.sf.net/sfu/servicenow-d2d-j >> _______________________________________________ >> Resteasy-developers mailing list >> Res...@li... >> https://lists.sourceforge.net/lists/listinfo/resteasy-developers >> > > > > ------------------------------------------------------------------------------ > How ServiceNow helps IT people transform IT departments: > 1. A cloud service to automate IT design, transition and operations > 2. Dashboards that offer high-level views of enterprise services > 3. A single system of record for all IT processes > http://p.sf.net/sfu/servicenow-d2d-j > _______________________________________________ > Resteasy-developers mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-developers > > |
|
From: Arun A. <aru...@gm...> - 2013-06-10 01:03:11
|
Sorry I forgot to mention that. DeferredResult ( http://static.springsource.org/spring/docs/3.2.0.BUILD-SNAPSHOT/api/org/springframework/web/context/request/async/DeferredResult.html) is Spring's way of handling Servlet 3.0 Async mechanism. I am marking the method @ResponseBody & returning DeferredResult<T> as per Spring documentation. This DeferredResult, is being completed by another thread after completing actual process under the hood. On Sun, Jun 9, 2013 at 5:50 PM, Bill Burke <bb...@re...> wrote: > If I knew what a DefferedResult was, I may be able to help you. > > On 6/9/2013 8:40 PM, Arun Avanathan wrote: > > Hi, > > > > I am using a Spring MVC application with resteasy-spring. > > > > I have this simple method, which is throwing an exception when I call > > HTTP Post on the mapped URI. > > > > I am using JDK 1.7, with Jetty 8, Sevlet 3.0 web.xml. Spring > > - 3.2.3.RELEASE and resteasy-spring-2.3.6.Final. > > > > Do I need to use later versions of Rest easy? > > > > Thanks > > Arun > > > > @POST > > @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) > > @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) > > @Path("/print/{realmId}/customer") > > @GZIP > > @ResponseBody > > public DeferredResult<Customer> printAndEcho(@PathParam("realmId") > > String realmId, > > @QueryParam("requestId") String > requestId, > > Customer customer, > > @HeaderParam("transport.type") String > > transportType) { > > > > LOGGER.info("realmId={}, requestId={}, transportType={}, > > customer={}", > > new Object[]{realmId, requestId, transportType, > > ToStringBuilder.reflectionToString(customer)}); > > DeferredResult<Customer> result = new > DeferredResult<Customer>(); > > cachedCustomer = customer; > > deferredResultMap.put(realmId+"-"+requestId, result); > > > > return result; > > } > > > > > > Exception : > > > > 2013-06-09 17:24:21,929 WARN > > [org.jboss.resteasy.core.SynchronousDispatcher#error():135] - Failed > > executing POST /sample/print/253421978/customer > > org.jboss.resteasy.core.NoMessageBodyWriterFoundFailure: Could not find > > MessageBodyWriter for response object of type: > > org.springframework.web.context.request.async.DeferredResult of media > > type: application/xml > > at > org.jboss.resteasy.core.ServerResponse.writeTo(ServerResponse.java:216) > > at > org.jboss.resteasy.springmvc.ResteasyView$1.handle(ResteasyView.java:96) > > at > org.jboss.resteasy.springmvc.ResteasyView$1.handle(ResteasyView.java:81) > > at > > > org.jboss.resteasy.springmvc.ResteasyWebHandlerTemplate.handle(ResteasyWebHandlerTemplate.java:39) > > at > org.jboss.resteasy.springmvc.ResteasyView.render(ResteasyView.java:112) > > at > > > org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1208) > > at > > > org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:992) > > at > > > org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:939) > > at > > > org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) > > at > > > org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936) > > at > > > org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:838) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:755) > > at > > > org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) > > at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684) > > at > > > org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1448) > > at > net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:163) > > at > > > org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419) > > at > net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:206) > > at > net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:179) > > at > > > org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419) > > at > > > org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455) > > at > > > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137) > > at > > > org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:533) > > at > > > org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231) > > at > > > org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075) > > at > org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384) > > at > > > org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193) > > at > > > org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009) > > at > > > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) > > at > > > org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255) > > at > > > org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154) > > at > > > org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) > > at org.eclipse.jetty.server.Server.handle(Server.java:370) > > at > > > org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489) > > at > > > org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:960) > > at > > > org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1021) > > at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865) > > at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240) > > at > > > org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82) > > at > > > org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668) > > at > > > org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52) > > at > > > org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) > > at > > > org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) > > at java.lang.Thread.run(Thread.java:722) > > > > > > > > > ------------------------------------------------------------------------------ > > How ServiceNow helps IT people transform IT departments: > > 1. A cloud service to automate IT design, transition and operations > > 2. Dashboards that offer high-level views of enterprise services > > 3. A single system of record for all IT processes > > http://p.sf.net/sfu/servicenow-d2d-j > > > > > > > > _______________________________________________ > > 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 > > > ------------------------------------------------------------------------------ > How ServiceNow helps IT people transform IT departments: > 1. A cloud service to automate IT design, transition and operations > 2. Dashboards that offer high-level views of enterprise services > 3. A single system of record for all IT processes > http://p.sf.net/sfu/servicenow-d2d-j > _______________________________________________ > Resteasy-developers mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-developers > |
|
From: Bill B. <bb...@re...> - 2013-06-10 00:50:39
|
If I knew what a DefferedResult was, I may be able to help you.
On 6/9/2013 8:40 PM, Arun Avanathan wrote:
> Hi,
>
> I am using a Spring MVC application with resteasy-spring.
>
> I have this simple method, which is throwing an exception when I call
> HTTP Post on the mapped URI.
>
> I am using JDK 1.7, with Jetty 8, Sevlet 3.0 web.xml. Spring
> - 3.2.3.RELEASE and resteasy-spring-2.3.6.Final.
>
> Do I need to use later versions of Rest easy?
>
> Thanks
> Arun
>
> @POST
> @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
> @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
> @Path("/print/{realmId}/customer")
> @GZIP
> @ResponseBody
> public DeferredResult<Customer> printAndEcho(@PathParam("realmId")
> String realmId,
> @QueryParam("requestId") String requestId,
> Customer customer,
> @HeaderParam("transport.type") String
> transportType) {
>
> LOGGER.info("realmId={}, requestId={}, transportType={},
> customer={}",
> new Object[]{realmId, requestId, transportType,
> ToStringBuilder.reflectionToString(customer)});
> DeferredResult<Customer> result = new DeferredResult<Customer>();
> cachedCustomer = customer;
> deferredResultMap.put(realmId+"-"+requestId, result);
>
> return result;
> }
>
>
> Exception :
>
> 2013-06-09 17:24:21,929 WARN
> [org.jboss.resteasy.core.SynchronousDispatcher#error():135] - Failed
> executing POST /sample/print/253421978/customer
> org.jboss.resteasy.core.NoMessageBodyWriterFoundFailure: Could not find
> MessageBodyWriter for response object of type:
> org.springframework.web.context.request.async.DeferredResult of media
> type: application/xml
> at org.jboss.resteasy.core.ServerResponse.writeTo(ServerResponse.java:216)
> at org.jboss.resteasy.springmvc.ResteasyView$1.handle(ResteasyView.java:96)
> at org.jboss.resteasy.springmvc.ResteasyView$1.handle(ResteasyView.java:81)
> at
> org.jboss.resteasy.springmvc.ResteasyWebHandlerTemplate.handle(ResteasyWebHandlerTemplate.java:39)
> at org.jboss.resteasy.springmvc.ResteasyView.render(ResteasyView.java:112)
> at
> org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1208)
> at
> org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:992)
> at
> org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:939)
> at
> org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
> at
> org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936)
> at
> org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:838)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
> at
> org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
> at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
> at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1448)
> at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:163)
> at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)
> at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:206)
> at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:179)
> at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)
> at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
> at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:533)
> at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075)
> at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384)
> at
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
> at
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
> at
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
> at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
> at org.eclipse.jetty.server.Server.handle(Server.java:370)
> at
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
> at
> org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:960)
> at
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1021)
> at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)
> at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
> at
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
> at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
> at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
> at java.lang.Thread.run(Thread.java:722)
>
>
>
> ------------------------------------------------------------------------------
> How ServiceNow helps IT people transform IT departments:
> 1. A cloud service to automate IT design, transition and operations
> 2. Dashboards that offer high-level views of enterprise services
> 3. A single system of record for all IT processes
> http://p.sf.net/sfu/servicenow-d2d-j
>
>
>
> _______________________________________________
> 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: Arun A. <aru...@gm...> - 2013-06-10 00:40:20
|
Hi,
I am using a Spring MVC application with resteasy-spring.
I have this simple method, which is throwing an exception when I call HTTP
Post on the mapped URI.
I am using JDK 1.7, with Jetty 8, Sevlet 3.0 web.xml. Spring
- 3.2.3.RELEASE and resteasy-spring-2.3.6.Final.
Do I need to use later versions of Rest easy?
Thanks
Arun
@POST
@Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
@Path("/print/{realmId}/customer")
@GZIP
@ResponseBody
public DeferredResult<Customer> printAndEcho(@PathParam("realmId")
String realmId,
@QueryParam("requestId") String requestId,
Customer customer,
@HeaderParam("transport.type") String
transportType) {
LOGGER.info("realmId={}, requestId={}, transportType={},
customer={}",
new Object[]{realmId, requestId, transportType,
ToStringBuilder.reflectionToString(customer)});
DeferredResult<Customer> result = new DeferredResult<Customer>();
cachedCustomer = customer;
deferredResultMap.put(realmId+"-"+requestId, result);
return result;
}
Exception :
2013-06-09 17:24:21,929 WARN
[org.jboss.resteasy.core.SynchronousDispatcher#error():135] - Failed
executing POST /sample/print/253421978/customer
org.jboss.resteasy.core.NoMessageBodyWriterFoundFailure: Could not find
MessageBodyWriter for response object of type:
org.springframework.web.context.request.async.DeferredResult of media type:
application/xml
at org.jboss.resteasy.core.ServerResponse.writeTo(ServerResponse.java:216)
at org.jboss.resteasy.springmvc.ResteasyView$1.handle(ResteasyView.java:96)
at org.jboss.resteasy.springmvc.ResteasyView$1.handle(ResteasyView.java:81)
at
org.jboss.resteasy.springmvc.ResteasyWebHandlerTemplate.handle(ResteasyWebHandlerTemplate.java:39)
at org.jboss.resteasy.springmvc.ResteasyView.render(ResteasyView.java:112)
at
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1208)
at
org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:992)
at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:939)
at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936)
at
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:838)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
at
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1448)
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:163)
at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:206)
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:179)
at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)
at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
at
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:533)
at
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384)
at
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
at
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
at
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:370)
at
org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
at
org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:960)
at
org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1021)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
at
org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
at
org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
at
org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
at java.lang.Thread.run(Thread.java:722)
|
|
From: Bill B. <bb...@re...> - 2013-06-09 14:57:28
|
You have one week to report any bugs or commit anything before 3.0.Final goes out the door. -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |
|
From: Solomon D. <sd...@gm...> - 2013-06-05 12:12:43
|
IMHO, you're on the right track with this thought. To do this, you have to create a custom MessageBodyWriter + renderer. I've been working on something like this for a while now: https://github.com/skyscreamer/yoga. There's a lot of great use cases for this type of technology, as well as a handful of other implementations. -Solomon On Wed, Jun 5, 2013 at 12:49 AM, Jean Morissette <jea...@gm...>wrote: > Hi devs, > > Let's say we have a graph of many JPA entities that we would like to > expose as REST resources. > > Since the graph is pretty big, we want to send only small subgraphs at > time, allowing the user to navigate in the graph using links (HATEOAS). > > How would you implement this scenario? > > > > I have sketched a solution and I would really appreciate your comments on > it. > > - Create a class annotation @Summarizable and a field annotation @Summary. > > - Modify the behavior of the marshaller to break the graph in subgraph > where @Summarizable classes are found. > > - Except the root of the marshalled graph, when the marchaller encounters > an object marked as Summarizable, it would marshall only its fields marked > Summary and add a link to retrieve the full object. > > > Is-it something doable? Do you have a better solution? > > Regards, > Jean > > > > > > > > > ------------------------------------------------------------------------------ > How ServiceNow helps IT people transform IT departments: > 1. A cloud service to automate IT design, transition and operations > 2. Dashboards that offer high-level views of enterprise services > 3. A single system of record for all IT processes > http://p.sf.net/sfu/servicenow-d2d-j > _______________________________________________ > Resteasy-developers mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-developers > > |
|
From: Jean M. <jea...@gm...> - 2013-06-05 04:49:37
|
Hi devs, Let's say we have a graph of many JPA entities that we would like to expose as REST resources. Since the graph is pretty big, we want to send only small subgraphs at time, allowing the user to navigate in the graph using links (HATEOAS). How would you implement this scenario? I have sketched a solution and I would really appreciate your comments on it. - Create a class annotation @Summarizable and a field annotation @Summary. - Modify the behavior of the marshaller to break the graph in subgraph where @Summarizable classes are found. - Except the root of the marshalled graph, when the marchaller encounters an object marked as Summarizable, it would marshall only its fields marked Summary and add a link to retrieve the full object. Is-it something doable? Do you have a better solution? Regards, Jean |
|
From: Timothy L. <ma...@ya...> - 2013-06-04 20:59:16
|
I've developed a RestEasy resource with multiple methods all executed via HTTP GET and with very similar method signatures (See below for an example). The problem that I'm having is that I am attempting to get RestEasy to call the method with the Integer minute parameter using "?minutes=5" and RestEasy calls the method with fromDate and toDate params. Does RestEasy not handle these types of methods properly? I'm using RestEasy 2.2.0.GA.
Thanks,
Tim
Example:
@AddLinks
@LinkResource(value=Message.class)
@GET
@Produces("application/json")
List<Message> getMessages(@QueryParam("fromDate") String fromDate, @QueryParam("toDate") String toDate);
@AddLinks
@LinkResource(value=Message.class)
@GET
@Produces("application/json")
List<Message> getMessages(@QueryParam("minutes") Integer minutes);
@AddLinks
@LinkResource(value=Message.class)
@GET
@Produces("application/json")
List<Message> getMessages(@QueryParam("msgType") String msgType);
|
|
From: Brian M. <bri...@gm...> - 2013-06-03 15:44:33
|
I've fought CORS stuff too with RestEasy. I ended up with a ServletFilter in front of RestEasy that gobbles up the OPTIONS calls. On Jun 3, 2013, at 10:30 AM, Bill Burke <bb...@re...> wrote: > > > On 6/2/2013 12:08 AM, Patrick Bakker wrote: >> I'm having a lot of trouble trying to set the appropriate CORS headers >> from a browser OPTIONS request. >> I'm trying to POST a form using the browser FormData and the browser is >> calling server-side with OPTIONS before it does the POST: >> >> I'm calling a URL of the form: >> >> http://host/myapplication/import/list >> >> Where I know RESTEasy is handling all paths underneath myapplication >> since I have other GETmethods that work properly. >> When I send my POSTed FormData from browser the browser requests the URL >> http://host/myapplication/import/list with an HTTP method of OPTIONS and >> I get this exception server-side: >> >> Failed executing OPTIONS /import/list: >> org.jboss.resteasy.spi.DefaultOptionsMethodException: No resource method >> found for options, return OK with Allow header >> > > This isn't a failure. This exception implements the default OPTIONS > behavior if there is no method supporting @OPTIONS > >> --- --- >> >> Here are the questions I'm trying to answer followed by a detailed >> breakdown of what I'm currently trying: >> >> 1. Is there a recommended way to handle CORS request that is a >> "standard" part of REST Easy? > > We have nothing. If you have suggestions, please detail it in a JIRA so > we can implement it. Or contribute it if you have time. > >> 2. Why doesn't my PostProcessInterceptor work for OPTIONS methods? > > I assume you are on 2.3.x? This is because PostProcessorInterceptor > does not get called when there is an exception. Write an > ExceptionMapper for DefaultOptionsMethodException. > >> 3. Is it possible to make a single handler for any OPTIONS method for >> any path? (I thought my @Path mapping below might do it ...) > > Write an ExceptionMapper for DefaultOptionsMethodException. > >> 4. Not that it is a great solution to my CORS issue, but why doesn't my >> ExceptionMapper get called? >> > > Don't know. The ExceptionMapper should work. If this is a Resteasy 3.x > problem, then report a JIRA and we can get to it in the next couple of > days/weeks. For 2.3.x problems, sorry, but we're 100% focused on > getting Resteasy 3.0 out for the next few months and we're only fixing > customer problems for 2.3.x. > > > -- > Bill Burke > JBoss, a division of Red Hat > http://bill.burkecentral.com > > ------------------------------------------------------------------------------ > Get 100% visibility into Java/.NET code with AppDynamics Lite > It's a free troubleshooting tool designed for production > Get down to code-level detail for bottlenecks, with <2% overhead. > Download for free and get started troubleshooting in minutes. > http://p.sf.net/sfu/appdyn_d2d_ap2 > _______________________________________________ > Resteasy-developers mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-developers |