java.lang.NoSuchMethodError: org.apache.hadoop.conf.Configuration.reloadExistingConfigurations()V

前端 未结 3 934
失恋的感觉
失恋的感觉 2021-01-19 19:38

It looks like I am again stuck on the running a packaged spark app jar using spark submit. Following is my pom file:



        
3条回答
  •  后悔当初
    2021-01-19 20:22

    In case anybody else is still stumbling on this error... it took me a while to find out, but check if your project has a dependency (direct or transitive) on the package org.apache.avro/avro-tools. It was brought into my code by a transitive dependency. Its problem is that it ships with a copy of org.apache.hadoop.conf.Configuration that is much older than all current versions of hadoop, so it may end up being the one picked up in the classpath.

    In my scala project, I just had to exclude it with

     ExclusionRule("org.apache.avro","avro-tools")
    

    and the error (finally!) disappear.

    I am sure that the avro-tools coders had some good reason to include a copy of a file that belongs to another package (hadoop-common), I was really surprised to find it there and made me waste an entire day.

提交回复
热议问题