struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Watson (JIRA)" <j...@apache.org>
Subject [jira] Commented: (WW-2673) Returns 500 for a non-existent resource, should return 404
Date Fri, 13 Jun 2008 02:25:05 GMT

    [ https://issues.apache.org/struts/browse/WW-2673?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44123#action_44123
] 

Michael Watson commented on WW-2673:
------------------------------------

Because I'd mis-configured it. I now have it working by having a get method like this, and
no longer get a 500:
  public HttpHeaders fetch()
  {
    DefaultHttpHeaders result = new DefaultHttpHeaders("fetch");
    if (null == model)
    {
      result.withStatus(HttpServletResponse.SC_NOT_FOUND);
    }
    return result;
  }


> Returns 500 for a non-existent resource, should return 404
> ----------------------------------------------------------
>
>                 Key: WW-2673
>                 URL: https://issues.apache.org/struts/browse/WW-2673
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - REST
>    Affects Versions: 2.1.2
>         Environment: WAS 6.1 on WinXP64
>            Reporter: Michael Watson
>            Priority: Trivial
>             Fix For: 2.1.3
>
>
> When I request an existing object via the REST plugin it is returned ok. However, requesting
a non-existent resource should return a 404 (page not found) to be truly REST-ful. What I
get instead is a 500 error and this not very helpful stack trace:
> [9/06/08 09:32:00:553 NZST] 0000001f WebApp        E   [Servlet Error]-[<null>]:
com.ibm.ws.webcontainer.webapp.WebAppErrorReport: 
> 	at com.ibm.ws.webcontainer.webapp.WebAppDispatcherContext.sendError(WebAppDispatcherContext.java:538)
> 	at com.ibm.ws.webcontainer.srt.SRTServletResponse.sendError(SRTServletResponse.java:967)
> 	at org.apache.struts2.dispatcher.Dispatcher.sendError(Dispatcher.java:725)
> 	at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)
> 	at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:467)
> 	at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
> 	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
> 	at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
> 	at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:768)
> 	at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:676)
> 	at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:691)
> 	at com.ibm.ws.wswebcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:118)
> 	at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.invokeFilters(DefaultExtensionProcessor.java:791)
> 	at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:741)
> 	at com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:113)
> 	at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3276)
> 	at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267)
> 	at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
> 	at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1455)
> 	at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:113)
> 	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454)
> 	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:383)
> 	at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
> 	at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
> 	at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
> 	at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
> 	at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
> 	at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
> 	at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
> 	at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
> 	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
> The problem seems to be that nothing goes on to the valuestack (correctly since the resource
doesn't exist) but whatever is trying to read from the valuestack barfs because it's empty.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message