[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openejb-user
Subject:    Re: JCache with javax.ws.rs.core.Response
From:       Romain Manni-Bucau <rmannibucau () gmail ! com>
Date:       2015-12-04 7:15:32
Message-ID: CACLE=7NANxA9biunx+qH7MNHJaSAFyZSgw2sY9b1bgjxhD7kyg () mail ! gmail ! com
[Download RAW message or body]


Why not returning a dto then? Errors can throw WebApplicationException so
only advantage or Response is for custom http status and headers which is
not always the default depznding your design.

Not sure JAXRS planned anything bit CXF has a JCache integration based on
HTTP Cache. If you check the impl you will understand why it doesnt really
match JCache out of the box.
Le 4 déc. 2015 00:20, "Steve Goldsmith" <sgjava@gmail.com> a écrit :

> Right, so it sounds like the service method needs to call another annotated
> method, thus the DTO (which is serializable) will be cached, not the
> response. Is there something planned in JAX-RS maybe to support this? It
> seems like something that would be a common requirement.
>
> On Thu, Dec 3, 2015 at 5:22 PM, Romain Manni-Bucau <rmannibucau@gmail.com>
> wrote:
>
> > Not returning response and or cache in next app layer. Alternative is to
> > wrap the response in a serialisable one in an interceptor but a response
> is
> > not a simple dto so doesnt sound the easiest with not a lot of benefits.
> > Le 3 déc. 2015 23:15, "sgjava" <sgjava@gmail.com> a écrit :
> >
> > > I'm trying to cache a JAX-RS Response using
> > >
> > >     @Path("/somepath")
> > >     @POST
> > >     @CacheResult(cacheName = "customerSTBData", cacheKeyGenerator
> > >             = CustStbDtoKeyGenerator.class)
> > >     public Response getCustomerSTBData(final CustStbDto custStbDto)
> > >
> > > And I'm getting:
> > >
> > > Caused by:
> > com.hazelcast.nio.serialization.HazelcastSerializationException:
> > > There is no suitable serializer for class
> > > org.apache.cxf.jaxrs.impl.ResponseImpl
> > >
> > > This is usually caused by not having a default constructor which
> Response
> > > doesn't:
> > >
> > >     protected Response() {
> > >     }
> > >
> > > Is there a simple solution to this?
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://tomee-openejb.979440.n4.nabble.com/JCache-with-javax-ws-rs-core-Response-tp4677129.html
> > > Sent from the TomEE Users mailing list archive at Nabble.com.
> > >
> >
>
>
>
> --
> Steven P. Goldsmith
>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic