Socket output stream shutdown by peer

Hi all,
I'm trying to import ESS component into CMS transport studio development track. All other components are properly imported(EP_BUILDT,SAP_JTECHS,SAP_JEE,SAP_BUILDT).
The ESS import is getting failed with following error:
"Fatal Exception:com.sap.cms.tcs.interfaces.exceptions.TCSCommunicationException: communication error: VcmFailure received: Communication error [cause: Socket output stream shutdown by peer.]"
The detailed stack trace is:
Info:Starting Step Repository-import at 2006-12-06 16:23:56.0049 +5:00
Info:Component:sap.com/SAP_ESS
Info:Version  :MAIN_ERP05VAL_C.20060127161543
Info:1. PR is of type TCSSoftwareComponent
Fatal Exception:com.sap.cms.tcs.interfaces.exceptions.TCSCommunicationException: communication error: VcmFailure received: Communication error [cause: Socket output stream shutdown by peer.]:communication error: VcmFailure received: Communication error [cause: Socket output stream shutdown by peer.]
com.sap.cms.tcs.interfaces.exceptions.TCSCommunicationException: communication error: VcmFailure received: Communication error [cause: Socket output stream shutdown by peer.]
     at com.sap.cms.tcs.client.DTRCommunicator.integrateChangelist(DTRCommunicator.java:381)
     at com.sap.cms.tcs.core.RepositoryImportTask.processRepositoryImport(RepositoryImportTask.java:295)
     at com.sap.cms.tcs.core.RepositoryImportTask.process(RepositoryImportTask.java:500)
     at com.sap.cms.tcs.process.ProcessStep.processStep(ProcessStep.java:77)
     at com.sap.cms.tcs.process.ProcessStarter.process(ProcessStarter.java:179)
     at com.sap.cms.tcs.core.TCSManager.importPropagationRequests(TCSManager.java:376)
     at com.sap.cms.pcs.transport.importazione.ImportManager.importazione(ImportManager.java:216)
     at com.sap.cms.pcs.transport.importazione.ImportQueueHandler.execImport(ImportQueueHandler.java:585)
     at com.sap.cms.pcs.transport.importazione.ImportQueueHandler.startImport(ImportQueueHandler.java:101)
     at com.sap.cms.pcs.transport.proxy.CmsTransportProxyBean.startImport(CmsTransportProxyBean.java:583)
     at com.sap.cms.pcs.transport.proxy.CmsTransportProxyBean.startImport(CmsTransportProxyBean.java:559)
     at com.sap.cms.pcs.transport.proxy.LocalCmsTransportProxyLocalObjectImpl0.startImport(LocalCmsTransportProxyLocalObjectImpl0.java:1640)
     at com.sap.cms.ui.wl.Custom1.importQueue(Custom1.java:1169)
     at com.sap.cms.ui.wl.wdp.InternalCustom1.importQueue(InternalCustom1.java:2162)
     at com.sap.cms.ui.wl.Worklist.onActionImportQueue(Worklist.java:880)
     at com.sap.cms.ui.wl.wdp.InternalWorklist.wdInvokeEventHandler(InternalWorklist.java:2338)
     at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
     at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)
     at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doHandleActionEvent(WindowPhaseModel.java:422)
     at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:133)
     at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:344)
     at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
     at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:298)
     at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:705)
     at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:659)
     at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:227)
     at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:150)
     at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:56)
     at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:47)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
     at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
     at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
     at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
     at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
     at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
     at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
     at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
     at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
     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)
Info:Step Repository-import ended with result 'fatal error' ,stopping execution at 2006-12-06 16:42:07.0027 +5:00
Any clues on which output stream is getting shut???
regards,
avadh

Hi Pascal,
yup, There is enough free space available. Java heap size is also adequate(1024).
I have been through most of the threads on this topic, and have re-checked everything.
Still, the problem persists.
Any ideas??
regards,
avadh

