[
https://issues.apache.org/jira/browse/SHINDIG-1232?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12782817#action_12782817
]
Alec Kotovich commented on SHINDIG-1232:
----------------------------------------
For instance, here is a code where NPE appears:
162: servletResponse.setContentType(converter.getContentType());
converter is null, so lets go deeper...
It means, getConverterForRequest(servletRequest); return null, =>
214: (contentType != null) //yes, correct, it equals "text/html;
charset=iso-8859-1" =>
and ... oops! (I have found it) = NO CONTENT TYPE "text/html" is defined in
org.apache.shindig.protocol.ContentTypes! :
public static final Set<String> ALLOWED_JSON_CONTENT_TYPES =
ImmutableSet.of("application/json", "text/x-json",
"application/javascript",
"application/x-javascript", "text/javascript", "text/ecmascript",
"application/json-rpc", "application/jsonrequest"); - NO
public static final Set<String> ALLOWED_ATOM_CONTENT_TYPES =
ImmutableSet.of("application/atom+xml"); - NO
public static final Set<String> ALLOWED_XML_CONTENT_TYPES =
ImmutableSet.of("text/xml", "application/xml");
Guys, pls take care, "text/html" should be added, otherwise GWT applications
will not be able to communicate with rest via GET requests
IMHO!...
> NPE in DataServiceServlet.handleSingleRequest
> ---------------------------------------------
>
> Key: SHINDIG-1232
> URL: https://issues.apache.org/jira/browse/SHINDIG-1232
> Project: Shindig
> Issue Type: Bug
> Components: Java
> Affects Versions: 1.1-BETA5
> Environment: Windiws XP;Jetty;Mozilla Firefox 3; GWT 1.7.1
> Reporter: Alec Kotovich
>
> NPE in DataServiceServlet.handleSingleRequest
> When not from browser, but from GWT client module (via Request response =
> builder.sendRequest(null,
> new RequestCallback()) I am trying to
> access GET url 'social/rest/people/canonical/@friends?format=xml', i get this
> NPE and status code is returned: 500, as follows:
> OAuth realm="shindig"
> Content-Type text/html; charset=iso-8859-1
> Content-Length 5848
> Server Jetty(6.1.21)
> Заголовки запроса
> Host localhost:8090
> User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.15)
> Gecko/2009101601 Firefox/3.0.15 (.NET CLR 3.5.30729)
> Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
> Accept-Language ru,en-us;q=0.7,en;q=0.3
> Accept-Encoding gzip,deflate
> Accept-Charset windows-1251,utf-8;q=0.7,*;q=0.7
> Keep-Alive 300
> Connection keep-alive
> Content-Type text/plain; charset=utf-8
> Referer
> http://localhost:8090/xxx-webapp/usermodule/3B179AC54BC137C54C4EFFD45D94E80C.cache.html
> Cookie JSESSIONID=5fruorpfavnn
> Stacktrace:
> java.lang.NullPointerException
> at
> org.apache.shindig.protocol.DataServiceServlet.handleSingleRequest(Da
> taServiceServlet.java:162)
> at
> org.apache.shindig.protocol.DataServiceServlet.executeRequest(DataSer
> viceServlet.java:108)
> at
> org.apache.shindig.protocol.DataServiceServlet.doGet(DataServiceServl
> et.java:53)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511
> )
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.