1

Using apache commons httpClient PutMethod to upload a doc to sharepoint 2010 as it was a large it is taking time and after sometime i am throwing by an exception.

Socket Error: Connection Reset by peer : socket write error

as peer means share-point is closing socket or socket just failing to write where is the error, can fix for this issue from java side.

Update: After troubleshooting the class its working has standalone java class, but it is failing when it is running in Tomcat server. I think some configuration of tomcat server will fix this issue.

My understanding the tomcat server is a web server deals with http protocol and my java class is implementation of apache HttpClient 3.1 so this java class is works as individual class and failing in tomcat server means tomcat is overriding my httpclient params which is causing this issue

The111
  • 5,757
  • 4
  • 39
  • 55
JAVAC
  • 1,230
  • 3
  • 17
  • 38
  • you might want to look at http://stackoverflow.com/questions/12986542/how-to-solve-connection-reset-by-peer-socket-write-error – cool Jan 16 '15 at 21:30
  • its different he is using servlet response object my case its a webdav protocol using HttpClient of apache commons – JAVAC Jan 17 '15 at 15:50
  • For uploading large file in Sharepoint 2010 use HTTP DAV 0. Note if your are using webservices maximum allowed limit 4mb but this can be changed by SP administrator – meetkichu Jan 17 '15 at 21:53
  • Yes I am using WebDav only with commons HttpClient and spring CommonsHttpMessageSender for me this working upto 100Mb only problem is unable to upload because after 9 mins i am getting error – JAVAC Jan 19 '15 at 20:13
  • Are you sure that this is not a side effect of slow lorris mitigation on the sharepoint/network side? – Hannes Feb 23 '15 at 18:17
  • i am not sure what you are referring about, can you please give me more info.. is that something should be fixed from sharepoint side instead tomcat? – JAVAC Feb 23 '15 at 20:00
  • When the webserver is closing/resetting a connection you can not fix it from the opposite side - there are connection time-outs that are pre-set for http servers to prevent them from running out of available sessions/ports/connections. If that happens during active data exchange than most likely that the problem is caused by data size limit – Germann Arlington Feb 26 '15 at 11:06
  • yep i tried to increased all connection limits on tomcat server and everywhere i can – JAVAC Feb 26 '15 at 19:55
  • It definitely seems like Tomcat server must be overriding some default values. A simple thing to start with would be environmental variables. Commons httpclient is deprecated and no longer maintained. How feasible would it be to switch to Apache HTTP components? – Necreaux Feb 26 '15 at 21:56
  • Yes i tried with Http Components 4.3 it is also having same issue, struckup to understand what is the issue – JAVAC Feb 27 '15 at 15:28
  • When it was working as a "standalone Java class", were you testing it from the same machine that Tomcat is hosted? If not, then most likely it's the problem between the machine that has Tomcat (http client) and the machine that has Sharepoint (http server). Do they connect directly or via some proxy? If through proxy, then you might have to check the settings on the proxy server too. – Gaurav Feb 27 '15 at 21:44
  • There is no proxy between i am directly connecting that URL using HttpClient class – JAVAC Mar 04 '15 at 21:48

1 Answers1

1

You will find below link use full in your case.I resolved same issue by reading below details.

http://jce.iaik.tugraz.at/sic/Products/Communication-Messaging-Security/iSaSiLk/documentation/Secure-Renegotiation

Krutik Jayswal
  • 3,165
  • 1
  • 15
  • 38
  • i am not sure what's that you are referring to looks like not related to my issue.. can tell more clear what it is? – JAVAC Feb 27 '15 at 15:51