Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Software caused connection abort: socket write error

843790Mar 6 2008 — edited Mar 6 2008
Hi all,

I have that "Software caused connection abort: socket write error" exception error that i've never meet before.
When I try without using SSLSocket, I have the same "Software caused connection abort: socket write error"
What does it means ?
What is going wrong with my code?

Here is the code I wrote :
//server side
GZIPOutputStream gos = new GZIPOutputStream(child.getOutputStream());
GZIPInputStream gis = new GZIPInputStream(child.getInputStream());
ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(gos,48000));
ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(gis,48000));

out.writeObject( passRequest( obj ) );
out.flush();
gos.finish();
String sDate, eDate;

do{ 
  gis = new GZIPInputStream(child.getInputStream()); 
  in = new ObjectInputStream(new BufferedInputStream(gis,48000));
  obj=in.readObject();

  Vector<String> dates = (Vector<String>) ((CRequest) obj)
  .getInfo();
  String start = dates.get(0);
  String end = dates.get(1);  
  SimpleDateFormat sdf = new SimpleDateFormat(
      "MMM dd, yyyy hh:mm:ss a"); 
  SimpleDateFormat sdf3 = new SimpleDateFormat(
      "yyyy-MM-dd HH:mm:ss");

  Date startD = null;
  Date endD = null;

  try {
    startD = sdf.parse(start);
    endD = sdf.parse(end);
  } catch (ParseException e1) {

    e1.printStackTrace();
  }
  sDate = sdf3.format(startD);
  eDate = sdf3.format(endD); 
  gos = new GZIPOutputStream(child.getOutputStream()); 
  out = new ObjectOutputStream(new BufferedOutputStream(gos,48000)); 
  out.writeObject( passRequest( obj ) ); 
  out.flush();
  gos.finish(); 
  
}while(!sDate.equals(eDate));
//client side
sslFact = (SSLSocketFactory) SSLSocketFactory
.getDefault();
server = (SSLSocket) sslFact.createSocket(ip, port);
server.setEnabledCipherSuites(set);
server.setReceiveBufferSize(48000);
server.setSendBufferSize(48000);
          
Date currentEnd = GlobalMethods.sDate; 
Date currentStart;
long period = 1000*60*60*6; //6 hours
long endTime = GlobalMethods.eDate.getTime();

//request splitted historical time until end date is reached
//if currentStart and currentEnd are equals, so it's the last request 
while(currentEnd.getTime() < endTime){
  
  currentStart = currentEnd; 
  long nextPeriod = currentStart.getTime() + period;
  if(nextPeriod < endTime)
    currentEnd = new Date(nextPeriod);
  else
    currentEnd = new Date(endTime);

  dates.clear();
  dates.add(currentStart.toLocaleString());
  dates.add(currentEnd.toLocaleString()); 

  creq = new CRequest(Activator.cookie,
      RequestConstants.CMC_REQUEST_DATA, segment, dates,
      ip, port);  
  gos = new GZIPOutputStream(server.getOutputStream());
  out = new ObjectOutputStream(new BufferedOutputStream(gos, 48000));  
  // /* Can we actually send ourselves and then receive ourselves?*/
  out.writeObject(creq); 
  out.flush();
  gos.finish(); 
  gis = new GZIPInputStream(server.getInputStream()); 
  in = new ObjectInputStream(new BufferedInputStream(gis, 48000)); 
  /* Returning the newly modified request with results */
  final CRequest received = (CRequest) in.readObject();  

  PlatformUI.getWorkbench().getDisplay().asyncExec(
      new Runnable() {
        public void run() { 
          pref.processData((GeneralDataObj) received
              .getInfo());
        }
      }); 
}
and the server log error :
javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLException: 

