SocketException: Connectin reset

What is the main cause of this error?
java.net.SocketException: Connection reset
java.net.SocketInputStream.read(Unknown Source)
java.io.BufferedInputStream.fill(Unknown Source)
java.io.BufferedInputStream.read(Unknown Source)
java.io.DataInputStream.readUnsignedShort(Unknown Source)
java.io.DataInputStream.readUTF(Unknown Source)
java.io.DataInputStream.readUTF(Unknown Source)

Thanks for replying.
Here is the snippet of the code:
public Socket s;
public DataInputStream i;
public DataOutputStream o;
s = new Socket (socketServerIP, Integer.parseInt (socketServerPort));
i = new DataInputStream(new BufferedInputStream(s.getInputStream()));
o = new DataOutputStream(new BufferedOutputStream(s.getOutputStream()));
try {
while (true) {
String line = i.readUTF ();
System.out.println("- Message from server : " + line);
} catch (IOException ex) {
System.out.println(ex);
ex.printStackTrace();
During development/testing stage, i get "SocketException: Connection reset" when i intentionally close the server. However, during the implementation stage, the server is always up. I still get this error once in a while. Actually i receive two kinds of errors.
The first one is this:
java.net.SocketException: Connection reset
java.net.SocketInputStream.read(Unknown Source)
java.io.BufferedInputStream.fill(Unknown Source)
java.io.BufferedInputStream.read(Unknown Source)
java.io.DataInputStream.readUnsignedShort(Unknown Source)
java.io.DataInputStream.readUTF(Unknown Source)
java.io.DataInputStream.readUTF(Unknown Source)
And the other one is this:
java.io.EOFException
java.io.DataInputStream.readUnsignedShort(Unknown Source)
java.io.DataInputStream.readUTF(Unknown Source)
java.io.DataInputStream.readUTF(Unknown Source)
What seems to be the problem?

Similar Messages

  • JCOM throwing SocketException: Connection reset by peer: socket write error

    I have an ejb which is calling a simple ActiveX component using JCOM.
    Ocassionally the ejb loses the ability to connect to the ActiveX component. Any attempt to call a method results in a java.net.SocketException: Connection reset by peer: socket write error.
    However the ActiveX component continues to run correctly. I can still connect to it using a vb test client. This is using com to connect, not DCOM as used by JCOM(JIntegra).
    The application server and the ActiveX component are running on the same server.
    Any suggestions as to why the JIntegra DCOM request could be failing?
    Thanks,
    Greg.

    I have an ejb which is calling a simple ActiveX component using JCOM.
    Ocassionally the ejb loses the ability to connect to the ActiveX component. Any attempt to call a method results in a java.net.SocketException: Connection reset by peer: socket write error.
    However the ActiveX component continues to run correctly. I can still connect to it using a vb test client. This is using com to connect, not DCOM as used by JCOM(JIntegra).
    The application server and the ActiveX component are running on the same server.
    Any suggestions as to why the JIntegra DCOM request could be failing?
    Thanks,
    Greg.

  • How to avoid a SocketException: Connection reset by peer

    Hi,
    My problem sounds very simple at first, but I couldn't figure out how to get out of it. It's tricky.
    A have a JSP page which makes some processing and yields output to the user. Everything runs OK, until the user decide to stop the window (or to close the window) before the results render to the browser. When the next browser tries to load this page, the right page is loaded, but before it, the error garbage (error page, stack trace) from the previous user is showed in the browser...the exception is SocketException: Connection Reset by Peer.
    As I could see in the error log for the web server, the server flushes the page to the client browser, but the browser closed the HTTP connection, then this error is returned. That's OK, but this error output that was not sent appears to be "stored" somewhere in the server, and then is sent to the next client that requests the page. I tried to clear the buffer with out.clearBuffer() in the beginning of the page, but it didn't work.
    The solution would simply be to ignore this error output, i.e., to clean the output before the next user try to load the page. but I don't know how to do that.
    Sorry about the long posting, I hope I was clear in my explanation. I am using Websphere Studio Testing Web Server...and this situation happens on any browser (the problem seems to be in the server).
    Thanks in advance,
    Tiago.

    try using out.flush() in your code, use finalize ??
    out.flush();
    out.close();
    all the best !

  • JspException: Input/output errror: SocketException: Connection reset by pee

    In weblogic 8.1, getting below exception often,
              javax.servlet.jsp.JspException: Input/output errror: java.net.SocketException: Connection reset by peer.
              at org.apache.struts.util.ResponseUtils.write method
              Although no problem, but it seems to slow down.
              Technology used is mix of jsp, servlets & struts framework
              Any comments will be highly appreciated

    I also experience this. I have wenlogic 8.1sp6.
              It was affecting one part of my application in that no data is being returned. I had to stop and restart the server to get connection going again. I notice no one with weblogic 9 has the problem. I may upgrade to version 9 soon if that will help to solve this problem.

  • SocketException: Connection reset in readLine()

    I am new to socket programming in java...
    A client program from another application connects to my server and sends a string input to my server.
    My server thread looks like this:
    public class CallBankAPIClientSendThread extends Thread {
         Socket socket=null;
         String inputLine="";
         public CallBankAPIClientSendThread(Socket socket) {
              super("CallBankAPIClientSendThread");
              this.socket=socket;
         public void run(){
              /***Get input from the client****************/
         DataInputStream streamIn;
              try {
                   streamIn = new
                   DataInputStream(new BufferedInputStream(socket.getInputStream()));
                   inputLine=streamIn.readLine();
                   //do some processing...
                   streamIn.close();
                   } catch (IOException e1) {
                        System.out.println(e1);
                   //do some processing here again
    I am getting SocketException: Connection reset error...
    Please help...

    SharadaC wrote:
    I tried closing the socket connection... It doesn't help...
    I am still getting the same exception...
    sigh
    You don't seem to be grasping yet that (according to what you keep claiming the exception is) the client is terminating the socket.
    So that means the socket at your end is dead. D. E. A. D. So you'll just have to close it.
    But no, that won't solve your problem of your client terminating the socket will it? You need to investigate that and fix that.

  • Java SocketException Connection Reset???

    Hi,
    I have written a client/server app that works fine conceptually, but eventually at some point a SocketException Connection Reset gets thrown and brings my app down. I open and close a ton of Sockets, but this error kills me. How can I preven this exception or at least catch it in a way that will stop it from bringing my app down? I would rather prevent it. Is this an error that just happens when you are opening and closing sockets? I'm using TCP sockets.

    Re: Java SocketException Connection Reset???
    I have written a client/server app that works fine
    conceptually, but eventually at some point a
    SocketException Connection Reset gets thrown and
    brings my app down.
    I open and close a ton of
    Sockets, but this error kills me. How can I preven
    this exception or at least catch it in a way that
    will stop it from bringing my app down? I would
    rather prevent it. Is this an error that just happens
    when you are opening and closing sockets? I'm using
    TCP sockets.IIRC tthis usually means the other end closed the socket
    (possibly without following the proper procedure?).
    In an application that handles many sockets,
    you should just catch the exception, close the socket in question and tidy up any resources linked to it.

  • RE: SocketException: Connection reset by peer

     

    I am getting a same exception in WebLogic6.1 SP1.
    java.net.SocketException: Connection reset by peer: socket write error
         at java.net.SocketOutputStream.socketWrite(Native Method)
         at java.net.SocketOutputStream.write(SocketOutputStream.java:83)
         at weblogic.servlet.internal.ChunkUtils.writeHeaderChunk(ChunkUtils.java:151)
         at weblogic.servlet.internal.ResponseHeaders.writeHeaders(ResponseHeaders.java:380)
         at weblogic.servlet.internal.ServletResponseImpl.writeHeaders(ServletResponseImpl.java:827)
         at weblogic.servlet.internal.ServletOutputStreamImpl.sendHeaders(ServletOutputStreamImpl.java:222)
         at weblogic.servlet.internal.ChunkOutput.flush(ChunkOutput.java:241)
         at weblogic.servlet.internal.ChunkOutput.checkForFlush(ChunkOutput.java:306)
         at weblogic.servlet.internal.MultibyteOutput.write(ChunkOutput.java:413)
         at weblogic.servlet.internal.MultibyteOutput.print(ChunkOutput.java:389)
         at weblogic.servlet.internal.ChunkOutputWrapper.print(ChunkOutputWrapper.java:134)
         at weblogic.servlet.jsp.JspWriterImpl.print(JspWriterImpl.java:111)
    Anybody has any idea?

  • SocketException: Connection reset , using HttpURLConnection

    hello everybody, i'm using this to read a xml from internet:
           URL url;
                HttpURLConnection urlcon;
                url = new URL (urlString);
                System.out.print("Connecting ....\t");
                urlcon = (HttpURLConnection)url.openConnection();
                if(!urlcon.getResponseMessage().equals("OK"))
                    return -1;
                System.out.println("Done!");it gives me:
    java.net.SocketException: Connection reset
    at java.net.SocketInputStream.read(Unknown Source)
    at java.io.BufferedInputStream.fill(Unknown Source)
    at java.io.BufferedInputStream.read1(Unknown Source)
    at java.io.BufferedInputStream.read(Unknown Source)
    at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
    at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
    at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unkno
    at java.net.HttpURLConnection.getResponseCode(Unknown Source)
    at java.net.HttpURLConnection.getResponseMessage(Unknown Source)
    when i do urlcon.getResponseMessage()....
    Any ideas why this happens?
    PS: when i try the same URL in a browser, it opens the file fine .....

    My suggestion is run that with Wireshark (ethereal)
    monitoring the data. That way you can see what is
    really going on in the traffic and compare that to
    the browsers traffic. It's possible that the server
    is attempting to block bots, and I think Java tells
    the server that it is a JRE connecting and not a
    normal browser. There are ways to get around that
    though if that is the issue.You were right, the first thing i tried was to set the user-agent property in the request, and that was it, looks like the server was blocking me, thx everybody

  • (Linux) SocketException: Connection reset

    I get a nasty exception while reading on a socket.
    SocketException: Connection reset
    The exception occurrs when running on Linux Redhat 8.0. I can't reproduce it when running on Windows. Could anyone explain why it happen.
    I'm using sdk 1.4.0_01.
    public class Test {
    void transfer() throws IOException {
    Socket socket = null;
    try {
    //Open a socket connection to server
    socket = new Socket("127.0.0.1",4321);
    //Enable SO_TIMEOUT with the specified timeout
    socket.setSoTimeout(60000);
    //Create channels
    ReadableByteChannel readableChannel = Channels.newChannel(socket.getInputStream());
    WritableByteChannel writableChannel = Channels.newChannel(socket.getOutputStream());
    //Create and fill buffer
    ByteBuffer buffer = ByteBuffer.allocate(32);
    while(buffer.hasRemaining())
    buffer.put((byte)1);
    buffer.flip();
    //Send
    while(buffer.hasRemaining()) {
    //Write message
    writableChannel.write(buffer);
    //Clear buffer
    buffer.clear();
    try {
    readableChannel.read(buffer);
    } catch(SocketException se) {
    System.err.println(se.getMessage());
    catch(IOException ioe) {
    finally {
    try {
    if(socket != null)
    socket.close();
    }catch(IOException ioe) {}
    Output:
    SocketException: Connection reset

    No, I actually can't. It's written by a third party in C, and I can't get the source.
    The thing is that I want to keep my connection open for several transfers, and when running on Linux suddenly my connection goes down. Sometimes it takes 20 min (about 100 transfers) and sometimes just after a few minutes (about 10 transfers). I haven't seen the problem when running on Windows.
    There were some mistakes in my code above. I hope I correct them here.
    I'm using sdk 1.4.1_01 and NOT 1.4.0_x.
    public class Test {
    private Socket socket = null;
    private ReadableByteChannel readableChannel;
    private WritableByteChannel writableChannel;
    public Test() throws IOException {
    //Open a socket connection to server
    socket = new Socket("127.0.0.1",4321);
    //Enable SO_TIMEOUT with the specified timeout
    socket.setSoTimeout(60000);
    //Create channels
    readableChannel = Channels.newChannel(socket.getInputStream());
    writableChannel = Channels.newChannel(socket.getOutputStream());
    void transfer() throws IOException {
    try {
    //Create and fill buffer
    ByteBuffer buffer = ByteBuffer.allocate(32);
    while(buffer.hasRemaining())
    buffer.put((byte)1);
    buffer.flip();
    //Send
    while(buffer.hasRemaining()) {
    //Write message
    writableChannel.write(buffer);
    //Clear buffer
    buffer.clear();
    try {
    readableChannel.read(buffer);
    } catch(SocketException se) {
    System.err.println("Nasty exception: "+se.getMessage());
    catch(IOException ioe) {
    System.out.println("This never happen");
    public void close() {
    try {
    if(socket != null)
    socket.close();
    }catch(IOException ioe) {}
    Output:
    Nasty exception: SocketException: Connection reset

  • Recurring Page Exception  -  'SocketException: Connection reset by peer'

    I have implemented a popup calendar that is implemented as an include of a file in a lower directory (i.e. 'script/calendar.jsp') that uses an iframe. This calendar is only in a few of my pages, but I get the below exception in each page which implements it.
    Is this happening after the page is sent? It's after the afterRenderResponse() method. Any thoughts? Thanks.
    [#|2005-06-30T21:44:37.593-0500|SEVERE|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web
         |_ThreadID=19;|org.apache.catalina.core.StandardHostValve@1a70476: Exception Processing ErrorPage[errorCode=404, location=/faces/error.jsp]
         ClientAbortException:  java.net.SocketException: Software caused connection abort: socket write error
         at org.apache.coyote.tomcat5.OutputBuffer.realWriteBytes(OutputBuffer.java:378)
         at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:401)
         at org.apache.coyote.tomcat5.OutputBuffer.doFlush(OutputBuffer.java:320)
         at org.apache.coyote.tomcat5.OutputBuffer.flush(OutputBuffer.java:302)
         at org.apache.coyote.tomcat5.CoyoteResponse.flushBuffer(CoyoteResponse.java:512)
         at org.apache.coyote.tomcat5.CoyoteResponseFacade$1.run(CoyoteResponseFacade.java:212)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.coyote.tomcat5.CoyoteResponseFacade.flushBuffer(CoyoteResponseFacade.java:207)
         at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:306)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:133)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:539)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at com.sun.enterprise.webservice.EjbWebServiceValve.invoke(EjbWebServiceValve.java:134)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at com.sun.enterprise.security.web.SingleSignOn.invoke(SingleSignOn.java:254)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at com.sun.enterprise.web.VirtualServerValve.invoke(VirtualServerValve.java:209)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:114)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
         at com.sun.enterprise.web.VirtualServerMappingValve.invoke(VirtualServerMappingValve.java:166)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:936)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:165)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:683)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:604)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:542)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:647)
         at java.lang.Thread.run(Thread.java:534)References: http://forum.java.sun.com/thread.jspa?messageID=3767674�

    Hi,
    Please go throught the following link:
    http://www.websina.com/bugzero/errors/http-connection-reset.html
    Hope this helps
    Cheers
    Giri :-)

  • SocketException - Connection reset by peer

    Hi,
    I'm running a j2ee app on WAS5.0. I get this abrupt exception for no reason. It comes just while the jsp is loading or just moving the mouse around on the page.
    Kindly let me know what the problem could be.
    regards,
    Arif

    Thrown to indicate that there is an error in the underlying protocol, such as a TCP error.
    there is much information about this exceptio...
    Read this article
    Network Programming with J2SE 1.4
    http://java.sun.com/features/2002/08/j2se-network.html
    Other forums with same problem:
    http://forum.java.sun.com/thread.jsp?forum=46&thread=294609&tstart=0&trange=15
    http://forum.java.sun.com/thread.jsp?thread=294609&forum=46&message=1797877

  • AxisFault SocketException reset connection

    I have this error when i do massive connections to a remote webservice.
    Anyone knows a solution for fix this problem?
    AxisFault
    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
    faultSubcode:
    faultString: java.net.SocketException: Connection reset
    faultActor:
    faultNode:
    faultDetail:
    {http://xml.apache.org/axis/}stackTrace:java.net.SocketException: Connection reset
    at java.net.SocketInputStream.read(SocketInputStream.java:197)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:229)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:246)
    at org.apache.axis.transport.http.HTTPSender.readHeadersFromSocket(HTTPSender.java:583)
    at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:143)
    at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
    at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    at org.apache.axis.client.Call.invoke(Call.java:2767)
    at org.apache.axis.client.Call.invoke(Call.java:2443)
    at org.apache.axis.client.Call.invoke(Call.java:2366)
    at org.apache.axis.client.Call.invoke(Call.java:1812)
    at

    Hi,
    I'm not sure how you are opening the files but I do always open the actual file and not by URL. If your files are on a server with no GUI, first download the files to a local machine. For example a directory located here:
    {GW root directory}\groups\group-2\conf\d28d2089-9957-4e22-9046-aa8b40958c48
    Use your locally installed gateway and in the bin directory, start the esexplorer application.
    Normally it would be the PrimaryStore-xxxxx.xml file you want to edit. After you are done, copy back the files to the server and start the gateway.
    Cheers,
    Stefan

  • Connection reset error while calling web service deployed on tomcat

    Hello Friends,
    I am trying to invoke a web service from web dynpro application. The web service is deployed on tomcat 5.5 server.
    I am creating an adaptive web service model using wsdl file. The model gets created without any error.
    But when application is deployed and run it is giving following exception:
    java.net.SocketException: Connection reset
        at java.net.SocketInputStream.read(SocketInputStream.java:168)
        at java.io.BufferedInputStream.read1(BufferedInputStream.java:254)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:313)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
        at java.io.BufferedInputStream.read1(BufferedInputStream.java:256)
        ... 102 more
    I tried to call the service from a simple java application. There the service works fine.
    Also, in the web services navigator, if I specify the wsdl url for testing it gives the same error of "Connection reset".
    I don't think this is a proxy server issue as the tomcat is within the local network.
    Can someone please help me with this?
    Thanks and regards,
    Mayuresh
    Edited by: Mayuresh Kanvinde on Mar 27, 2008 7:03 PM

    Hi Sumit,
    Thanks for the reply.
    Here is the stack trace:
    com.sap.tc.webdynpro.model.webservice.exception.WSModelRuntimeException: Exception on creation of service metadata for WSDL URL 'http://<host>:<port>/WebServicesTest/DummyWebService?wsdl' and service factory configuration 'null'
         at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.getOrCreateWsrService(WSModelInfo.java:422)
         at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.readOperationsFromWSDL(WSModelInfo.java:372)
         at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.importMetadataInternal(WSModelInfo.java:342)
         at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.importMetadata(WSModelInfo.java:326)
         at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo$Cache.getModelInfo(WSModelInfo.java:199)
         at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.getModelInfoFromCacheOrCreate(WSModelInfo.java:1035)
         at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.getModelInfoFromCacheOrCreate(WSModelInfo.java:248)
         at com.sap.tc.webdynpro.model.webservice.gci.WSTypedModel.<init>(WSTypedModel.java:41)
         at com.tcs.vis.Vishy.<init>(Vishy.java:73)
         at com.tcs.app.AppView.wdDoInit(AppView.java:101)
         at com.tcs.app.wdp.InternalAppView.wdDoInit(InternalAppView.java:143)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doInit(DelegatingView.java:61)
         at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)
         at com.sap.tc.webdynpro.progmodel.view.View.initController(View.java:445)
         at com.sap.tc.webdynpro.progmodel.controller.Controller.init(Controller.java:200)
         at com.sap.tc.webdynpro.progmodel.view.ViewManager.getView(ViewManager.java:709)
         at com.sap.tc.webdynpro.progmodel.view.ViewManager.bindRoot(ViewManager.java:579)
         at com.sap.tc.webdynpro.progmodel.view.ViewManager.init(ViewManager.java:155)
         at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.doOpen(WebDynproWindow.java:295)
         at com.sap.tc.webdynpro.clientserver.window.ApplicationWindow.show(ApplicationWindow.java:183)
         at com.sap.tc.webdynpro.clientserver.window.ApplicationWindow.open(ApplicationWindow.java:178)
         at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.init(ClientApplication.java:364)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.initApplication(ApplicationSession.java:748)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:283)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:713)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:666)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:250)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:46)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: com.sap.engine.services.webservices.jaxrpc.exceptions.WebserviceClientException: GenericServiceFactory initialization problem. Could not load web service model. See nested exception for details.
         at com.sap.engine.services.webservices.espbase.client.dynamic.impl.DGenericServiceImpl.generateProxyFiles(DGenericServiceImpl.java:150)
         at com.sap.engine.services.webservices.espbase.client.dynamic.impl.DGenericServiceImpl.<init>(DGenericServiceImpl.java:50)
         at com.sap.engine.services.webservices.espbase.client.dynamic.GenericServiceFactory.createService(GenericServiceFactory.java:71)
         at com.sap.engine.services.webservices.espbase.client.dynamic.GenericServiceFactory.createService(GenericServiceFactory.java:91)
         at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.getOrCreateWsrService(WSModelInfo.java:420)
         ... 45 more
    Caused by: com.sap.engine.services.webservices.jaxrpc.exceptions.ProxyGeneratorException: Proxy Generator Error. Problem with WSDL file parsing. See nested message.
         at com.sap.engine.services.webservices.jaxrpc.wsdl2java.ProxyGenerator.generateProxy(ProxyGenerator.java:182)
         at com.sap.engine.services.webservices.espbase.client.dynamic.impl.DGenericServiceImpl.generateProxyFiles(DGenericServiceImpl.java:147)
         ... 49 more
    Caused by: com.sap.engine.lib.xml.util.NestedException: IO Exception occurred while parsing file:Connection reset -> java.net.SocketException: Connection reset
         at com.sap.engine.services.webservices.wsdl.WSDLDOMLoader.loadDOMDocument(WSDLDOMLoader.java:1039)
         at com.sap.engine.services.webservices.wsdl.WSDLDOMLoader.loadWSDLDocument(WSDLDOMLoader.java:1126)
         at com.sap.engine.services.webservices.jaxrpc.wsdl2java.ProxyGenerator.generateProxy(ProxyGenerator.java:178)
         ... 50 more
    Caused by: java.net.SocketException: Connection reset
         at java.net.SocketInputStream.read(SocketInputStream.java:168)
         at java.io.BufferedInputStream.read1(BufferedInputStream.java:220)
         at java.io.BufferedInputStream.read(BufferedInputStream.java:277)
         at java.io.BufferedInputStream.read1(BufferedInputStream.java:220)
         at java.io.BufferedInputStream.read(BufferedInputStream.java:277)
         at com.sap.engine.services.webservices.jaxm.soap.LimitedInputStream.read(LimitedInputStream.java:61)
         at com.sap.engine.lib.xml.parser.readers.EncodedDataReader.readData(EncodedDataReader.java:269)
         at com.sap.engine.lib.xml.parser.readers.EncodedDataReader.fetchData(EncodedDataReader.java:332)
         at com.sap.engine.lib.xml.parser.readers.EncodedDataReader.read(EncodedDataReader.java:165)
         at com.sap.engine.lib.xml.parser.helpers.AdvancedXMLStreamReader.read(AdvancedXMLStreamReader.java:143)
         at com.sap.engine.lib.xml.parser.helpers.AdvancedXMLStreamReader.addInputFromInputStream(AdvancedXMLStreamReader.java:292)
         at com.sap.engine.lib.xml.parser.XMLParser.parse0(XMLParser.java:220)
         at com.sap.engine.lib.xml.parser.AbstractXMLParser.parseAndCatchException(AbstractXMLParser.java:145)
         at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:160)
         at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:261)
         at com.sap.engine.lib.xml.parser.Parser.parseWithoutSchemaValidationProcessing(Parser.java:280)
         at com.sap.engine.lib.xml.parser.Parser.parse(Parser.java:342)
         at com.sap.engine.lib.xml.parser.DOMParser.parse(DOMParser.java:101)
         at com.sap.engine.lib.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:127)
         at com.sap.engine.services.webservices.wsdl.WSDLDOMLoader.loadDOMDocument(WSDLDOMLoader.java:1023)
         ... 52 more
    Thanks and regards,
    Mayuresh
    Edited by: Mayuresh Kanvinde on Mar 28, 2008 1:10 PM

  • Strange SocketException

    I'm writing a server-client software, with the client being an Applet and the server running at the webserver. As it is now it works just perfectly on most computers, actually all but one that I tried - which I find strange.
    Here's a snippet of what is causing the problem:
    private InputStream   in;
    private Socket        socket;
    try
        socket = new Socket(host, port);
        in = socket.getInputStream();
        socket.shutdownOutput();
    catch(Exception e)
        e.printStackTrace();
    try
        int bc = in.read(b, 0, bufferSize);
    catch(SocketException se)
        se.printStackTrace();
    }Quite a bit is left out, but nothing that should be able to interfer with this. As I said, this works at all computers I've tried this on, different geographical positions, different connection speeds, both UNIX and WinXP. EXCEPT one computer., when I run it the in.read(... causes the following exception:
    java.net.SocketException: Connection reset
    at java.net.SocketInputStream.read(Unknown Source)
    at gui.Receiver.run(ImageReceiver.java:119)
    This happens at the first read. If I test the socket with socket.isConnected() right before the read it returns true. I've tried with another computer at the same connection, and that one works.
    Why could that be that this particular computer resets the connection? Or why would the server reset the connection to this computer only? The configuration of the computer is:
    Windows XP
    Sun Java JRE 1.5_03
    Norton Internet Security, with all options set to default
    I've set up my own computer in, as far as I can see, the same way, but it works just fine....
    Any ideas?

    Well, the problem is not that I have a firewall that stops me.
    The problem is that other people has firewalls and this is supposed to be a component on a website. Of course if a user has a hardware firewall which drops packets there is not much I can do.
    However, I have two different new Socket(host, port) in the Applet, both connecting to the same host (of course the host the Applet comes from, due to Applet security restictions), but on different ports (at the server side). It seems like the other connection works, so Norton cannot block everything.
    To be more specific: When the Applet starts one of the first thing it does is to connect to the host at a predefined port where the server has a ServerSocket listening, this continously listens for new users that connect. A short while later on in the protocol the client gets a message including another port number to open another connection to, this is a port specific for this user. The server has a ServerSocket listening on that port and the client connects, but when the client later on is trying to read the InputStream of that socket the Exception above occurs.
    So howcome it works the first time, but not the second? The connections are made in the exact same way.

  • SocketException during reads - JVM_recv in socket input stream read

    I am getting a SocketException when a Java applet talks to our
    WebLogic 7.0 server. The catch is that it only occurs at one site
    (that has very high T1 utilization, although latency is only ~60 ms)
    Our setup is such that the calls hit an Alteon load balancer, which
    then sends the request out to one of 4 IIS clustered servers, where it
    then is sent to one of 2 WL clustered servers. I figured latency
    would be the cause, but on IIS and on WL, the timeouts are set to
    several hundred seconds, so I am not quite seeing where the connection
    is being reset. To be honest, I really don't know if it is WL that is
    killing the connection, as nothing abnormal shows up in the WL log. I
    have seen similar problems in this group, though, although the stack
    traces never follow the same path mine does. I do have the following
    call stack from the Java plug-in console, though. Any ideas would be
    greatly appreciated.
    java.net.SocketException: Connection reset by peer: JVM_recv in socket
    input stream read
         at java.net.SocketInputStream.socketRead0(Native Method)
         at java.net.SocketInputStream.read(Unknown Source)
         at java.io.BufferedInputStream.fill(Unknown Source)
         at java.io.BufferedInputStream.read1(Unknown Source)
         at java.io.BufferedInputStream.read(Unknown Source)
         at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
         at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
         at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
    Source)
         at sun.plugin.net.protocol.http.HttpURLConnection.getInputStream(Unknown
    Source)
         at sun.net.www.protocol.http.HttpURLConnection.getHeaderFields(Unknown
    Source)
         at sun.plugin.net.protocol.http.HttpURLConnection.checkCookieHeader(Unknown
    Source)
         at sun.plugin.net.protocol.http.HttpURLConnection.getInputStream(Unknown
    Source)
         at org.xxxx.abstracts.Controller.sendRequest(Controller.java:39)
         at org.xxxx.data.DataMediator.getDataNode(DataMediator.java:46)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Also, here is my code, although I can't see anything on the client
    side that seems off:
    public Object sendRequest( Object request, URL receiver ) throws
    Exception{
    Object response = null;
    URLConnection con = null;
    ObjectOutputStream out = null;
    ObjectInputStream in = null;
    try {
    con = receiver.openConnection();
    con.setDoInput(true);
    con.setDoOutput(true);
    con.setUseCaches(false);
    con.setDefaultUseCaches(false);
    con.setAllowUserInteraction(false);
    out = new ObjectOutputStream(con.getOutputStream());
    out.writeObject(request);
    out.flush();
    out.close();
    in = new ObjectInputStream(con.getInputStream());
    response = in.readObject();
    in.close();
    } catch (ClassCastException e) {
    if( out != null ){
    out.close();
    if( in != null ){
    in.close();
    } catch (Exception e) {
    if( out != null ){
    out.close();
    if( in != null ){
    in.close();
    throw e;
    return response;

    There is a known bug on earlier 1.3.1 releases with sockets on Windows 2k
    and XP. I don't remember all the details.
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    http://www.tangosol.com/coherence.jsp
    Tangosol Coherence: Clustered Replicated Cache for Weblogic
    "Keith Patrick" <[email protected]> wrote in message
    news:[email protected]...
    I'm getting the exception on the client, which is an XP machine, while
    the server is Win2K. I can't recall which, but either the applet or
    the server runs 1.3x while the other runs 1.4. I discounted that
    factor, though, as the problem only occurs on one site, which on all
    others it works fine.
    "Cameron Purdy" <[email protected]> wrote in message
    news:<[email protected]>...
    Exception is in the applet or on the server?
    Would one of those by any chance be running on W2K with JDK 131_01 orolder?
    >>
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    http://www.tangosol.com/coherence.jsp
    Tangosol Coherence: Clustered Replicated Cache for Weblogic
    "Keith Patrick" <[email protected]> wrote in message
    news:[email protected]...
    I am getting a SocketException when a Java applet talks to our
    WebLogic 7.0 server. The catch is that it only occurs at one site
    (that has very high T1 utilization, although latency is only ~60 ms)
    Our setup is such that the calls hit an Alteon load balancer, which
    then sends the request out to one of 4 IIS clustered servers, where it
    then is sent to one of 2 WL clustered servers. I figured latency
    would be the cause, but on IIS and on WL, the timeouts are set to
    several hundred seconds, so I am not quite seeing where the connection
    is being reset. To be honest, I really don't know if it is WL that is
    killing the connection, as nothing abnormal shows up in the WL log. I
    have seen similar problems in this group, though, although the stack
    traces never follow the same path mine does. I do have the following
    call stack from the Java plug-in console, though. Any ideas would be
    greatly appreciated.
    java.net.SocketException: Connection reset by peer: JVM_recv in socket
    input stream read
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(Unknown Source)
    at java.io.BufferedInputStream.fill(Unknown Source)
    at java.io.BufferedInputStream.read1(Unknown Source)
    at java.io.BufferedInputStream.read(Unknown Source)
    at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
    at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
    at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
    Source)
    at
    sun.plugin.net.protocol.http.HttpURLConnection.getInputStream(Unknown
    Source)
    at sun.net.www.protocol.http.HttpURLConnection.getHeaderFields(Unknown
    Source)
    atsun.plugin.net.protocol.http.HttpURLConnection.checkCookieHeader(Unknown
    Source)
    atsun.plugin.net.protocol.http.HttpURLConnection.getInputStream(Unknown
    Source)
    at org.xxxx.abstracts.Controller.sendRequest(Controller.java:39)
    at org.xxxx.data.DataMediator.getDataNode(DataMediator.java:46)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Also, here is my code, although I can't see anything on the client
    side that seems off:
    public Object sendRequest( Object request, URL receiver ) throws
    Exception{
    Object response = null;
    URLConnection con = null;
    ObjectOutputStream out = null;
    ObjectInputStream in = null;
    try {
    con = receiver.openConnection();
    con.setDoInput(true);
    con.setDoOutput(true);
    con.setUseCaches(false);
    con.setDefaultUseCaches(false);
    con.setAllowUserInteraction(false);
    out = new ObjectOutputStream(con.getOutputStream());
    out.writeObject(request);
    out.flush();
    out.close();
    in = new ObjectInputStream(con.getInputStream());
    response = in.readObject();
    in.close();
    } catch (ClassCastException e) {
    if( out != null ){
    out.close();
    if( in != null ){
    in.close();
    } catch (Exception e) {
    if( out != null ){
    out.close();
    if( in != null ){
    in.close();
    throw e;
    return response;

Maybe you are looking for