Sagewire Logo

Error calling an EJB method passing a large byte array

3 Message(s) by 3 Author(s) originally posted in java beans


From: praveen Date:   Friday, January 07, 2005
I've 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 won't let
the handle disappear which might be happening in the case of a
stateless session bean but that didnt help either. Got same error.


From: nicolas.devos Date:   Tuesday, February 08, 2005
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'd be to breakdown the initial request with
several smaller, but I'd like to understand why my EJB call
sometimes work and sometimes do not....

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

I'd also appreciate help on this topic.

Thank you,

Nicolas

wrote in message:
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 won't
let
the handle disappear which might be happening in the case of a
stateless session bean but that didnt help either. Got same error.






From: khyati Date:   Tuesday, June 06, 2006
Hello,

We are facing the same error for cases where byte array is too large. We
are using Weblogic 8.1 SP2 as server.
Any work arounds other than breaking the byte array into smaller chunks of
data?

Thanks!
Khyati



Next Message: newbie j2ee threading question



Programming | Sports | Autos

copyright 2006
Valid XHTML 1.0 Transitional