Solved

java.net.SocketException: socket write error (code=10053)

Posted on 2001-06-18
5
606 Views
Last Modified: 2008-02-01
Hi All,

I got socketexception and here I am sending entire error message.it is urgent so I would be appreciated if any one can help me.

starting com.peco.montage.servlet.GetLookupObjectsServlet Servlet...
java.net.SocketException: socket write error (code=10053)
      java.lang.Throwable(java.lang.String)
      java.lang.Exception(java.lang.String)
      java.io.IOException(java.lang.String)
      java.net.SocketException(java.lang.String)
      void java.net.SocketOutputStream.socketWrite(byte [], int, int, java.io.FileDescriptor)
      void java.net.SocketOutputStream.write(byte [], int, int)
      void com.ibm.servlet.engine.http_transport.HttpTransportConnection.write(byte [], int, int)
      void com.ibm.servlet.engine.srp.SRPConnection.write(byte [], int, int)
      void com.ibm.servlet.engine.srt.SRTOutputStream.write(byte [], int, int)
      void com.ibm.servlet.engine.webapp.BufferedServletOutputStream.writeOut(byte [], int, int)
      void com.ibm.servlet.engine.webapp.BufferedServletOutputStream.flushBytes()
      void com.ibm.servlet.engine.webapp.BufferedServletOutputStream.write(byte [], int, int)
      void java.io.ObjectOutputStream.drain()
      boolean java.io.ObjectOutputStream.setBlockData(boolean)
      void java.io.ObjectOutputStream.writeObject(java.lang.Object)
      void com.peco.montage.servlet.GetLookupObjectsServlet.writeObjects(java.io.ObjectOutputStream, java.lang.Object)
      void com.peco.montage.servlet.MontageServlet.doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
      void javax.servlet.http.HttpServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
      void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
      void com.ibm.servlet.engine.webapp.StrictServletInstance.doService(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
      void com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
      void com.ibm.servlet.engine.webapp.IdleServletState.service(com.ibm.servlet.engine.webapp.StrictLifecycleServlet, javax.servlet.ServletRequest, javax.servlet.ServletResponse)
      void com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
      void com.ibm.servlet.engine.webapp.ServletInstance.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse, com.ibm.servlet.engine.webapp.WebAppServletInvocationEvent)
      void com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(com.ibm.servlet.engine.webapp.ServletInstanceReference, javax.servlet.ServletRequest, javax.servlet.ServletResponse, com.ibm.servlet.engine.webapp.WebAppServletInvocationEvent)
      void com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(javax.servlet.ServletRequest, javax.servlet.ServletResponse, com.ibm.servlet.engine.webapp.WebAppServletInvocationEvent)
      void com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(com.ibm.servlet.engine.webapp.WebAppRequest, com.ibm.servlet.engine.webapp.WebAppResponse, boolean)
      void com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(javax.servlet.ServletRequest, javax.servlet.ServletResponse, boolean)
      void com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
      void com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(java.lang.Object)
      void com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(java.lang.Object)
      void com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(java.lang.String, com.ibm.servlet.engine.srp.ISRPConnection)
      void com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(com.ibm.servlet.engine.oselistener.api.IOSEConnection)
      void com.ibm.servlet.engine.http_transport.HttpTransportHandler.handleConnection(java.net.Socket)
      void com.ibm.servlet.engine.http_transport.HttpTransportHandler.run()
      void java.lang.Thread.run()

starting com.peco.montage.servlet.LoginServlet Servlet...
0
Comment
Question by:IVKRAJU
  • 2
5 Comments
 
LVL 1

Expert Comment

by:tonus
ID: 6202719
Hi,
  Can you post the code?
0
 

Author Comment

by:IVKRAJU
ID: 6207129
here I am sending the servlet code

public class GetLookupObjectsServlet extends MontageServlet {
/**
 * GetLookupObjects constructor comment.
 */
public GetLookupObjectsServlet() {
     super();
}
/**
 * Reads any objects sent by the UI.
 * Creation date: (5/8/01 5:24:42 PM)
 */
protected Object readAndExecute(java.io.ObjectInputStream in, com.peco.montage.util.ApplicationCommunicationToken act, com.peco.montage.servlet.util.ServletCommunicationToken sct) throws javax.servlet.ServletException, java.io.IOException, ClassNotFoundException {
     // Get the list of tables to select from the big hashmap    
     String tableNames[] = (String[]) in.readObject();

     // Pull the full set of lookups from the servlet context
     HashMap full = (HashMap) getServletContext().getAttribute(LookupObjects.LOOKUP_OBJECT_NAME);
     LookupFinder lookup = new LookupFinder(full);

     // Create a new one with just the values we need to pass back
     HashMap partial = new HashMap();

     // Look up the table names one by one, pulling their hashmaps and adding them to
     // the list to be returned
     for (int i=0; i<tableNames.length; i++) {
          HashMap one = lookup.getData(tableNames[i]);
          partial.put(tableNames[i], one);
     }


     
     // Retrieve the Meter Action Data (MTAC)
     LookupMTAC lookupMtac = (LookupMTAC)getServletContext().getAttribute(LookupObjects.LOOKUP_MTAC);

     
     // Retrieve the categories
     HashMap lookupCat = (HashMap)getServletContext().getAttribute(LookupObjects.LOOKUP_CATEGORIES);

         
     // Retrieve the categories
     HashMap lookupJobCat = (HashMap)getServletContext().getAttribute(LookupObjects.LOOKUP_JOB_CATEGORIES);
     ArrayList lookupJobCatArray = (ArrayList)getServletContext().getAttribute(LookupObjects.LOOKUP_JOB_CAT_ARRAY);

     sct.setSuccessfulAction(true);    

     
     Object[] objsToReturn =     {partial, lookupMtac, lookupCat, lookupJobCat, lookupJobCatArray};

     return objsToReturn;
}
/**
 * Writes the objects back to the UI.
 * Creation date: (5/8/01 5:24:42 PM)
 */
protected void writeObjects(java.io.ObjectOutputStream out, Object objsToWrite) throws javax.servlet.ServletException, java.io.IOException {
     Object[] objarray = (Object[]) objsToWrite;

     for (int i=0; i<objarray.length; i++) {
          out.writeObject(objarray[i]);
     }
}
}

0
 
LVL 1

Accepted Solution

by:
tonus earned 100 total points
ID: 6209366
In the wirteObjects method, you can write the entire object array to the ouput stream at one short.

ie.,
    Object[] objarray = (Object[]) objsToWrite;
    out.writeObject(objarray);
---------------------------
In the client side you read the object and type cast to Object[].      

0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 9010001
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:


[points to tonus]


Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
sudhakar_koundinya
EE Cleanup Volunteer
---------------------
If you feel that your question was not properly addressed, or that none of the comments received were appropriate answers, please post your concern in THIS thread.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
numbers ascending pyramid 101 196
eclipse shortcuts 9 56
Maven Project: Hibernate Dependencies Conflict 10 26
How to determine if a string is a valid SHA value 7 34
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

823 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question