on 01-25-2006 7:33 PM
Hi All,
I have a stateless session bean. I need to pass a ByteArrayInputStream as a parameter to one of the functions. However, when I call the function I get the following error:
com.sap.engine.services.rmi_p4.exception.P4BaseRuntimeException: I/O operation failed : java.io.NotSerializableException: java.io.ByteArrayInputStream
I tried running everything without having the input stream as a parameter and it worked fine. Any idea as to why I might be getting this error?
Thanks.
ByteArrayInputStream does not implement java.io.Serializable. Therefore it seems EJB container cannot handle that type of data.
Keep in mind EJB's lifecycle managed by the EJB container, at some point the container may need to serialize the whole ejb instance and save it for later use... therefore if something is not serializable it cannot be saved.
I suppose this is your problem. You may look for another way to pass the block of bytes with something serializable. Maybe just a populated array of bytes.
I hope I answered your question.
Kind regards,
Vitaliano
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Vitaliano,
That solved my problem. The though of passing the array of bytes never even occured to me.
Thanks again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
96 | |
11 | |
11 | |
10 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.