Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-4295

Deserialization of arrays with UtilObject.getObject() throws ClassNotFoundException

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      Deserialization of arrays with UtilObject.getObject() throws a ClassNotFoundException. This happened to us when we enabled the distributed cache clear feature and it was sending arrays of EntityExpr objects to other OFBiz instances.

      The reason is, that the org.ofbiz.base.util.ObjectInputStream calls classLoader.loadClass(name) directly instead of using Class.forName(name, init, classLoader).
      According to java bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6446627 ClassLoader.loadClass() is not intended to being used this way and doesn't support loading arrays.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            jleroux Jacques Le Roux
            mkreidenweis Martin Kreidenweis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment