You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@shindig.apache.org by "Janusz Dziemidowicz (JIRA)" <ji...@apache.org> on 2010/09/10 14:30:40 UTC

[jira] Commented: (SHINDIG-1425) HTTP HEAD support broken when shindig.http.client.max-object-size-bytes is set to something other than zero

    [ https://issues.apache.org/jira/browse/SHINDIG-1425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12907998#action_12907998 ] 

Janusz Dziemidowicz commented on SHINDIG-1425:
----------------------------------------------

Problem is in BasicHttpFetcher.makeResponse():
{noformat}
// ...
HttpEntity entity = response.getEntity();

if (maxObjSize > 0 && entity.getContentLength() > maxObjSize) {
  return HttpResponse.badrequest("Exceeded maximum number of bytes - " + maxObjSize);
}
// ..
{noformat}
In case of HEAD method, entity will be null, causing above to throw NullPointerException in case maxObjSize is set to something other than zero.


> HTTP HEAD support broken when shindig.http.client.max-object-size-bytes is set to something other than zero
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: SHINDIG-1425
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1425
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: 2.0.0
>            Reporter: Janusz Dziemidowicz
>
> After setting shindig.http.client.max-object-size-bytes in shindig.properties to something other than zero, HTTP HEAD method no longer works (for example when trying to use osapi.http.head). Stack trace:
> {noformat}
> 2010-09-10 14:07:34 org.apache.shindig.protocol.ApiServlet responseItemFromException
> INFO: Returning a response error as result of a protocol exception
> org.apache.shindig.protocol.ProtocolException: java.lang.NullPointerException
> 	at org.apache.shindig.gadgets.servlet.HttpRequestHandler.execute(HttpRequestHandler.java:239)
> 	at org.apache.shindig.gadgets.servlet.HttpRequestHandler.head(HttpRequestHandler.java:143)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.apache.shindig.protocol.DefaultHandlerRegistry$MethodCaller.call(DefaultHandlerRegistry.java:483)
> 	at org.apache.shindig.protocol.DefaultHandlerRegistry$RpcInvocationHandler.execute(DefaultHandlerRegistry.java:301)
> 	at org.apache.shindig.protocol.DefaultHandlerRegistry$RpcInvocationWrapper.execute(DefaultHandlerRegistry.java:325)
> 	at org.apache.shindig.protocol.JsonRpcServlet.dispatchBatch(JsonRpcServlet.java:185)
> 	at org.apache.shindig.protocol.JsonRpcServlet.service(JsonRpcServlet.java:130)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> 	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
> 	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
> 	at org.apache.shindig.auth.AuthenticationServletFilter.callChain(AuthenticationServletFilter.java:124)
> 	at org.apache.shindig.auth.AuthenticationServletFilter.doFilter(AuthenticationServletFilter.java:87)
> 	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
> 	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
> 	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
> 	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
> 	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
> 	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:440)
> 	at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
> 	at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
> 	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> 	at org.mortbay.jetty.Server.handle(Server.java:326)
> 	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
> 	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943)
> 	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
> 	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
> 	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
> 	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
> 	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
> Caused by: org.apache.shindig.gadgets.GadgetException: java.lang.NullPointerException
> 	at org.apache.shindig.gadgets.http.BasicHttpFetcher.fetch(BasicHttpFetcher.java:378)
> 	at org.apache.shindig.gadgets.http.DefaultRequestPipeline.execute(DefaultRequestPipeline.java:89)
> 	at org.apache.shindig.gadgets.servlet.HttpRequestHandler.execute(HttpRequestHandler.java:221)
> 	... 32 more
> Caused by: java.lang.NullPointerException
> 	at org.apache.shindig.gadgets.http.BasicHttpFetcher.makeResponse(BasicHttpFetcher.java:464)
> 	at org.apache.shindig.gadgets.http.BasicHttpFetcher.fetch(BasicHttpFetcher.java:364)
> 	... 34 more
> {noformat}

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