我的SoapUI项目中有一个端点问题。每个REST API端点都可以正常工作,只有当我尝试使用这个时才有空指针: 错误日志:
Thu Jul 13 12:27:14 CEST 2017:ERROR:java.io.IOException: Attempted read from closed stream.
java.io.IOException: Attempted read from closed stream.
at org.apache.http.impl.io.ContentLengthInputStream.read(ContentLengthInputStream.java:166)
at org.apache.http.impl.io.ContentLengthInputStream.read(ContentLengthInputStream.java:197)
at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:155)
at org.apache.http.util.EntityUtils.toByteArray(EntityUtils.java:100)
at org.apache.http.entity.BufferedHttpEntity.<init>(BufferedHttpEntity.java:60)
at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpMethodSupport.getResponseBody(HttpMethodSupport.java:237)
at com.eviware.soapui.impl.wsdl.submit.transports.http.support.methods.ExtendedPostMethod.getResponseBody(ExtendedPostMethod.java:116)
at com.eviware.soapui.impl.wsdl.submit.transports.http.SinglePartHttpResponse.<init>(SinglePartHttpResponse.java:51)
at com.eviware.soapui.impl.wsdl.submit.filters.HttpPackagingResponseFilter.httpRequest(HttpPackagingResponseFilter.java:80)
at com.eviware.soapui.impl.wsdl.submit.filters.HttpPackagingResponseFilter.afterAbstractHttpResponse(HttpPackagingResponseFilter.java:51)
at com.eviware.soapui.impl.wsdl.submit.filters.AbstractRequestFilter.afterRequest(AbstractRequestFilter.java:64)
at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:272)
at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:119)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Thu Jul 13 12:27:14 CEST 2017:ERROR:java.lang.NullPointerException
java.lang.NullPointerException
at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.followRedirects(HttpClientRequestTransport.java:327)
at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:242)
at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:119)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
我在GUI中也收到空白页面。在SoapUI的httplog中有什么奇怪的反应显示出正确的反应:
Thu Jul 13 12:27:14 CEST 2017:DEBUG:>> "POST /restAPI/unique/prepResult/1425841400000/1499855809035Id=58fa1ed8d HTTP/1.1[\r][\n]"
Thu Jul 13 12:27:14 CEST 2017:DEBUG:>> "Accept-Encoding: gzip,deflate[\r][\n]"
Thu Jul 13 12:27:14 CEST 2017:DEBUG:>> "Authentication: EI48Q0OEfVa4TeCpgbWZ7z65X_9KtrXysQJKF6C9WIoLxtgeWcaBx9n6HOqVl2689ZOXwkgwIfGGyJkGu2CkpjuDO5n2-IVPIiJ1_w7PufvPWroZoPG1rsmoIe1RW81QsV0Pqpq6NOe-Qmd4DP2GZt6kmGNQA4DKEKaW61h-skYPQ3tuBSvL0G_GDYPcTOCX6r9rLN8qX7NH8FI3E4JEwQOFWEUi5JBH19yR_o4-sBHD8cWNRmgQ2tch7pqTg1ECNFoS1gXS5bKuhbvY03hP2BiZlC7dzRhOdEUmvINw0LXK36p096ly4vWimoKjZlxV3tlFtvgJ5x1OyyGkx4kL6wewDgmY4POe6VA6K[\r][\n]"
Thu Jul 13 12:27:14 CEST 2017:DEBUG:>> "Content-Type: application/json[\r][\n]"
Thu Jul 13 12:27:14 CEST 2017:DEBUG:>> "Content-Length: 0[\r][\n]"
Thu Jul 13 12:27:14 CEST 2017:DEBUG:>> "Host: localhost[\r][\n]"
Thu Jul 13 12:27:14 CEST 2017:DEBUG:>> "Connection: Keep-Alive[\r][\n]"
Thu Jul 13 12:27:14 CEST 2017:DEBUG:>> "User-Agent: Apache-HttpClient/4.1.1 (java 1.5)[\r][\n]"
Thu Jul 13 12:27:14 CEST 2017:DEBUG:>> "[\r][\n]"
Thu Jul 13 12:27:14 CEST 2017:DEBUG:<< "HTTP/1.1 302 Found[\r][\n]"
Thu Jul 13 12:27:14 CEST 2017:DEBUG:<< "Date: Thu, 13 Jul 2017 10:27:14 GMT[\r][\n]"
Thu Jul 13 12:27:14 CEST 2017:DEBUG:<< "Content-Type: application/json[\r][\n]"
Thu Jul 13 12:27:14 CEST 2017:DEBUG:<< "Content-Length: 51[\r][\n]"
Thu Jul 13 12:27:14 CEST 2017:DEBUG:<< "[\r][\n]"
Thu Jul 13 12:27:14 CEST 2017:DEBUG:<< "{"result":"51934ad95949"}"
在httplog的最后,我在json中收到了正确的结果