tencentyun/cos-java-sdk-v5

求助>>DefaultCosHttpClient:369 抛空指针异常

m9d2 opened this issue · 1 comments

m9d2 commented

version: 5.5.5

org.apache.http.client.ClientProtocolException: null
	at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:187)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
	at com.qcloud.cos.http.DefaultCosHttpClient.exeute(DefaultCosHttpClient.java:369)
	at com.qcloud.cos.COSClient.invoke(COSClient.java:530)
	at com.qcloud.cos.COSClient.putObject(COSClient.java:848)
	at com.innjoy.pms.middleware.util.UploadFileUtil.upload(UploadFileUtil.java:61)
	at com.innjoy.pms.middleware.service.impl.IdentificationMigrationServiceImpl.uploadImg(IdentificationMigrationServiceImpl.java:148)
	at com.innjoy.pms.middleware.service.impl.IdentificationMigrationServiceImpl.getImgUrl(IdentificationMigrationServiceImpl.java:107)
	at com.innjoy.pms.middleware.service.impl.IdentificationMigrationServiceImpl.saveIdentification(IdentificationMigrationServiceImpl.java:67)
	at com.innjoy.pms.middleware.service.impl.IdentificationMigrationServiceImpl$$FastClassBySpringCGLIB$$810649c.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294)
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
	at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:115)
	at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
	at java.util.concurrent.FutureTask.run(FutureTask.java)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.http.client.NonRepeatableRequestException: Cannot retry request with a non-repeatable request entity
	at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:108)
	at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)
	at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
	... 22 common frames omitted
Caused by: java.net.SocketException: Connection reset by peer: socket write error
	at java.net.SocketOutputStream.socketWrite0(Native Method)
	at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
	at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
	at org.apache.http.impl.io.SessionOutputBufferImpl.streamWrite(SessionOutputBufferImpl.java:124)
	at org.apache.http.impl.io.SessionOutputBufferImpl.flushBuffer(SessionOutputBufferImpl.java:136)
	at org.apache.http.impl.io.SessionOutputBufferImpl.write(SessionOutputBufferImpl.java:167)
	at org.apache.http.impl.io.ChunkedOutputStream.flushCacheWithAppend(ChunkedOutputStream.java:122)
	at org.apache.http.impl.io.ChunkedOutputStream.write(ChunkedOutputStream.java:179)
	at org.apache.http.entity.InputStreamEntity.writeTo(InputStreamEntity.java:134)
	at org.apache.http.impl.execchain.RequestEntityProxy.writeTo(RequestEntityProxy.java:121)
	at org.apache.http.impl.DefaultBHttpClientConnection.sendRequestEntity(DefaultBHttpClientConnection.java:156)
	at org.apache.http.impl.conn.CPoolProxy.sendRequestEntity(CPoolProxy.java:160)
	at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:238)
	at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123)
	at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:272)
	at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
	at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
	... 24 common frames omitted

@Loptis ,你好,Caused by: java.net.SocketException: Connection reset by peer: socket write error,这表明请求被重置了。请问请求cos的中间有代理之类的吗,如您还存在该问题,建议您在腾讯云官网将appid和bucket、路径等信息放在工单中方便排查哈