Java Eclipse中Orion的响应出现错误

Java Eclipse中Orion的响应出现错误,java,fiware,fiware-orion,Java,Fiware,Fiware Orion,我正在一个示例ExampleClient.zip下开发,我来自 但是我对这个错误有一些问题 Exception in thread "main" org.apache.xmlbeans.XmlException: error: Unexpected end of file after null at org.apache.xmlbeans.impl.store.Locale$SaxLoader.load(Locale.java:3511) at org.apache.xmlbeans.impl.

我正在一个示例ExampleClient.zip下开发,我来自

但是我对这个错误有一些问题

Exception in thread "main" org.apache.xmlbeans.XmlException: error: Unexpected end of file after null
at org.apache.xmlbeans.impl.store.Locale$SaxLoader.load(Locale.java:3511)
at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1277)
at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1264)
at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:345)
at noNamespace.UpdateContextSubscriptionResponseDocument$Factory.parse(UpdateContextSubscriptionResponseDocument.java:71)
at com.sap.research.fiware.ngsi10.test.server.exampleclient.ExampleClient.main(ExampleClient.java:92)
Caused by: org.xml.sax.SAXParseException; systemId: file:; lineNumber: 1; columnNumber: 1; Unexpected end of file after null
    at org.apache.xmlbeans.impl.piccolo.xml.Piccolo.reportFatalError(Piccolo.java:1038)
    at org.apache.xmlbeans.impl.piccolo.xml.Piccolo.parse(Piccolo.java:723)
    at org.apache.xmlbeans.impl.store.Locale$SaxLoader.load(Locale.java:3479)
    ... 5 more
当我尝试使用Orion上下文的Json响应时,就会发生这种情况

String Addrres = "http://CENTOS-66.cloudapp.net:1026/version";
    URL url = new URL(Addrres);
    HttpURLConnection connection = (HttpURLConnection) url.openConnection();

InputStream inputStream = connection.getInputStream();

UpdateContextSubscriptionResponseDocument respDoc = UpdateContextSubscriptionResponseDocument.Factory.parse(inputStream);
我打印了Orion的响应,我意识到json响应的末尾有一个null和一些/ln,这可能会产生此错误,当我将响应的字符与connection进行比较时。getContentLength与我打印的响应不同,总是多5个字符

本例中的XML响应是

<orion>
<version>0.19.0</version>
<uptime>6 d, 23 h, 23 m, 42 s</uptime>
<git_hash>1ad73b298cd261861203fbffb9c789f6ade2796d</git_hash>
<compile_time>Wed Feb 11 13:00:19 CET 2015</compile_time>
<compiled_by>fermin</compiled_by>
<compiled_in>centollo</compiled_in>
</orion>

错误,可能是响应的空值问题,或者可能是我没有实现什么。?

我打印响应的方式是下一种:StringBuffer text=new StringBuffer;InputStreamReader in=新建InputStreamReaderInputStream连接。getInputStream;//获取内容;BufferedReader buff=新的BufferedReaderin;System.out.println获取数据。。。;弦线;do{line=buff.readLine;text.appendline+\n;}而line!=无效的我需要API请求/响应方面的信息以提供帮助。特别是,您是否可以编辑您的问题,将请求的XML/JSON与您正在使用的HTTP动词+URL以及您正在收到的响应的XML/JSON一起包含在内?谢谢在本例中,我在请求中不使用任何XML/JSON,因为这是我对API的第一次测试,URL是:响应是0.19.0 6 d,23 h,23 m,42 s 1ad73b298cd261861203fbffb9c789f6ade2796d Wed Feb 11 13:00:19 CET 2015 fermin centollo