Similar Messages

  • TCSCommunicationException VcmFailure  Socket output stream shutdown by peer

    Hi,
    I am trying to install NWDI 2004s SP 11 and have imported the following SCA
    JTECHS, JEE, BUILDT, but while importing ESS, MSS SCA I am getting the following error:
    Exception:com.sap.cms.tcs.interfaces.exceptions.TCSCommunicationException: communication error: VcmFailure received: Communication error [cause: Socket output stream shutdown by peer.]:communication error: VcmFailure received: Communication error [cause: Socket output stream shutdown by peer.]
    com.sap.cms.tcs.interfaces.exceptions.TCSCommunicationException: communication error: VcmFailure received: Communication error [cause: Socket output stream shutdown by peer.]
    It is failing in the first step:
    Repository import: ESS import failed.
    Have checked notes mentioned in threads with similar issues, but didnt help my issue.
    Points assured to the right answer
    Regards,
    Anish

    Hi Guys,
    I have installed the sneak preview 04s SR 1  version and still facing issues while Importing ESS SCA, please let me know how to resolve it.
    The defaulttrace.trc says some table / view is missing not able to figure out how to deal with this...
    Processing HTTP request to servlet [DTRServlet] finished with error.
    The error is: javax.servlet.ServletException: The SQL statement "UPDATE "DAV_RESOURCE" SET "RESOURCETYPE" = ?,"MODIFICATIONTIME" = ? WHERE "RESOURCEID" IN (SELECT "VSE1"."VERSIONID" FROM "PVC_ACTVERSVIEW" "VSE1" INNER JOIN "PVC_ACTVERSVIEW" "VSE2" ON "VSE1"."VERSIONID" = "VSE2"."VERSIONID" WHERE "VSE1"."VERSIONSETID" = ? AND "VSE2"."VERSIONSETID" = ?) AND "RESOURCETYPE" <> ?" contains the semantics error[s]: - 1:139 - the table or view >>PVC_ACTVERSVIEW<< does not exist
    CMS Trace says ....
    Exc=com.sap.cms.tcs.interfaces.exceptions.TCSCommunicationException: communication error: VcmFailure received: Internal Server Error [(pre||post)-condition failed: Internal Server Error]
    I tried out many notes .... any help on this would be appreciated ...
    Regards,
    Anish

  • IO error: Socket output stream shutdown by peer when trying to import DCs

    Hi,
    I am getting this error when trying to import DCs.
    com.sap.lcr.api.cimclient.CIMClientException: IO error: Socket output stream shutdown by peer
    I am specifying the SDM host, similar to J2EE URL I guess along with SDM port in Development configuration pool URL.
    Can some one guide me if I am missing some thing or some thinkg else is going wrong.
    Any help or suggestion will be very helpful to me.
    Thanks and regards,
    Chinnu

    Hi Nithn,
    Thank you for the response.
    It is due to issue in track configuration.
    Build Server and Repository server URLs are not Fully qualified domain names.
    Made a host entry and I was able to import the configuration.
    Thanks and regards,
    Chinnu

  • Single socket, multiple streams?

    Hey,
    I'm currently fiddling around writing an Instant Messenger, and expecting a problem.
    Basically across the same socket I'll be sending messages (user-user), other client messages and small loads of image data.
    I'm thinking concidering it's a single stream all information will be queued, for instance if:
    1. The server is sending, lets say a 700mb file through the one socket (wouldn't happen, but to show my point).
    2. Users are trying to message the user recieving the 700mb file through the same socket/connection.
    Basically the way I'm seeing it is the messages the users are trying to send to the user won't go through untill the 700mb file is done sending because it was set first.
    In short: Do socket output streams queue data in a way that messages will be withheld untill other information goes through? And if so how would I avoid this?
    Thanks in advance,
    Danny.

    Thanks for the help, I'll look into it.
    When I said messages I meant in the IM sense, just to show an example of where I believe the problem would have occured.
    I think multiple socket connections may be the way to go, one for general protocol data and another (when needed) for image data.
    Thanks again :)

  • IOException: Connection reset by peer: JVM_recv in socket input stream read

    hi
    I encountered a problem : a program throw out an exception:java.io.IOException: Io exception:
    Connection reset by peer: JVM_recv in socket input stream read.
    I tried my best to resolve it ,but unfortunately,i didn't know what caused the exception.
    the following is my application environment:
    I have two PC(Win2000os),one is a server which installed oracle9.2.0.2 and jdeveloper9.0.3,the another is a
    client which only intalled jdeveloper9.0.3.Two days ago,i performed a web application on my client with
    jdeveloper,and it includes some JSP and a javabean files.JSP Page finished uploading client xml file to a
    folder on server and the javabean finished loading the xml file into a xmltype column.I can make sure the
    connection is established and the javabean is OK,beacause my some jsp page can successfully use
    <jsp:usebean> tag and use the javabean's some other public interfaces,except the interface that finishs
    loading the xml file into a xmltype(clob) column.
    Then i do many tests!I changed the javabean to a java class incluse a main method beacause it is easy to
    debug.Finally i found the following code caused the exception:
    public CLOB writetoClob( CLOB clob, InputStream is )throws SQLException, IOException {
    InputStreamReader reader = new InputStreamReader( is );
    Writer writer = clob.getCharacterOutputStream( );
    char[] buffer = new char[clob.getChunkSize(  )];
    int charsRead;
    for ( charsRead = reader.read( buffer ); charsRead > -1;charsRead = reader.read( buffer ) ) {
    writer.write( buffer, 0, charsRead );
    writer.close();
    return clob;
    when it runs to writer.close(),the exception is caused!
    Then i copy the java class to the server,it runs ok!
    That is to say ,the same code,the different result!
    But when i run my web application on server with jdeveloper Embedded OC4J Server and a jsp page loaded javabean
    and run to mentioned code ,the same exception occured!
    I checked the application log in event viewer,the descriptions was:
    The data buffer created for the "AppleTalk" service in the "C:\WINNT\system32\atkctrs.dll" library is not
    aligned on an 8-byte boundary. This may cause problems for applications that are trying to read the
    performance data buffer. Contact the manufacturer of this library or service to have this problem corrected or
    to get a newer version of this library.
    I search some some resolution about this exception with web and someone sayed :
    This basically means that a network error occurred while the client was receiving data from the server. But
    what is really happening is that the server actually accepts the connection, processes the request, and sends a
    reply to the client. However, when the server closes the socket, the client believes that the connection has
    been terminated abnormally because the socket implementation sends a TCP reset segment telling the client to
    throw away the data and report an error.
    Sometimes, this problem is caused by not properly closing the input/output streams and the socket connection.
    Make sure you close the input/output streams and socket connection properly. If everything is closed properly,
    however, and the problem persists, you can work around it by adding Thread.sleep(1000) before closing the
    streams and the socket. This technique, however, is not reliable and may not work on all systems.
    In general,the following information is conclution:
    Web application runs error both on client and on server.
    If it was changed to a client java class,it only run ok on server!
    i have done anything that i can do now,i feel depressed very much!
    how can i resolve the problem!
    Any a little help will be appreciated!
    regards!
    Thanks
    Jiawei ZHAO

    How can i solve the problem.
    Thanks in advance!
    Jiawei Zhao

  • Facing error in creating ObjectInput/output stream socket

    hi I am Jatandar and i am implemeint client server program which will be using object Input/Output stream to pass data through sockets . The problem is the i m getting error when the cleint connects to the server here is the server and client code , YOur help will be appreciated
    Inventory class with serializable has been implemented
    public class Client
    public static void main( String [] args )//throws IOException
    Inventory invt[];
    try
    Socket serv = new Socket( "localhost", 8000 );
    // connect to server at port 8000
              ObjectInputStream ois ;     
    ois= new ObjectInputStream(serv.getInputStream());
    invt=(Inventory[]) ois.readObject() ;
    System.out.println(invt[0]);
    catch(IOException e )
    System.out.println(" no server Found \n");
    catch(Exception e)
    System.out.println(e);
    public class A3Server
         public static void main(String arg[] ) throws IOException
              //create a Server Socet
              ServerSocket ss= new ServerSocket(8000) ;
              ObjectOutputStream oos;
              //create a clent Socker that will listen for connection
              //listen for the connection from client
              BufferedReader br=null;
              FileReader fr=null;
              LinkedList ll=new LinkedList();
              StringTokenizer stkr;
              int i=0;
              Inventory inv=new Inventory();
              Inventory invt[];
              String t[]=new String[5];
              boolean choice=true;
              String temp="",temp2;
    // i am reading a text which contain data
    //that data is stored in invt []
    //that array is transfered to clien t when it is connected
         Socket toClient= ss.accept();
    oos = new ObjectOutputStream(toClient.getOutputStream());
    oos.writeObject(invt );
         oos.close();     
              }// end of main fucniton
         }//end of Server class
    DETAIL OF ERROR
    error in natived socket write method

    hi I am Jatandar and i am implemeint client server program which will be using object Input/Output stream to pass data through sockets . The problem is the i m getting error when the cleint connects to the server here is the server and client code , YOur help will be appreciated
    Inventory class with serializable has been implemented
    public class Client
    public static void main( String [] args )//throws IOException
    Inventory invt[];
    try
    Socket serv = new Socket( "localhost", 8000 );
    // connect to server at port 8000
              ObjectInputStream ois ;     
    ois= new ObjectInputStream(serv.getInputStream());
    invt=(Inventory[]) ois.readObject() ;
    System.out.println(invt[0]);
    catch(IOException e )
    System.out.println(" no server Found \n");
    catch(Exception e)
    System.out.println(e);
    public class A3Server
         public static void main(String arg[] ) throws IOException
              //create a Server Socet
              ServerSocket ss= new ServerSocket(8000) ;
              ObjectOutputStream oos;
              //create a clent Socker that will listen for connection
              //listen for the connection from client
              BufferedReader br=null;
              FileReader fr=null;
              LinkedList ll=new LinkedList();
              StringTokenizer stkr;
              int i=0;
              Inventory inv=new Inventory();
              Inventory invt[];
              String t[]=new String[5];
              boolean choice=true;
              String temp="",temp2;
    // i am reading a text which contain data
    //that data is stored in invt []
    //that array is transfered to clien t when it is connected
         Socket toClient= ss.accept();
    oos = new ObjectOutputStream(toClient.getOutputStream());
    oos.writeObject(invt );
         oos.close();     
              }// end of main fucniton
         }//end of Server class
    DETAIL OF ERROR
    error in natived socket write method

  • JDBC Connection reset by peer: JVM_recv in socket input stream read

    Hey Guys,
    Has anyone seen this issue? We get this error in our Weblogic app logs at times and no one is able to login to our application. Our database server and SQL server seem fine at a high level. Any ideas what is causing this?
    com.s1.arch.persistence.exception.PersistenceException weblogic.jdbc.mssqlserver4.TdsException: I/O exception while talking to the server, java.net.SocketException: Connection reset by peer: JVM_recv in socket input stream read
    Thanks

    please make sure that there is no Firewall between your servers and DB server. this message usually happen when there is a fire wall between the servers. if yes please make sure that the connection time on fire wall is longer than the time needed to complete an operation another thing that you need to check if you have a fire wall which is to make sure that Oracle DBMS return the request to the same port that it is listening to (1521 default).

  • Fetching a URL  from a socket output or input stream in a proxy server

    We have written a proxy server in java .
    It connects with a client on some local port and forwards the request of the client to main server through socket connections.
    The code is as follows...
    * BasicProxyServer.java
    * A simple multithreaded proxy server.
    * A client connects to theserver. The server starts a
    * separate threads for data flow though two Sockets.
    * The first socket communicates with the socket of the client.
    * The second socket is used to communcate with the main server
    * for which this server is a proxy. The sockets are connected by pipes.
    import java.net.*;
    import java.io.*;
    public class BasicProxyServer {
         private static int serverPort;
         private static String primaryServerHost;
         private static int primaryServerPort;
         // 1st arg: port to listen on
         // 2nd arg: primary server IP
         // 3rd arg: primary server port
         public static void main(String [] args) {
              serverPort = Integer.parseInt(args[0]);
              primaryServerHost = args[1];
              primaryServerPort = Integer.parseInt(args[2]);
              BasicServer bserv = new BasicServer(serverPort,primaryServerHost,primaryServerPort);
    class BasicServer extends Thread {
         private int serverPort;
         private String primaryHost;
         private int primaryPort;
         private ServerSocket servSock = null;
         public BasicServer(int port, String primSrv, int primPort) {
              serverPort = port;
              primaryHost = primSrv;
              primaryPort = primPort;
              start();
         public void run() {
              Socket clientSock = null;
              Socket primaryServerSock = null;
              try {
                   servSock = new ServerSocket(serverPort);
              catch (IOException e) {
                   e.printStackTrace();
              while(true) {
                   try {
                        clientSock = servSock.accept();
                        primaryServerSock = new Socket(primaryHost, primaryPort);
                        PipedInputStream fromClient = new PipedInputStream();
                        PipedOutputStream toMainServer = new PipedOutputStream(fromClient);
                        PipedInputStream fromMainServer = new PipedInputStream();
                        PipedOutputStream toClient = new PipedOutputStream(fromMainServer);
                        Talk clientToMainServer = new Talk(clientSock, fromClient, primaryServerSock, toMainServer);
                        Talk mainServerToClient = new Talk(primaryServerSock, fromMainServer, clientSock, toClient);
                        clientToMainServer.start();
                        mainServerToClient.start();
                   catch (IOException e) {
                        e.printStackTrace();
         // Override finalize() to close server socket
    protected void finalize() {
    if (servSock != null) {
    try {
    servSock.close();
    } catch (IOException e) {
    e.printStackTrace();
    servSock = null;
    class Talk extends Thread {
         private Socket incoming;
         private Socket outgoing;
         private InputStream in;
         private OutputStream out;
         private InputStream from;
         private OutputStream to;
         Talk(Socket inSock, InputStream in, Socket outSock, OutputStream out) {
              this.in = in;
              this.out = out;
              incoming = inSock;
              outgoing = outSock;
         public void run() {
              int aByte;
              try {
                   from = incoming.getInputStream();
                   to = outgoing.getOutputStream();          
                   while(( aByte = from.read()) != -1 ) {     //read from socket
                        out.write(aByte);     // write to pipe`
                        // read the byte from the pipe
                        to.write(in.read());          // write it to the output socket stream
                        to.flush();
                   to.close();
                   from.close();
                   if(incoming != null) {
                        incoming.close();
                        incoming = null;
                   if(outgoing != null) {
                        outgoing.close();
                        outgoing = null;
              catch (SocketException e) {
              // there is one for a closed socket. Seems to have no effect.
              //     e.printStackTrace();
              catch (IOException e) {
                   e.printStackTrace();
    Here,when client gives any URL in the address bar in the web browser the request is forwarded to this proxy server.
    We want to fetch the URL which client enters in order to implement content filtering and also store the most visited sites by each user .
    But we don't know how to fetch the URL from the socket input or output stream.
    Can you suggest any suitable solution for the same??

    Shailesh24 wrote:
    We want to fetch the URL which client enters in order to implement content filtering and also store the most visited sites by each user .
    But we don't know how to fetch the URL from the socket input or output stream.
    Can you suggest any suitable solution for the same??Yes. Write a proxy server that actually speaks HTTP.

  • Io exception: Connection reset by peer: JVM_recv in socket input stream read

    We are developing a new J2EE app using JDev, OC4J, servlets, and EJBs. We have determined that our firewall is closing database connections that have been idle for 1 hour. This is a security requirement that cannot be changed. When we try to use these idle connections in both stateless and entity beans, we consistently receive this or a similar error message:
    "ServletSACategoryList: Error invoking EJB procedure. Exception: java.sql.SQLException: StatelessSysAdminBean::getCategoryList - Io exception: Connection reset by peer: JVM_recv in socket input stream read "
    Environment:
    Oracle 9iAS 9.0.2.0.0
    Database: Oracle 8.1.7
    JDBC 8.1.7
    JDK 1.3
    JDev 9.0.2.829
    We are using the ejb-location attribute within data-sources.xml for JNDI lookup of the DataSource. Here is what this file looks like:
    <data-sources>
    <data-source
    class="oracle.jdbc.pool.OracleDataSource"
    name="jdbc/OracleDS"
    location="jdbc/OracleCoreDS"
    xa-location="jdbc/xa/OracleXADS"
    ejb-location="jdbc/OraclePoolDS"
    url="jdbc:oracle:thin:@###.###.#.###:1521:dev1"
    connection-driver="oracle.jdbc.driver.OracleDriver"
    username="????????"
    password="????????"
    max-connections="4"
    wait-timeout="20"
    min-connections="1"
    inactivity-timeout="60"
    connection-retry-interval="1"
    max-connect-attempts="3"
    />
    </data-sources>
    After calling getConnection() on the Connection object in my stateless bean, I have tried checking if the Connection object is null or isClosed(), I have caught any Exception, and looped to try again, but nothing has worked.
    Please respond to [email protected] or directly to this post if you can help in any way.
    Thank you,
    - Rob

    Hi Robert,
    If you don't mind, I can only offer a few suggestions for things
    to try -- I'm afraid I don't have a solution for you. Of-course,
    you may have already tried these things, so please excuse me if
    this is the case.
    Firstly, your "data-sources.xml" file looks "different". Have
    you read the "Data Sources" chapter of the "Oracle9iAS Containers
    for J2EE Services Guide, Release 2 (9.0.2)"? It is accessible
    from here:
    http://otn.oracle.com/docs/products/ias/doc_library/90200doc_otn/web.902/a95879/ds.htm#1004903
    Also, have you tried running OC4J in "debug" mode? This web
    page has more details:
    http://kb.atlassian.com/content/atlassian/howto/orionproperties.jsp
    I get the impression from the information you have supplied,
    that you may not be explicitly closing your database connections
    in your code. It looks to me like you are obtaining a database
    connection in your session bean, and then keeping it for the
    lifetime of that bean. Is that correct? I think it's better
    to obtain a connection when you need to interact with the database,
    and then close the connection immediately after completing the
    interaction with the database (but that's just my opinion).
    Lastly, if you haven't already discovered them, these web sites
    may also be of help:
    http://www.orionserver.com
    http://www.orionsupport.com
    http://www.elephantwalker.com
    Hope this helps you.
    Good Luck,
    Avi.

  • Connection reset by peer: JVM_recv in socket input stream read

    Dear All,
    We are facing a very unusual problem. In our application, there is a functionality to transfer files to a FTP server using java FTPClient.
    Now while transferring set of files, few times it throws the error:
    Connection reset by peer: JVM_recv in socket input stream read
    This error comes irregularly.
    Can you suggest the reason for this.
    Regards,
    Akhil

    which platform are you using? which ip stack , ipv4 or ipv6?
    try to set -Djava.net.preferIPv4Stack="true" when startup,
    it will use ipv4 stack instead of default ipv6 on solaris.

  • Java Sockets and Output Streams

    Hi All,
    I am beginning sockets programming and I have a problem. If there is a server listening in the background for incoming connections and say for example 4 client programs programs which we shall call client1...client4 connect. How best can I capture the output streams associated with these newly created sockets so that the server can send back isome nformation to say clients1 and client4 only which is not seen by clients 2 and 3. Similarly I would like the server to send some infor to clients 2 and 3 only which is not seen by client1 and client 4.
    Currently I have the server listening part as shown below, but not too sure how to add DISTINCT output streams for 1 and 4 on one hand and 2 and 3 on the other.
    Thanks:
    // bind socket to a port number
    ServerSocket serverSocket = new ServerSocket(portNo);
    // create socket to listen to client connection
    while (true) {
    //listen to an incoming connection
    System.out.println("chatroom server waiting for incoming connections");
    Socket incomingSocket = serverSocket.accept();
    //launch new thread to take care of new connection
    chatRoomThread chatThread = new chatRoomThread(incomingSocket);
    chatThread.start();
    //go back and wait for next connection
    Please help.
    Thanks,
    Bleak

    HouseofHunger wrote:
    yes thats exactly the way I have my in and out streams, in the run method, but that doesn't help me in filtering traffic, in other words I am saying 2 clients, client1 and client4 for example should share a common in and out stream so that they will see eact other's messages... makes sense.....?No, doesn't make sense. That's the wrong design. Each socket should have its own input and output stream (yes, I know, that's been said several times before). If messages going to client1 should also be sent to client4, then whatever writes the messages to client1's output stream must also write them to client4's output stream. Trying to make those two output streams actually be the same output stream is the wrong way to do that. Just have the controller send the messages to whoever is supposed to get them.

  • Socket input / output stream

    Does anyone know if the input / output streams returned by getInputStream() / getOutputStream() in java.net.Socket are buffered by default?

    y they are buffered, but to use the buffer, you have to use available() and read(byte[] buf ...

  • Get multiple Input/Output Stream from same socket ?

    For a better express of my problem i will put my test example
    I have those 4 classes
    package test;
    import...
    public class ReaderExecutor extends Thread{
            private InputStream in = null;
            private static int defaultID = 0;
            private int ID = getID();
            public ReaderExecutor(InputStream in){
                this.in = in;
            public void run(){
                try {
                    int c ;
                    while ((c=in.read())!=-1)
                        System.out.println("ReaderThread " + this.ID + ":" + c);
                catch (IOException e) {
                    System.out.println("ReaderThread "+this.ID+" stopped !");
            private static int getID(){
                return defaultID++;
    package test;
    import...
    public class WriterExecuter extends Thread{
        OutputStream out = null;
        private static boolean odd = true;
        private boolean isOdd ;
        public WriterExecuter(OutputStream out) {
            this.out = out;
            isOdd = odd;
            odd = !odd;
        public void run(){
            try{
                for (int i = isOdd?1:2;i<10;i+=2){
                    System.err.println(i);
                    out.write(i);
            }catch(Exception e){
                System.out.println("WriterThread stopped !");
    package test;
    import...
    public class Main { 
        public Main() {
        public static void main(String[] args) throws Exception {
            try{
                ServerSocket ss = new ServerSocket(9090);
                System.out.println("Ascult ... ");
                Socket client = ss.accept();
                new ReaderExecutor(client.getInputStream()).start();
                //Thread.sleep(2000);
                new ReaderExecutor(client.getInputStream()).start();
            }catch (Exception e){
                e.printStackTrace();
    package test;
    import...
    public class Main1 {
        public Main1() {
        public static void main(String[] args) {
            try{
                Socket s = new Socket("localhost",9090);
                WriterExecuter t= null ;
                t = new WriterExecuter(s.getOutputStream());
                t.start();
                t = new WriterExecuter(s.getOutputStream());
                t.start();
            }catch(Exception e){
                e.printStackTrace();
    }Now if i run successive Main , Main1 i get this output
    Ascult ...
    ReaderThread 0:0
    ReaderThread 1:0
    ReaderThread 0:0
    ReaderThread 1:0
    ReaderThread 0:0
    ReaderThread 1:0
    ReaderThread 0:0
    ReaderThread 1:0
    ReaderThread 0:0
    ReaderThread 0 stopped !
    ReaderThread 1 stopped !The question is can i get other Input/Output individual streams with a separate logic functionality from the same socket?
    From this example it seems i can't :(
    Thx
    Alex

    For what you are trying to do the simplest solution is to have one socket per "stream" that is the way they are designed to be used.
    However, you can multiplex multiple stream over a single socket, but you have do the coding yourself or use a solution which does this for you e.g. JMS. (There is no support at the socket level for this)

  • Is there a way to flush out a socket's output stream without...

    ...having to close it (the stream)?
    I'm trying to implement a keep-alive feature in a simple HTTP Server application. This is a draft of the code I have trouble with:
    ==========
    //'clientSocket' is the socket obtained by the 'serverSocket.accept()' method
    OutputStream out = clientSocket.getOutputStream();
    //'message' is a string to be sent to the client
    InputStream data = new ByteArrayInputStream(message.getBytes());
    byte[] buff = new byte[2048];
    while (true)
    int read = data.read(buff, 0, 2048);
    if (read <= 0)
    break;
    out.write(buff, 0, read);
    out.flush();
    ==========
    If I don't call 'out.close()', the data will not be sent to the client.
    If I call 'out.close()', the data will be sent, but the socket will be closed too, which I don't want to. I need to be able to reuse that socket .
    Is there any way to properly push out the data to the client without having to close the output stream?

    ...having to close it (the stream)?Yes. OutputStream.flush(). But if you're not using any kind of buffered writer/output stream you don't even have to do that.
    If I don't call 'out.close()', the data will not be sent to the client.Untrue. The client will read everything that has been written If you don't close the output stream, the client will never get the EOS indication (e.g. read() returning -1). So if your client is looping until that happens it will loop forever ...
    Your problem at the moment is at the reading end.

  • JVM_recv in socket input stream error

    I've opened a socket and I'm able to access the OutputStream. However, when I try to wrap a ObjectInputStream around the socket's InputStream, I get this error:
    SocketException: Connection reset by peer: JVM_recv in socket input stream read.
    What should I be looking for?
    Larry

    Here's the code which appears to be relevant, with some commentary on what happens when it is run. Large portions of (hopefully) irrelevant code have been snipped.
    Client:
    COMMENT: Start a server using RMI. This appears to
    COMMENT: succeed, since a message printed by this
    COMMENT: server does appear.
    try {
    DistLrnRemoteData dlrd =
    (DistLrnRemoteData)Naming.lookup(
    "//"+personHost+
    "/DistanceLearningData");
    dlrd.activatePersonServer(); // Get server going
    catch (Exception e) {
    System.err.println(e);
    COMMENT: This line is NOT printed, so apparently
    COMMENT: there is no Exception.
    System.err.println("Unable to initialize remote Person server");
    e.printStackTrace(System.err);
    Person result = new Person();
    int count = 10;
    boolean opened = false;
    Socket gpsocket = null;
    while (!opened) {
    try {
    COMMENT: The client attempts to open the socket
    COMMENT: here. The server never seems to accept it,
    COMMENT: but this call appears to succeed. There is
    COMMENT: no Exception. The server is running code
    COMMENT: from the class RemoteDataServer, so the
    COMMENT: port should be the same. The testing was
    COMMENT: done with a single host acting as both
    COMMENT: client and server, so there isn't any firewall
    COMMENT: or network outage problem.
    gpsocket = new Socket(personHost,
    RemoteDataServer.personReadPort);
    opened = true;
    catch (IOException ioe) {
    count--;
    if (count <= 0) {
    COMMENT: This line is NOT printed, so apparently there
    COMMENT: is no IOException when the Socket is
    COMMENT: created. Nor does an UnknownHostException
    COMMENT: or SecurityException stop the program.
    System.err.println(ioe);
    ioe.printStackTrace(System.err);
    result = null;
    return result;
    try {
    Thread.sleep(1000);
    catch (InterruptedException ie) {
    System.err.println(ie);
    ie.printStackTrace(System.err);
    // Read the serialized object
    try {
    COMMENT: No problem with the next line, which attempts
    COMMENT: to access the OutputStream of the socket.
    MyStringWriter msw = new MyStringWriter(
    gpsocket.getOutputStream());
    COMMENT: The next line causes the message.
    ObjectInputStream ois =
    new ObjectInputStream(gpsocket.getInputStream());
    msw.write(personRealName);
    // Now read the resulting Person.
    try {
    result = (Person)(ois.readObject());
    catch (ClassNotFoundException cnfe) {
    System.err.println(cnfe);
    cnfe.printStackTrace(System.err);
    System.exit(4);
    catch (IOException ioe) {
    System.err.println(ioe);
    ioe.printStackTrace(System.err);
    result = null;
    Server:
    public void activateFocusServer() throws java.rmi.RemoteException {
    String [] cmd = new String[2];
    cmd[0] = new String("java");
    cmd[1] = new String("RemoteDataServer");
    try {
    COMMENT: FORTE's Output window shows a message
    COMMENT: from this process
    Process dbserver =
    Runtime.getRuntime().exec(cmd); // Server will self-destruct
    // after a timeout period
    catch (IOException ioe) {
    COMMENT: This message is never printed
    System.err.println(ioe);
    ioe.printStackTrace(System.err);
    RemoteDataServer:
    public RemoteDataServer() {
    try {
    ...many different servers started here...
    ServerSocket PersonReadSocket = new ServerSocket(personReadPort);
    PersonReadListener prl = new PersonReadListener(PersonReadSocket);
    prl.start();
    catch (IOException ioe) {
    COMMENT: This message is never printed.
    System.err.println(ioe);
    ioe.printStackTrace(System.err);
    COMMENT: PersonReadListener is an inner class:
    class PersonReadListener extends java.lang.Thread {
    private Thread BaseThread;
    private ServerSocket theSocket;
    /** Creates an object to listen for PersonRead requests
    * @param ss The server socket to listen with
    public PersonReadListener(ServerSocket ss) {
    theSocket = ss;
    /** Initializes the thread to listen for PersonRead requests
    public void start() {
    BaseThread = new Thread(this);
    BaseThread.start();
    /** The code for the server to listen for PersonRead requests
    public void run() {
    while(true) {
    try {
    COMMENT: This code doesn't have access to System.err
    COMMENT: so a file is created to print debugging output
    PrintWriter debug = new PrintWriter(new FileWriter("person.debug"));
    COMMENT: The next line IS printed, so the server gets
    COMMENT: this far.
    debug.println("Waiting for connection for person's name");
    debug.close();
    PersonReadClientConnection someone =
    new PersonReadClientConnection(theSocket.accept());
    COMMENT: If the previous "debug.close" line is
    COMMENT: commented out and the next two lines are
    COMMENT: uncommented, the next line is NOT
    COMMENT: printed, so apparently the accept nevers
    COMMENT: happens! Why does the accept fail, but
    COMMENT: the client's socket creation succeed?
    // debug.println("Accepted a connection");
    // debug.close();
    someone.start();
    catch (IOException ioe) {
    COMMENT: These lines are NOT printed
    System.err.println(ioe);
    ioe.printStackTrace(System.err);

Maybe you are looking for

  • Record settings -TV@nywhere master

    I am trying to bring some of my home videos into my PC from VHS on s-video.  I tried recording them in at "best" but every 6 seconds or so, there is a little glitch.  Usually the video kind of holds or hangs before continuing on.  I do not notice any

  • Firefox use 100% of one CPU (Mac)

    I use last firefox (32) on MacOS X 10.6.8. Sometime firefox start using 100% a one CPU, from that time the only way to stop it was to quit (it take severals seconds, sometime it hang). When it start i can close all windows, firefox continue using 100

  • Structure of jdbc

    Hello, I need to insert from a file to a JDBC table. The database table has lots of values ,but i need to insert just a few of them. While i create a structure of the table in the data types, do i need to create the whole database table structure or

  • Cannot download bank statements and shopping orders since update

    for instance,..when I shop at Tesco,...I try to download the shoppping list,...I get the main headings and outlay,.. and the liost is complete,...but when I try to print,...the items are left out from the list,..If I use IE,...I can d'load without pr

  • My Ipod is showing black screen

    It has just totally stopped working. Screen is black ?Is there anything to fix this?