Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-8033 JDK 9 support
  3. FLINK-11155

HadoopFreeFsFactoryTest fails with ClassCastException

    XMLWordPrintableJSON

    Details

      Description

      HadoopFreeFsFactoryTest#testHadoopFactoryInstantiationWithoutHadoop fails with a ClassCastException because we try to cast the result of getClassLoader to URLClassLoader (also see https://stackoverflow.com/questions/46694600/java-9-compatability-issue-with-classloader-getsystemclassloader)

      java.lang.ClassCastException: java.base/jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to java.base/java.net.URLClassLoader
      
      	at org.apache.flink.runtime.fs.hdfs.HadoopFreeFsFactoryTest.testHadoopFactoryInstantiationWithoutHadoop(HadoopFreeFsFactoryTest.java:46)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
      

      One should also look for other instances where we cast to URLClassLoader.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                chesnay Chesnay Schepler
                Reporter:
                gjy Gary Yao
              • Votes:
                0 Vote for this issue
                Watchers:
                1 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