Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / JavaBeans / June 2006

Tip: Looking for answers? Try searching our database.

Error calling an EJB method passing a large byte array

Thread view: 
praveen - 07 Jan 2005 21:28 GMT
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.
nicolas.devos@gmail.com - 08 Feb 2005 14:20 GMT
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

> 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.
[quoted text clipped - 10 lines]
> 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:
>
[quoted text clipped - 38 lines]
> the handle disappear which might be happening in the case of a
> stateless session bean but that didnt help either. Got same error.
khyati - 06 Jun 2006 09:26 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.