exasol/hadoop-etl-udfs

Class cast exception when running with Java 9

morazow opened this issue · 1 comments

When running hadoop-etl-udfs in Java 9 runtime, e.g, Exasol 6.2.x, an ClassCastException exception is thrown.

Problem

Exception:

Exception in thread "main" java.lang.ClassCastException: 
  class jdk.internal.loader.ClassLoaders$AppClassLoader 
   cannot be cast to class java.net.URLClassLoader 
  (jdk.internal.loader.ClassLoaders$AppClassLoader 
    and 
  java.net.URLClassLoader are in module java.base of loader 'bootstrap')

This is due to fact that in Java 9 the application class loader is not an instance URLClassLoader. For more information, please read JEP261#Class_loaders.

Solution

There are possible solutions.

  • Compile using Java 9. In my opinion, this is two early since both Hadoop and Hive dependencies are still using Java 8.
  • Depending on Java version, load urls differently.

More reference

Hi @morazow I'm sorry about my comment in a closed issue. But really need to some suggestions from you about almost the same issue mentioned above:
#59
Could you please take a look on it ? Thanks in advance