Error calling an EJB method passing a large byte array

Java software components (JavaBeans)

praveen
I have a stateless session bean with a method that take a byte array as
an argument to save the incoming data to a file.

Remote client, when invokes this method with a smaller size file it
works fine but when i try to send a file of size about 100mb it raises
an exception. Here is the stack trace:


java.net.SocketException: Software caused connection abort: socket
write error
java.rmi.UnmarshalException: Software caused connection abort: socket
write error; nested exception is:
java.net.SocketException: Software caused connection abort: socket
write error
at
weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:297)
at
weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:244)
at
com.burntsand.hmco.dam.aps.session.statelessSession_oizvbi_EOImpl_812_WLStub.setPublicationResult(Unknown
Source)
at
com.burntsand.hmco.dam.aps.session.APSClient.main(APSClient.java:187)
Caused by: java.net.SocketException: Software caused connection abort:
socket write error
at
weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:108)
at
weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:284)
... 3 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(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at weblogic.socket.SocketMuxer.write(SocketMuxer.java:721)
at weblogic.rjvm.t3.T3JVMConnection.sendMsg(T3JVMConnection.java:723)
at
weblogic.rjvm.MsgAbbrevJVMConnection.sendOutMsg(MsgAbbrevJVMConnection.java:276)
at
weblogic.rjvm.MsgAbbrevJVMConnection.sendMsg(MsgAbbrevJVMConnection.java:164)
at weblogic.rjvm.ConnectionManager.sendMsg(ConnectionManager.java:549)
at weblogic.rjvm.RJVMImpl.send(RJVMImpl.java:722)
at
weblogic.rjvm.MsgAbbrevOutputStream.flushAndSendRaw(MsgAbbrevOutputStream.java:292)
at
weblogic.rjvm.MsgAbbrevOutputStream.flushAndSend(MsgAbbrevOutputStream.java:300)
at
weblogic.rjvm.MsgAbbrevOutputStream.sendRecv(MsgAbbrevOutputStream.java:322)
at
weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:103)


The code that calls the ejb looks like this:

FileInputStream mFis = new FileInputStream(new File("c:\\abc.pdf"));
m_logger.debug("Fis : " + mFis);
int i = mFis.available();
byte[] PDFBytes = new byte[i];
mFis.read(PDFBytes);
m_logger.debug("READ : ");
mFis.close();

if(PDFBytes != null) {
m_logger.debug("Calling setPublicationResult");
try {
boolean saveOk = apsSession.setPublicationResult(objectId, PDFBytes);
if(saveOk) {
m_logger.debug("Call to setPublicationResult succeeded");
}
else {
m_logger.debug("Call to setPublicationResult failed");
}
}
catch(Exception e) {
m_logger.debug("Exception in call to setPublicationResult, error is " +
e.getMessage());
e.printStackTrace();
}
}
apsSession.remove();
} catch (RemoteException re) {
m_logger.error("RemoteException " + re);
re.printStackTrace();
} catch (RemoveException re) {
m_logger.error("RemoveException " + re);
re.printStackTrace();
} catch(FileNotFoundException fe) {

} catch(IOException ioe) {

}
I tried to change the bean type to "stateful" hoping this will not let
the handle disappear which might be happening in the case of a
stateless session bean but that didnt help either. Got same error.                                            
nicolasdevosgmailcom
hi,

i got similar problems when invoking an EJB session bean with a large
Object array.
I am using weblogic 7.0 sp0.

The simple workaround would be to breakdown the initial request with
several smaller, but I would like to understand why my EJB call
sometimes work and sometimes don't....

It looks like the socket fail to transfer the data...

I would also appreciate help on this topic.

Thank you,

Nicolas

as
raises
weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:297)
weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:244)
com.burntsand.hmco.dam.aps.session.statelessSession_oizvbi_EOImpl_812_WLStub.setPublicationResult(Unknown
abort:
weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:108)
weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:284)
abort:
java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
weblogic.rjvm.MsgAbbrevJVMConnection.sendOutMsg(MsgAbbrevJVMConnection.java:276)
weblogic.rjvm.MsgAbbrevJVMConnection.sendMsg(MsgAbbrevJVMConnection.java:164)
weblogic.rjvm.ConnectionManager.sendMsg(ConnectionManager.java:549)
weblogic.rjvm.MsgAbbrevOutputStream.flushAndSendRaw(MsgAbbrevOutputStream.java:292)
weblogic.rjvm.MsgAbbrevOutputStream.flushAndSend(MsgAbbrevOutputStream.java:300)
weblogic.rjvm.MsgAbbrevOutputStream.sendRecv(MsgAbbrevOutputStream.java:322)
weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:103)
+
let