From jira-events at lists.jboss.org Wed May 29 18:43:55 2013 Content-Type: multipart/mixed; boundary="===============0796473251042354929==" MIME-Version: 1.0 From: Aslak Knutsen (JIRA) To: jboss-jira at lists.jboss.org Subject: [jboss-jira] [JBoss JIRA] (WFLY-1419) Overrides REST Response Object on Status 404 Date: Wed, 29 May 2013 18:43:54 -0400 Message-ID: In-Reply-To: JIRA.12493155.1369860138000@jira02.app.mwc.hst.phx2.redhat.com --===============0796473251042354929== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable [ https://issues.jboss.org/browse/WFLY-1419?page=3Dcom.atlassian.jira.p= lugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D12777995#co= mment-12777995 ] = Aslak Knutsen commented on WFLY-1419: ------------------------------------- Sorry, the wire log above was from the JBoss AS 7.1.1 run. This is from Wil= dFly 8.0.0.Alpha1 {code} DEBUG [org.apache.http.wire] >> "GET /1f7e7eba-2f16-46d1-a09a-cb8b8e451e04/= api/conference/2cd3caea-e488-4536-ad88-2eef3f9ad3c8 HTTP/1.1[\r][\n]" DEBUG [org.apache.http.wire] >> "Accept: */*[\r][\n]" DEBUG [org.apache.http.wire] >> "Host: 127.0.0.1:8080[\r][\n]" DEBUG [org.apache.http.wire] >> "Connection: Keep-Alive[\r][\n]" DEBUG [org.apache.http.wire] >> "Accept-Encoding: gzip,deflate[\r][\n]" DEBUG [org.apache.http.wire] >> "[\r][\n]" DEBUG [org.apache.http.wire] << "HTTP/1.1 404 Not Found[\r][\n]" DEBUG [org.apache.http.wire] << "Connection: keep-alive[\r][\n]" DEBUG [org.apache.http.wire] << "Content-Type: application/vnd.ced+xml; typ= e=3Dconference[\r][\n]" DEBUG [org.apache.http.wire] << "Content-Length: 74[\r][\n]" DEBUG [org.apache.http.wire] << "[\r][\n]" DEBUG [org.apache.http.wire] << "Error404 - Not Found" HTTP/1.1 404 Not Found Connection=3Dkeep-alive Content-Type=3Dapplication/vnd.ced+xml; type=3Dconference Content-Length=3D74 Error 404 - Not Found {code} Seems to be coming from this: = https://github.com/undertow-io/undertow/blob/master/core/src/main/java/io/u= ndertow/server/handlers/error/SimpleErrorPageHandler.java = > Overrides REST Response Object on Status 404 > -------------------------------------------- > > Key: WFLY-1419 > URL: https://issues.jboss.org/browse/WFLY-1419 > Project: WildFly > Issue Type: Bug > Components: Web (Undertow) > Affects Versions: 8.0.0.Alpha1 > Environment: JBoss AS 7.1.1, JBoss EAP 6.1.0, WildFly 8.0.0.Alpha1 > Linux, Java 1.7 > Reporter: Aslak Knutsen > Assignee: Stuart Douglas > > *Given*: > {code:title=3DJAX-RS Resource Code} > @Path("/conference") > public class ConferenceResource implements Resource { > private static final String BASE_MEDIA_TYPE =3D "application/vnd.ced+= xml"; > private static final String CONFERENCE_MEDIA_TYPE =3D BASE_MEDIA_TYPE= + ";type=3Dconference"; > private static final String SESSION_MEDIA_TYPE =3D BASE_MEDIA_TYPE + = ";type=3Dsession"; > ... > @GET > @Path("/{id}") > @Produces("application/vnd.ced+xml") > public Response get(@PathParam("id") String id) { > Conference conference =3D repository.get(id); > if(conference =3D=3D null) { > return Response.status(Status.NOT_FOUND).type(CONFERENCE_MEDI= A_TYPE).build(); > } > return Response.ok( > new ConferenceRepresentation(conference, uriInfo.getAbsol= utePathBuilder())) > .type(CONFERENCE_MEDIA_TYPE).build(); > } > ... > } > {code} > *Then*: > The Body and MediaType is overwritten by the WebContainer and standard te= xt/html Error Page is returned. = > {code:title=3DWire Log} > DEBUG [org.apache.http.wire] >> "GET /c5b53d1f-e6fd-40a2-8656-2e36e7e9299= 7/api/conference/d4c6bdb2-51a0-44f8-99bc-75a18ee76228 HTTP/1.1[\r][\n]" > DEBUG [org.apache.http.wire] >> "Accept: application/vnd.ced+xml;type=3Dc= onference[\r][\n]" > DEBUG [org.apache.http.wire] >> "Host: 127.0.0.1:8080[\r][\n]" > DEBUG [org.apache.http.wire] >> "Connection: Keep-Alive[\r][\n]" > DEBUG [org.apache.http.wire] >> "Accept-Encoding: gzip,deflate[\r][\n]" > DEBUG [org.apache.http.wire] >> "[\r][\n]" > DEBUG [org.apache.http.wire] << "HTTP/1.1 200 OK[\r][\n]" > DEBUG [org.apache.http.wire] << "Server: Apache-Coyote/1.1[\r][\n]" > DEBUG [org.apache.http.wire] << "Content-Type: application/vnd.ced+xml;ty= pe=3Dconference[\r][\n]" > DEBUG [org.apache.http.wire] << "Content-Length: 422[\r][\n]" > DEBUG [org.apache.http.wire] << "Date: Wed, 29 May 2013 02:54:22 GMT[\r][= \n]" > DEBUG [org.apache.http.wire] << "[\r][\n]" > DEBUG [org.apache.http.wire] << "2013-05-29T04:54:22.213+02:00= Test2013-05-29T04:54:22.213+02:00Tagline" > DEBUG [org.apache.http.wire] >> "DELETE /c5b53d1f-e6fd-40a2-8656-2e36e7e9= 2997/api/conference/d4c6bdb2-51a0-44f8-99bc-75a18ee76228 HTTP/1.1[\r][\n]" > DEBUG [org.apache.http.wire] >> "Accept: */*[\r][\n]" > DEBUG [org.apache.http.wire] >> "Content-Length: 0[\r][\n]" > DEBUG [org.apache.http.wire] >> "Host: 127.0.0.1:8080[\r][\n]" > DEBUG [org.apache.http.wire] >> "Connection: Keep-Alive[\r][\n]" > DEBUG [org.apache.http.wire] >> "Accept-Encoding: gzip,deflate[\r][\n]" > DEBUG [org.apache.http.wire] >> "[\r][\n]" > DEBUG [org.apache.http.wire] << "HTTP/1.1 204 No Content[\r][\n]" > DEBUG [org.apache.http.wire] << "Server: Apache-Coyote/1.1[\r][\n]" > DEBUG [org.apache.http.wire] << "Date: Wed, 29 May 2013 02:55:44 GMT[\r][= \n]" > DEBUG [org.apache.http.wire] << "[\r][\n]" > DEBUG [org.apache.http.wire] >> "GET /c5b53d1f-e6fd-40a2-8656-2e36e7e9299= 7/api/conference/d4c6bdb2-51a0-44f8-99bc-75a18ee76228 HTTP/1.1[\r][\n]" > DEBUG [org.apache.http.wire] >> "Accept: application/vnd.ced+xml;type=3Dc= onference[\r][\n]" > DEBUG [org.apache.http.wire] >> "Host: 127.0.0.1:8080[\r][\n]" > DEBUG [org.apache.http.wire] >> "Connection: Keep-Alive[\r][\n]" > DEBUG [org.apache.http.wire] >> "Accept-Encoding: gzip,deflate[\r][\n]" > DEBUG [org.apache.http.wire] >> "[\r][\n]" > DEBUG [org.apache.http.wire] << "HTTP/1.1 404 Not Found[\r][\n]" > DEBUG [org.apache.http.wire] << "Server: Apache-Coyote/1.1[\r][\n]" > DEBUG [org.apache.http.wire] << "Content-Type: text/html;charset=3Dutf-8[= \r][\n]" > DEBUG [org.apache.http.wire] << "Content-Length: 956[\r][\n]" > DEBUG [org.apache.http.wire] << "Date: Wed, 29 May 2013 02:55:45 GMT[\r][= \n]" > DEBUG [org.apache.http.wire] << "[\r][\n]" > DEBUG [org.apache.http.wire] << "JBoss Web/7.0.13.Fina= l - Error report

HTTP Status 404 -

type Status report

messa= ge

description The requested resource () is not= available.


JBoss Web/7.0.13.= Final

" > HTTP/1.1 404 Not Found > Server=3DApache-Coyote/1.1 > Content-Type=3Dtext/html;charset=3Dutf-8 > Content-Length=3D956 > Date=3DWed, 29 May 2013 02:55:45 GMT > > > > JBoss Web/7.0.13.Final - Error report > > > > >

> HTTP Status 404 - >

>
>

> > type > > Status report >

>

> > message > > >

>

> > description > > > The requested resource () is not available. > >

>
>

> JBoss Web/7.0.13.Final >

> > > {code} > *Expected*: Return the JAX-RS Response Object as defined by the JAX-RS Se= rvice. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs For more information on JIRA, see: http://www.atlassian.com/software/jira --===============0796473251042354929==--