java.net.SocketException: Software caused connection abort: socket write error
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkEOF(Unknown Source)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkWrite(Unknown Source)
	at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown Source)
	at java.util.zip.DeflaterOutputStream.deflate(Unknown Source)
	at java.util.zip.DeflaterOutputStream.write(Unknown Source)
	at java.util.zip.GZIPOutputStream.write(Unknown Source)
	at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
	at java.io.BufferedOutputStream.write(Unknown Source)
	at java.io.ObjectOutputStream$BlockDataOutputStream.drain(Unknown Source)
	at java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(Unknown 

Source)
	at java.io.ObjectOutputStream.writeNonProxyDesc(Unknown Source)
	at java.io.ObjectOutputStream.writeClassDesc(Unknown Source)
	at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
	at java.io.ObjectOutputStream.writeFatalException(Unknown Source)
	at java.io.ObjectOutputStream.writeObject(Unknown Source)
	at com.inetmon.jn.server.SessionManager.run(SessionManager.java:153)
Caused by: javax.net.ssl.SSLException: java.net.SocketException: Software caused 

connection abort: socket write error
	at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(Unknown Source)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(Unknown Source)
	at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown Source)
	at java.util.zip.DeflaterOutputStream.deflate(Unknown Source)
	at java.util.zip.DeflaterOutputStream.write(Unknown Source)
	at java.util.zip.GZIPOutputStream.write(Unknown Source)
	at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
	at java.io.BufferedOutputStream.write(Unknown Source)
	at java.io.ObjectOutputStream$BlockDataOutputStream.drain(Unknown Source)
	at java.io.ObjectOutputStream$BlockDataOutputStream.write(Unknown Source)
	at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
	at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
	at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
	at java.io.ObjectOutputStream.writeArray(Unknown Source)
	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
	at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
	at java.io.ObjectOutputStream.defaultWriteObject(Unknown Source)
	at java.util.Vector.writeObject(Unknown Source)
	at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
	at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
	at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
	at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
	at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
	at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
	at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
	at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
	at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
	... 2 more
Caused by: java.net.SocketException: Software caused connection abort: socket write error
	at java.net.SocketOutputStream.socketWrite0(Native Method)
	at java.net.SocketOutputStream.socketWrite(Unknown Source)
	at java.net.SocketOutputStream.write(Unknown Source)
	at com.sun.net.ssl.internal.ssl.OutputRecord.writeBuffer(Unknown Source)
	at com.sun.net.ssl.internal.ssl.OutputRecord.write(Unknown Source)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(Unknown Source)
	... 34 more
Edited by: kuguy on Mar 6, 2008 1:49 AM

Comments

Frank Kulash

Hi, @albert-chao
Please assume all the tables are created.
No; whenever you have a question, actually post CREATE TABLE and INSERT statements for a little sample data, and the exact results you want from that data. For DML questions (such as INSERT) the results will be what the changed table looks like after the DML is completed.

Solomon Yakobson
Answer

You don't assign SELECTed data to a variable via assignment statement. You use INTO clause:

Declare
tot_records number(10);
records_loaded number(10);
process_start_time timestamp;
begin
select count(1) into tot_records from employees;
insert into department select * from employees;
records_loaded := sql%rowcount;
process_start_time := current_timestamp;
insert into summary(total,tot_loads,start_time) values(tot_records,records_loaded,process_start_time);
end;

Also why are you inserting employee data into department table???
SY.

Marked as Answer by Albert Chao · Sep 21 2021
Frank Kulash

Hi, [Albert Chao](/ords/forums/user/Albert Chao)

tot_records := select count(1) into lv_count from employees;

won't work in PL/SQL; you can't have SELECT immediately after :=.
Do something like this instead:

	select  count (*)
	into 	tot_records
	from 	employees;
mathguy

I have tried but not able insert the values into the summary table.
In this case, the mistake was so obvious that we didn't need more information from you. But in general, if something "doesn't work", you won't get a lot of help if you just say "it doesn't work". You need to tell us exactly what is not working. Does compilation fail? (It would, in this case - with an error message pointing exactly to the place in the code where the error is.) Does the compilation succeed, but then you get an error thrown when you execute the block? Does execution go through, but you get the wrong result? Etc.
Please keep this in mind next time you ask a question (here or on any other forum). Also, make sure to always state your database version - in many cases (even though not in your problem here), that is the key piece of information.

1 - 4
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 3 2008
Added on Mar 6 2008
5 comments
5,197 views