Error in Undertow when accessing Resteasy WS annotated with @Cache and @GZIP
ivan.aguirre Jul 18, 2014 2:58 PMI'm facing the following error in WildFly-8.1.0 when I try to access a REST web service implemented with Resteasy and annotated with @Cache and @GZIP:
14:09:47,354 ERROR [io.undertow.request] (default task-11) Blocking request failed HttpServerExchange{ GET /server/api/commercialStructures/listGeoRegions}: java.lang.RuntimeException: io.undertow.server.TruncatedResponseException
at io.undertow.servlet.spec.HttpServletResponseImpl.responseDone(HttpServletResponseImpl.java:527)
at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:287)
at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227)
at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73)
at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:146)
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:177)
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:727)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_51]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_51]
at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_51]
Caused by: io.undertow.server.TruncatedResponseException
at io.undertow.server.protocol.http.HttpResponseConduit.truncateWrites(HttpResponseConduit.java:667)
at io.undertow.conduits.AbstractFixedLengthStreamSinkConduit.terminateWrites(AbstractFixedLengthStreamSinkConduit.java:230)
at org.xnio.conduits.ConduitStreamSinkChannel.shutdownWrites(ConduitStreamSinkChannel.java:178) [xnio-api-3.2.2.Final.jar:3.2.2.Final]
at io.undertow.channels.DetachableStreamSinkChannel.shutdownWrites(DetachableStreamSinkChannel.java:60)
at io.undertow.servlet.spec.ServletOutputStreamImpl.close(ServletOutputStreamImpl.java:624)
at io.undertow.servlet.spec.HttpServletResponseImpl.closeStreamAndWriter(HttpServletResponseImpl.java:451)
at io.undertow.servlet.spec.HttpServletResponseImpl.responseDone(HttpServletResponseImpl.java:525)
... 9 more
Bellow is my service code:
import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
import static javax.ws.rs.core.MediaType.APPLICATION_XML;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import org.jboss.resteasy.annotations.GZIP;
import org.jboss.resteasy.annotations.cache.Cache;
@GZIP
@Cache
@Path("/commercialStructures")
@ApplicationScoped
public class CommercialStructureResource extends
@GET
@Path("/listGeoRegions")
@Produces(value = { APPLICATION_XML, APPLICATION_JSON })
public List<GeographicRegion> listByParentId(@QueryParam("parentId") Long parentId) {
(...)
I've found a similiar problem, but according to report it is supposed to be resolved:
[WFLY-2699] liferay portal does not work - JBoss Issue Tracker
I'm still investigating and I may have more details soon... my suspicious is some bug due @GZIP and @Cache annotations.
Do you have some highlights on this issue?
Thanks in advance!!