首页 > 代码库 > java.net.SocketException: Unexpected end of file from server

java.net.SocketException: Unexpected end of file from server

java.net.SocketException: Unexpected end of file from server

at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:782)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:641)
    at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:779)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:641)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1218)
    at org.com.utils.NetUtil.post(NetUtil.java:64)
    at org.com.action.ModifyShopLngLatAction.searchAddressForUpdate(ModifyShopLngLatAction.java:83)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:273)
    at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:264)
    at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)




原因:http URL中包含了特殊字符  例如空格、#、\n、等

java.net.SocketException: Unexpected end of file from server