Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error from example code #2

Open
amrapalijz opened this issue Oct 29, 2015 · 1 comment
Open

Error from example code #2

amrapalijz opened this issue Oct 29, 2015 · 1 comment

Comments

@amrapalijz
Copy link

When I run the example at: https://github.com/ncbo/ncbo_rest_sample_code/blob/master/java/src/AnnotateText.java
I get the error
java.io.FileNotFoundException: http://data.bioontology.org/ontologies/MP/classes/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FMPATH_359
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1835)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1440)
at AnnotateText.get(AnnotateText.java:96)
at AnnotateText.printAnnotations(AnnotateText.java:49)
at AnnotateText.main(AnnotateText.java:26)
com.fasterxml.jackson.databind.JsonMappingException: No content to map due to end-of-input
at [Source: java.io.StringReader@30c7da1e; line: 1, column: 1]
at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:164)
at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:2836)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:2778)
at com.fasterxml.jackson.databind.ObjectMapper.readTree(ObjectMapper.java:1659)
at AnnotateText.jsonToNode(AnnotateText.java:74)
at AnnotateText.printAnnotations(AnnotateText.java:49)
at AnnotateText.main(AnnotateText.java:26)
Class details
Exception in thread "main" java.lang.NullPointerException
at AnnotateText.printAnnotations(AnnotateText.java:51)
at AnnotateText.main(AnnotateText.java:26)

@ncbo-deployer
Copy link

I think that the ontology may have changed since the demo code was written. The following works:

http://data.bioontology.org/ontologies/MPATH/classes/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FMPATH_359

Ray

From: bioontology-admin [mailto:[email protected]] On Behalf Of Amrapali Zaveri
Sent: Thursday, October 29, 2015 10:25 AM
To: ncbo/ncbo_rest_sample_code
Subject: [bioontology-admin] [ncbo_rest_sample_code] Error from example code (#2)

When I run the example at: https://github.com/ncbo/ncbo_rest_sample_code/blob/master/java/src/AnnotateText.java
I get the error
java.io.FileNotFoundException: http://data.bioontology.org/ontologies/MP/classes/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FMPATH_359
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1835)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1440)
at AnnotateText.get(AnnotateText.java:96)
at AnnotateText.printAnnotations(AnnotateText.java:49)
at AnnotateText.main(AnnotateText.java:26)
com.fasterxml.jackson.databind.JsonMappingException: No content to map due to end-of-input
at [Source: java.io.StringReader@30c7da1https://github.com/java.io.StringReader/ncbo_rest_sample_code/commit/30c7da1e; line: 1, column: 1]
at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:164)
at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:2836)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:2778)
at com.fasterxml.jackson.databind.ObjectMapper.readTree(ObjectMapper.java:1659)
at AnnotateText.jsonToNode(AnnotateText.java:74)
at AnnotateText.printAnnotations(AnnotateText.java:49)
at AnnotateText.main(AnnotateText.java:26)
Class details
Exception in thread "main" java.lang.NullPointerException
at AnnotateText.printAnnotations(AnnotateText.java:51)
at AnnotateText.main(AnnotateText.java:26)


Reply to this email directly or view it on GitHubhttps://github.com//issues/2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants