Fixed: NotSerializableException after uploading images to an order
(OFBIZ-11123) In a lot of services we use the ByteBuffer object to upload files. When a such service is used with the redirect-parameter in a controller the ByteBuffer needs to be serialized. Unfortunately ByteBuffer (in our case its subclass HeapByteBuffer) is not serializable. So that can't work. Fortunately no redirect-parameter concerns uploadedFile so we can safely remove it from reqAttrMap in RequestHandler git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1866259 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -875,6 +875,7 @@ public class RequestHandler {
|
||||
}
|
||||
if (reqAttrMap.size() > 0) {
|
||||
reqAttrMap.remove("_REQUEST_HANDLER_"); // RequestHandler is not serializable and must be removed first. See http://issues.apache.org/jira/browse/OFBIZ-750
|
||||
reqAttrMap.remove("uploadedFile"); // uploadedFileis not serializable (it's a HeapByteBuffer) and must be removed first. See http://issues.apache.org/jira/browse/OFBIZ-11123
|
||||
byte[] reqAttrMapBytes = UtilObject.getBytes(reqAttrMap);
|
||||
if (reqAttrMapBytes != null) {
|
||||
req.getSession().setAttribute("_REQ_ATTR_MAP_", StringUtil.toHexString(reqAttrMapBytes));
|
||||
|
||||
Reference in New Issue
Block a user