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

Add Scala to the parent-first loading patterns

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.4.0
    • 1.4.1, 1.5.0
    • None
    • None

    Description

      A confusing experience happens when users accidentally package the Scala Library into their jar file. The reversed class loading duplicates Scala's classes, leading to exceptions like the one below.

      By adding scala. to the default 'parent-first-patterns' we can improve the user experience in such situations.

      Exception Stack Trace:

      java.lang.ClassCastException: cannot assign instance of org.peopleinmotion.TestFunction$$anonfun$1 to field org.apache.flink.streaming.api.scala.DataStream$$anon$7.cleanFun$6 of type scala.Function1 in instance of org.apache.flink.streaming.api.scala.DataStream$$anon$7
              at java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(ObjectStreamClass.java:2233)
              at java.io.ObjectStreamClass.setObjFieldValues(ObjectStreamClass.java:1405)
              at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2288)
              at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2206)
              at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2064)
              at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1568)
              at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2282)
              at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2206)
              at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2064)
              at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1568)
              at java.io.ObjectInputStream.readObject(ObjectInputStream.java:428)
              at org.apache.flink.util.InstantiationUtil.deserializeObject(InstantiationUtil.java:290)
              at org.apache.flink.util.InstantiationUtil.readObjectFromConfig(InstantiationUtil.java:248)
              at org.apache.flink.streaming.api.graph.StreamConfig.getStreamOperator(StreamConfig.java:220)
              ... 6 more
      

      Attachments

        Issue Links

          Activity

            People

              sewen Stephan Ewen
              sewen Stephan Ewen
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: