EEXCESS / eexcess

This is the EEXCESS main repository bringing togehter the different sub-projects and providing the documentation in the Wiki. Its the starting point when you want to know more about the project.
http://eexcess.eu/
5 stars 2 forks source link

Typo in JSON-Object leads to a crash of the PP #13

Closed pstoehr closed 8 years ago

pstoehr commented 8 years ago

A typo in a key of a JSON-Object leads to crash of the server.

Example for incorrect JSON-Object that leads to a crash let jsonObject : [String:AnyObject] = [ "origin":["clientType" : "Swift-Test-Client", "clientVersion" : "0.21", "module" : "OS X Prototype", "userID" : "PDPS-WS2015"], "gender" : "male", "numresults":10, "contextKeywords": [["text" : "(recommendation.stringValue)"]] ]

"numresults" is a typo, "numResult" is the correct spelling for the key-word.

Endpoint: https://eexcess-dev.joanneum.at/eexcess-privacy-proxy-issuer-1.0-SNAPSHOT/issuer/recommend

Apache Tomcat/7.0.47 - Error report

HTTP Status 500 -


type Exception report

message

description The server encountered an internal error that prevented it from fulfilling this request.

exception

java.lang.NullPointerException
    eu.eexcess.insa.Issuer.getRecommendations(Issuer.java:93)
    sun.reflect.GeneratedMethodAccessor292.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    java.lang.reflect.Method.invoke(Unknown Source)
    com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
    com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
    com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
    com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
    com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
    com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
    com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
    com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
    com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)
    com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)
    com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
    com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
    com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
    com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)
    com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.47 logs.


Apache Tomcat/7.0.47

chseifert commented 8 years ago

updated doc in https://github.com/EEXCESS/eexcess/wiki/%5Bcurrent%5D--Request-and-Response-format-for-call-to-federated-recommender-and-privacy-proxy (typo would still lead to a crash, but that seems reasonable, as this has to be found during development)