freme-project / e-Entity

Apache License 2.0
1 stars 1 forks source link

Spotlight: NullPointerException #40

Closed ghsnd closed 8 years ago

ghsnd commented 8 years ago

When sending a request with plain text as input and give json-ld as informat (which is wrong of course), a 500 Internal Server Error occurs.

Example:

curl -vX POST "http://api-dev.freme-project.eu/current/e-entity/dbpedia-spotlight/documents?input=test&informat=json-ld&outformat=turtle&numLinks=1&language=n&confidence=0.3"

gives

{
   "timestamp": 1440679324615,
   "error": "Internal Server Error",
   "status": 500,
   "exception": "java.lang.NullPointerException",
   "path": "/e-entity/dbpedia-spotlight/documents"
}

because in the code, a body is expected for json-ld contents (DBpediaSpotlight.java:100). Maybe the error message can be more informative.

m1ci commented 8 years ago

should be fixed now, bellow is an example of an error sent:

{
  "timestamp": 1441020243229,
  "message": "No content in the body of the response.",
  "error": "Bad Request",
  "status": 400,
  "exception": "eu.freme.eservices.eentity.exceptions.BadRequestException",
  "path": "/e-entity/dbpedia-spotlight/documents"
}
ghsnd commented 8 years ago

Fixed!