Java.io.ioexception Error Writing To Server Httpurlconnection
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss
Java Io Ioexception Error Writing To Server Tomcat
the workings and policies of this site About Us Learn more about error writing to server java Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions
Error Writing To Server Salesforce
Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. artifactory error writing to server Join them; it only takes a minute: Sign up Getting java.io.IOException: Error writing to server at getInputStream up vote 0 down vote favorite If the temp string is very large I get java.io.IOException: Error writing to server at getInputStream String tmp = js.deepSerialize(taskEx); URL url = new URL("http://" + "localhost" + ":" + "8080" + "/Myproject/TestServletUpdated?command=startTask&taskeId=" +taskId + "'&jsonInput={\"result\":" + URLEncoder.encode(tmp) + "}"); URLConnection conn = url.openConnection(); InputStream is = conn.getInputStream(); Why is that? This call goes to the servlet mentioned in the URL. java json url servlets share|improve this question edited Jun 5 '12 at 22:34 user1114055 asked Jun 5 '12 at 11:34 Harinder 4,100125197 2 Well given that it's local, you should be able to see what happened at the server side. Check for exceptions. Additionally, there may well be more information than the message you're showing here - is there an inner exception? –Jon Skeet Jun 5 '12 at 11:38 2 There is a limit to the maximum length of URL. See: stackoverflow.com/questions/417142/… –Maciej Trybiło Jun 5 '12 at 11:38 @MaciejTrybiło ys i guess that's the issue,so is there some other way to do it?? –Harinder Jun 5 '12 at 11:40 You can try doing it with a POST request. Here's an example: exampledepot.com/egs/java.net/post.html Sorry for a bitty answer! –Maciej Trybiło Jun 5 '12 at 11:44 add a comment| 4 Answers 4 a
ExportXMLWordPrintable Details Type: Bug Status: Open Priority: P4 Resolution: Unresolved Affects Version/s: 9 Fix Version/s: tbd_minor Component/s: core-libs Labels: None Subcomponent: java.net CPU: sparc_64 OS: solaris Description These failures were spotted in http://stackoverflow.com/questions/10896568/getting-java-io-ioexception-error-writing-to-server-at-getinputstream an Aurora Adhoc test run. For the com/sun/net/httpserver/Test8a.java failure, here is a snippet of the .jtr file: ----------System.err:(19/1241)---------- java.io.IOException: Error writing to server at sun.net.www.protocol.http.HttpURLConnection.writeRequests(HttpURLConnection.java:666) at sun.net.www.protocol.http.HttpURLConnection.writeRequests(HttpURLConnection.java:678) at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1529) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1436) at https://bugs.openjdk.java.net/browse/JDK-8134518 java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:319) at Test8a.main(Test8a.java:78) 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:504) at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:92) at java.lang.Thread.run(Thread.java:746) JavaTest Message: Test threw exception: java.io.IOException: Error writing to server JavaTest Message: shutting down test STATUS:Failed.`main' threw exception: java.io.IOException: Error writing to server A search of JBS didn't reveal any likely bugs to cover this failure mode. For the java/net/URLPermission/URLTest.java failure, here is a snippet of the .jtr file: ----------System.err:(26/1715)---------- java.io.IOException: Error writing to server at sun.net.www.protocol.http.HttpURLConnection.writeRequests(HttpURLConnection.java:666) at sun.net.www.protocol.http.HttpURLConnection.writeRequests(HttpURLConnection.java:678) at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1529) at sun.net.www.protocol.http.HttpURLConnection.access$200(HttpURLConnection.java:91) at sun.net.www.protocol.http.HttpURLConnection$9.run(HttpURLConnection.java:1428) at sun.net.www.protocol.http.HttpURLConnection$9.run(HttpURLConnection.java:1426) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessController.doPrivilegedWithCombiner(AccessController.java:792) at
2016 14:46 Symptom: You're publishing artifacts to Nexus using Ivy, and it periodically fails with https://support.sonatype.com/hc/en-us/articles/218101688-Ivy-deploy-fails-intermittently-with-java-io-IOException-Error-writing-to-server- this error: BUILD FAILED /Users/rseddon/temp/test/build.xml:41: impossible to publish artifacts for http://forums.jfrog.org/IOException-error-writing-to-server-td6345612.html test#jdbc7;12.1.0.1-SNAPSHOT: java.io.IOException: Error writing to serverat sun.net.www.protocol.http.HttpURLConnection.writeRequests(HttpURLConnection.java:666)at sun.net.www.protocol.http.HttpURLConnection.writeRequests(HttpURLConnection.java:678)at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1534)at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)at org.apache.ivy.util.url.BasicURLHandler.upload(BasicURLHandler.java:263)at org.apache.ivy.util.url.URLHandlerDispatcher.upload(URLHandlerDispatcher.java:82)at org.apache.ivy.util.FileUtil.copy(FileUtil.java:283) Solution: This failure happens because a "tcp window full" message is sent, and then Nexus/Jetty tries to negotiate a new TCP window size, but error writing for some reason the deployer won't accept anything sent. As far as we can tell this is a bug in the JDK URL classes Ivy uses by default when publishing artifacts. The solution is to configure Ivy to use HttpClient for publishing. To do this, put the following error writing to jars on the classpath in addition to the ivy.jar file: commons-codec.jar commons-httpclient.jar commons-logging.jar The specific versions of these needed can be found in the "bin-with-deps" download at the Ivy download site: http://ant.apache.org/ivy/download.cgi It's a good idea to do this for other reasons, you'll likely find that the default Sun/Oracle URL classes will be problematic in other ways, here is one example: https://issues.apache.org/jira/browse/IVY-1197 Was this article helpful? 0 out of 0 found this helpful Facebook Twitter LinkedIn Google+ Have more questions? Submit a request 0 Comments Article is closed for comments. Related articles How can I programmatically upload an artifact into Nexus? How do I configure my Ivy build to deploy artifacts to Nexus? How do I configure my Ivy build to download artifacts from Nexus? Root Organization Best Practices Tips for uploading very large files to Nexus Terms of ServicePrivacy PolicyCopyright © 20
threaded view ♦ ♦ | Report Content as Inappropriate ♦ ♦ IOException: error writing to server Hi all, hoping someone can help shed some light on this problem I'm having. We use Ant and Ivy to publish build artifacts to Artifactory, with this stuff being run on a Hudson server. We have about 30 projects that are built and published throughout the day. But for the past week or two, I've been getting intermittent errors when Ivy tries to publish the artifacts up to the Artifactory server. It's usually (but not always) the same project which fails, and it doesn't always fail. Most of the time, I can log into Hudson immediately after seeing it fail, manually kick off another build and it works fine. The error that is reported by Ivy looks like this: java.io.IOException: Error writing to server at sun.net.www.protocol.http.HttpURLConnection.writeRequests(HttpURLConnection.java:583) at sun.net.www.protocol.http.HttpURLConnection.writeRequests(HttpURLConnection.java:595) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1198) at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:379) at org.apache.ivy.util.url.BasicURLHandler.upload(BasicURLHandler.java:225) at org.apache.ivy.util.url.URLHandlerDispatcher.upload(URLHandlerDispatcher.java:82) at org.apache.ivy.util.FileUtil.copy(FileUtil.java:148) at org.apache.ivy.plugins.repository.url.URLRepository.put(URLRepository.java:84) at org.apache.ivy.plugins.repository.AbstractRepository.put(AbstractRepository.java:130) at org.apache.ivy.plugins.resolver.RepositoryResolver.put(RepositoryResolver.java:234) at org.apache.ivy.plugins.resolver.RepositoryResolver.publish(RepositoryResolver.java:216) at org.apache.ivy.core.publish.PublishEngine.publish(PublishEngine.java:281) at org.apache.ivy.core.publish.PublishEngine.publish(PublishEngine.java:260) at org.apache.ivy.core.publish.PublishEngine.publish(PublishEngine.java:172) ... FWIW, the project that fails most often is the one that generates the largest artifact; but I'm not 100% certain that has anything to do with what's going on. Has anyone seen this sort of thing before? Is it likely to be a timeout related issue of some sort? If so, any thoughts on what might resolve it? If it helps, this is all running on a VM running Windows Server 2008, the latest version of Ivy, the latest Artifactory and a relatively recent Sun/Oracle JDK 1.6. Thanks, Phillip Rhodes Redwood Software ------------------------------------------------------------------------------ WhatsUp Gold - Download Free Network Management Software The m