# 报错信息
org.apache.http.ConnectionClosedException: Premature end of Content-Length delimited message body (expected: 4513362; received: 360274
at org.apache.http.impl.io.ContentLengthInputStream.read(ContentLengthInputStream.java:178)
at org.apache.http.impl.io.ContentLengthInputStream.read(ContentLengthInputStream.java:198)
at org.apache.http.impl.io.ContentLengthInputStream.close(ContentLengthInputStream.java:101)
at org.apache.http.impl.execchain.ResponseEntityProxy.streamClosed(ResponseEntityProxy.java:143)
at org.apache.http.conn.EofSensorInputStream.checkClose(EofSensorInputStream.java:228)
at org.apache.http.conn.EofSensorInputStream.close(EofSensorInputStream.java:172)
at org.apache.http.util.EntityUtils.consume(EntityUtils.java:88)
at com.suwell.ofd.custom.agent.HTTPAgent$1.handleEntity(HTTPAgent.java:149)
at com.suwell.ofd.custom.agent.HTTPAgent$1.handleEntity(HTTPAgent.java:138)
at org.apache.http.impl.client.AbstractResponseHandler.handleResponse(AbstractResponseHandler.java:73)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:223)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:165)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:140)
at com.suwell.ofd.custom.agent.HTTPAgent.download(HTTPAgent.java:138)
at com.suwell.ofd.custom.agent.HTTPAgent.convert(HTTPAgent.java:184)
at com.suwell.ofd.custom.agent.ConvertAgent.convert(ConvertAgent.java:494)
at com.suwell.ofd.custom.agent.ConvertAgent.addSeal(ConvertAgent.java:243)
at com.neuqsoft.apilicense.service.CreateOfdService.makeOFD(CreateOfdService.java:640)
at com.neuqsoft.apilicense.service.CreateOfdService$$FastClassBySpringCGLIB$$9bc09320.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)
at com.neuqsoft.apilicense.service.CreateOfdService$$EnhancerBySpringCGLIB$$323566f1.makeOFD(<generated>)
at com.neuqsoft.apilicense.task.TaskService.teacherOfdOther(TaskService.java:428)
at com.neuqsoft.apilicense.task.MultithreadScheduleTask.otherOfd(MultithreadScheduleTask.java:91)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:65)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)可能的原因
1. 服务器端错误
服务器可能在发送完部分数据后关闭了连接。这可能是由于服务器端代码中的错误、资源耗尽(如内存或连接数限制)、或者是服务器端的配置问题。
2. 网络问题
网络不稳定或配置不当也可能导致连接过早关闭。例如,代理服务器、负载均衡器或防火墙可能在传输过程中中断连接。
3. 客户端配置问题
客户端的HTTP库可能没有正确处理连接或超时设置。例如,如果设置了过短的超时时间,可能在服务器响应完全之前连接就已经超时关闭了。
4. 服务器响应不完整
服务器可能由于某些原因(如内部错误)而未能发送完整的响应内容。
我遇到的情况
服务器共享磁盘损坏导致读取文件不全,共享磁盘服务器切换挂载点,使用共享磁盘的服务器重新挂载修复。
重新挂载共享磁盘
umount -l /home/opt/
mount -t nfs -o vers=3,rw 10.233.16.91:/sf/nfs01 /home/opt/