[ https://issues.apache.org/jira/browse/OFBIZ-12016?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17430356#comment-17430356 ]
Jacques Le Roux commented on OFBIZ-12016: ----------------------------------------- Hi Benjamin, I had a new look. With [^OFBIZ-12016.patch] applied, both UtilObject and RequestHandler::callRedirect code are quite similar between R18 and trunk, and functionally identiqual. You said bq. The commit for trunk is just fine and you are absolutely correct, that it is the way it should be. Does this mean that you tested the trunk on your issue and it was correct and satisfying? If so I don't see a reason to do more than patching R18. You also said bq. We can indeed redo the removal of fileItems as in https://github.com/apache/ofbiz-framework/commit/4725ae6. It would actually not be enough, FileItemHeadersImpl would be missing and that leads to the reason I made refatorings in trunk (question I was asking to myself). Because with this way not only DiskFileItem and FileItemHeadersImpl are handled by any possible case not handled OOTB. You may want to remove DiskFileItem and FileItemHeadersImpl in your OFBIz instance. I suggest to do only the patching OOTB, except if there something worrying about an error shown that should not be. In general errors should be show to users in UI, or at least for technical ones to devs in log. HTH > DiskFileItem as request attribute creates problems > -------------------------------------------------- > > Key: OFBIZ-12016 > URL: https://issues.apache.org/jira/browse/OFBIZ-12016 > Project: OFBiz > Issue Type: Bug > Affects Versions: 18.12.01, Trunk > Reporter: Sebastian Berg > Assignee: Jacques Le Roux > Priority: Major > Fix For: Upcoming Branch > > Attachments: OFBIZ-12016.patch > > > Hi, > while working on a custom project based on the 18.12.01 version, I noticed a > problem with the request handling during a request-redirect-noparam if a > DiskFileItem was involved. > So the situation for me is as follows: during the first request a file is > uploaded. I choose a wrong format on purpose, which results in an error > respond for that event. Nevertheless the DiskFileItem is set as request > attribute together with the error message. > The request is finished and based on the controller configurations redirected > to a second request. > While handling the second request the previous request's attributes get > restored (RequestHandler.java line 733ff). This goes down into > SafeObjectInfo.resolveClass() where an Incompatible class exception is > thrown. I compared my custom project with the current development status and > worked in the changes from commit 3f60efb343a11723aa56c1bc1f5afac3a2f26e9f in > OFBIZ-10837. > While this fixes the issue with the incompatible class exception it also > makes it impossible to retrieve any attributes from the first request. > Therefore my error message cannot be shown. > Is there a way to fix it or is it otherwise necessary to always set > "fileItems" as request attribute as added in -OFBIZ-11246-? -- This message was sent by Atlassian Jira (v8.3.4#803005)