Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-11071

Dynamic proxy classes cannot be resolved when deserializing job graph

    XMLWordPrintableJSON

Details

    Description

      It turns impossible to use Java dynamic proxy objects in the job definition (for example, as a MapFunction implementation).

      During deserialization of the job graph, the default implementation of  ObjectInputStream.resolveProxyClass(..) is used, which is not using the custom class loader (to look into the submitted jar) and therefore throws ClassNotFoundException.

      Looks like in order to address this, InstantiationUtil.ClassLoaderObjectInputStream needs to provide custom implementation of resolveProxyClass(..) method as well (in addition to resolveClass(..)).

      In order to reproduce the issue, run the attached SocketWindowWordCount Flink app. It's a slight variation of the canonical [SocketWindowWordCount
      example|https://ci.apache.org/projects/flink/flink-docs-master/tutorials/local_setup.html] with a dynamic proxy implementation of the flat map transformation.

      Attachments

        1. SocketWindowWordCount.java
          5 kB
          Oleg Zhukov

        Issue Links

          Activity

            People

              eaglewatcher BoWang
              ozhukov Oleg Zhukov
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m