Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoClassDefFoundError when using druid-hdfs-storage #6967

Closed
jon-wei opened this issue Jan 31, 2019 · 4 comments
Closed

NoClassDefFoundError when using druid-hdfs-storage #6967

jon-wei opened this issue Jan 31, 2019 · 4 comments

Comments

@jon-wei
Copy link
Contributor

jon-wei commented Jan 31, 2019

Running the current master with druid-hdfs-storage enabled results in the following exception on startup:

2019-01-31T02:53:27,216 INFO [main] org.apache.druid.initialization.Initialization - Adding implementation [org.apache.druid.storage.hdfs.HdfsStorageDruidModule] for class [interface org.apache.druid.initialization.DruidModule] from local file system extension
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/conf/Configuration
	at org.apache.druid.storage.hdfs.HdfsStorageDruidModule.configure(HdfsStorageDruidModule.java:97)
	at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:340)
	at com.google.inject.spi.Elements.getElements(Elements.java:110)
	at com.google.inject.util.Modules$OverrideModule.configure(Modules.java:198)
	at com.google.inject.AbstractModule.configure(AbstractModule.java:62)
	at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:340)
	at com.google.inject.spi.Elements.getElements(Elements.java:110)
	at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:138)
	at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:104)
	at com.google.inject.Guice.createInjector(Guice.java:99)
	at com.google.inject.Guice.createInjector(Guice.java:73)
	at com.google.inject.Guice.createInjector(Guice.java:62)
	at org.apache.druid.initialization.Initialization.makeInjectorWithModules(Initialization.java:419)
	at org.apache.druid.cli.GuiceRunnable.makeInjector(GuiceRunnable.java:69)
	at org.apache.druid.cli.ServerRunnable.run(ServerRunnable.java:57)
	at org.apache.druid.cli.Main.main(Main.java:118)
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.conf.Configuration
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 16 more

Likely related to changes with hadoop-common in #6828

@ankit0811
Copy link
Contributor

can take a look to check if its related to #6828

@ankit0811
Copy link
Contributor

The hadoop-client is unable to pull in the dependency hadoop-common in extension-core/druid-hdfs-storage cos of the scope provided for hadoop-common in the main and hadoop-indexing pom

One possible solution is to provide the dependency hadoop-common with scope as compile inside druid-hdfs-storage pom

Let me know what you think @jon-wei

@jon-wei
Copy link
Contributor Author

jon-wei commented Feb 4, 2019

@ankit0811 That should be okay. I think druid-kerberos will also need similar adjustments, for reference:

JAR set in current master:

$ ls -Al dist/druid/extensions/druid-hdfs-storage/
total 25432
-rw-r--r--  1 jw  staff   559534 Jan 30 13:53 commons-compress-1.16.jar
-rw-r--r--  1 jw  staff    48714 Jan 30 13:53 druid-hdfs-storage-0.13.0-incubating-SNAPSHOT.jar
-rw-r--r--  1 jw  staff    29918 Jan 30 13:53 hadoop-client-2.8.3.jar
-rw-r--r--  1 jw  staff  4084884 Jan 30 13:53 hadoop-hdfs-client-2.8.3.jar
-rw-r--r--  1 jw  staff   563770 Jan 30 13:53 hadoop-mapreduce-client-app-2.8.3.jar
-rw-r--r--  1 jw  staff   785415 Jan 30 13:53 hadoop-mapreduce-client-common-2.8.3.jar
-rw-r--r--  1 jw  staff    66999 Jan 30 13:53 hadoop-mapreduce-client-jobclient-2.8.3.jar
-rw-r--r--  1 jw  staff    77314 Jan 30 13:53 hadoop-mapreduce-client-shuffle-2.8.3.jar
-rw-r--r--  1 jw  staff  2451433 Jan 30 13:53 hadoop-yarn-api-2.8.3.jar
-rw-r--r--  1 jw  staff   230173 Jan 30 13:53 hadoop-yarn-client-2.8.3.jar
-rw-r--r--  1 jw  staff  1806121 Jan 30 13:53 hadoop-yarn-common-2.8.3.jar
-rw-r--r--  1 jw  staff   491656 Jan 30 13:53 hadoop-yarn-server-common-2.8.3.jar
-rw-r--r--  1 jw  staff    18336 Jan 30 13:53 jackson-jaxrs-1.9.13.jar
-rw-r--r--  1 jw  staff    27084 Jan 30 13:53 jackson-xc-1.9.13.jar
-rw-r--r--  1 jw  staff   105134 Jan 30 13:53 jaxb-api-2.2.2.jar
-rw-r--r--  1 jw  staff   130458 Jan 30 13:53 jersey-client-1.9.jar
-rw-r--r--  1 jw  staff  1045744 Jan 30 13:53 leveldbjni-all-1.8.jar
-rw-r--r--  1 jw  staff    55684 Jan 30 13:53 objenesis-2.6.jar
-rw-r--r--  1 jw  staff   319099 Jan 30 13:53 okhttp-2.4.0.jar
-rw-r--r--  1 jw  staff    64661 Jan 30 13:53 okio-1.4.0.jar
-rw-r--r--  1 jw  staff    23346 Jan 30 13:53 stax-api-1.0-2.jar


$ ls -Al dist/druid/extensions/druid-kerberos/
total 4432
-rw-r--r--  1 jw  staff   47932 Jan 30 13:53 druid-kerberos-0.13.0-incubating-SNAPSHOT.jar
-rw-r--r--  1 jw  staff   95806 Jan 30 13:53 javax.servlet-api-3.1.0.jar
-rw-r--r--  1 jw  staff  281039 Jan 30 13:53 jetty-client-9.4.10.v20180503.jar
-rw-r--r--  1 jw  staff   16681 Jan 30 13:53 jetty-continuation-9.4.10.v20180503.jar
-rw-r--r--  1 jw  staff  192718 Jan 30 13:53 jetty-http-9.4.10.v20180503.jar
-rw-r--r--  1 jw  staff  135122 Jan 30 13:53 jetty-io-9.4.10.v20180503.jar
-rw-r--r--  1 jw  staff   87512 Jan 30 13:53 jetty-proxy-9.4.10.v20180503.jar
-rw-r--r--  1 jw  staff   93070 Jan 30 13:53 jetty-security-9.4.10.v20180503.jar
-rw-r--r--  1 jw  staff  590108 Jan 30 13:53 jetty-server-9.4.10.v20180503.jar
-rw-r--r--  1 jw  staff  110825 Jan 30 13:53 jetty-servlet-9.4.10.v20180503.jar
-rw-r--r--  1 jw  staff   93189 Jan 30 13:53 jetty-servlets-9.4.10.v20180503.jar
-rw-r--r--  1 jw  staff  498249 Jan 30 13:53 jetty-util-9.4.10.v20180503.

JAR set in 0.13.0-incubating:


$ ls -Al apache-druid-0.13.0-incubating/extensions/druid-hdfs-storage/
total 46928
-rw-r--r--@ 1 jw  staff    44925 Nov  3  2015 apacheds-i18n-2.0.0-M15.jar
-rw-r--r--@ 1 jw  staff   691479 Nov  3  2015 apacheds-kerberos-codec-2.0.0-M15.jar
-rw-r--r--@ 1 jw  staff    16560 Nov  3  2015 api-asn1-api-1.0.0-M20.jar
-rw-r--r--@ 1 jw  staff    79912 Nov  3  2015 api-util-1.0.0-M20.jar
-rw-r--r--@ 1 jw  staff   188671 Sep 14  2015 commons-beanutils-1.7.0.jar
-rw-r--r--@ 1 jw  staff   206035 Sep 14  2015 commons-beanutils-core-1.8.0.jar
-rw-r--r--@ 1 jw  staff   588337 Dec 19  2016 commons-collections-3.2.2.jar
-rw-r--r--@ 1 jw  staff   559534 Apr  6  2018 commons-compress-1.16.jar
-rw-r--r--@ 1 jw  staff   298829 Sep 14  2015 commons-configuration-1.6.jar
-rw-r--r--@ 1 jw  staff   143602 Sep 14  2015 commons-digester-1.8.jar
-rw-r--r--@ 1 jw  staff   273370 Sep 14  2015 commons-net-3.1.jar
-rw-r--r--@ 1 jw  staff   307244 Sep 21  2017 curator-framework-4.0.0.jar
-rw-r--r--@ 1 jw  staff   294100 Sep 21  2017 curator-recipes-4.0.0.jar
-rw-r--r--@ 1 jw  staff    49274 Dec  2 00:48 druid-hdfs-storage-0.13.0-incubating.jar
-rw-r--r--@ 1 jw  staff   190432 Nov  3  2015 gson-2.2.4.jar
-rw-r--r--@ 1 jw  staff   123169 Apr  6  2018 hadoop-auth-2.8.3.jar
-rw-r--r--@ 1 jw  staff    29918 Apr  6  2018 hadoop-client-2.8.3.jar
-rw-r--r--@ 1 jw  staff  3979262 Apr  6  2018 hadoop-common-2.8.3.jar
-rw-r--r--@ 1 jw  staff  4084884 Apr  6  2018 hadoop-hdfs-client-2.8.3.jar
-rw-r--r--@ 1 jw  staff   563770 Apr  6  2018 hadoop-mapreduce-client-app-2.8.3.jar
-rw-r--r--@ 1 jw  staff   785415 Apr  6  2018 hadoop-mapreduce-client-common-2.8.3.jar
-rw-r--r--@ 1 jw  staff  1571876 Apr  6  2018 hadoop-mapreduce-client-core-2.8.3.jar
-rw-r--r--@ 1 jw  staff    66999 Apr  6  2018 hadoop-mapreduce-client-jobclient-2.8.3.jar
-rw-r--r--@ 1 jw  staff    77314 Apr  6  2018 hadoop-mapreduce-client-shuffle-2.8.3.jar
-rw-r--r--@ 1 jw  staff  2451433 Apr  6  2018 hadoop-yarn-api-2.8.3.jar
-rw-r--r--@ 1 jw  staff   230173 Apr  6  2018 hadoop-yarn-client-2.8.3.jar
-rw-r--r--@ 1 jw  staff  1806121 Apr  6  2018 hadoop-yarn-common-2.8.3.jar
-rw-r--r--@ 1 jw  staff   491656 Apr  6  2018 hadoop-yarn-server-common-2.8.3.jar
-rw-r--r--@ 1 jw  staff  1485102 Apr  8  2017 htrace-core4-4.0.1-incubating.jar
-rw-r--r--@ 1 jw  staff    18336 Oct 19  2015 jackson-jaxrs-1.9.13.jar
-rw-r--r--@ 1 jw  staff    27084 Oct 19  2015 jackson-xc-1.9.13.jar
-rw-r--r--@ 1 jw  staff   105134 Sep 14  2015 jaxb-api-2.2.2.jar
-rw-r--r--@ 1 jw  staff     2254 Apr  8  2017 jcip-annotations-1.0.jar
-rw-r--r--@ 1 jw  staff   130458 Sep 14  2015 jersey-client-1.9.jar
-rw-r--r--@ 1 jw  staff    18891 Apr  8  2017 jetty-sslengine-6.1.26.jar
-rw-r--r--@ 1 jw  staff    51484 Apr  8  2017 json-smart-1.1.1.jar
-rw-r--r--@ 1 jw  staff   100636 Sep 14  2015 jsp-api-2.1.jar
-rw-r--r--@ 1 jw  staff  1045744 Jul 26  2016 leveldbjni-all-1.8.jar
-rw-r--r--@ 1 jw  staff   178648 Apr  8  2017 nimbus-jose-jwt-3.9.jar
-rw-r--r--@ 1 jw  staff    55684 Apr  6  2018 objenesis-2.6.jar
-rw-r--r--@ 1 jw  staff   319099 Apr  8  2017 okhttp-2.4.0.jar
-rw-r--r--@ 1 jw  staff    64661 Apr  8  2017 okio-1.4.0.jar
-rw-r--r--@ 1 jw  staff   105112 Sep 14  2015 servlet-api-2.5.jar
-rw-r--r--@ 1 jw  staff    23346 Sep 14  2015 stax-api-1.0-2.jar
-rw-r--r--@ 1 jw  staff    15010 Sep 14  2015 xmlenc-0.52.jar





$ ls -Al apache-druid-0.13.0-incubating/extensions/druid-kerberos/
total 30704
-rw-r--r--@ 1 jw  staff    44925 Nov  3  2015 apacheds-i18n-2.0.0-M15.jar
-rw-r--r--@ 1 jw  staff   691479 Nov  3  2015 apacheds-kerberos-codec-2.0.0-M15.jar
-rw-r--r--@ 1 jw  staff    16560 Nov  3  2015 api-asn1-api-1.0.0-M20.jar
-rw-r--r--@ 1 jw  staff    79912 Nov  3  2015 api-util-1.0.0-M20.jar
-rw-r--r--@ 1 jw  staff   188671 Sep 14  2015 commons-beanutils-1.7.0.jar
-rw-r--r--@ 1 jw  staff   206035 Sep 14  2015 commons-beanutils-core-1.8.0.jar
-rw-r--r--@ 1 jw  staff   588337 Dec 19  2016 commons-collections-3.2.2.jar
-rw-r--r--@ 1 jw  staff   559534 Apr  6  2018 commons-compress-1.16.jar
-rw-r--r--@ 1 jw  staff   298829 Sep 14  2015 commons-configuration-1.6.jar
-rw-r--r--@ 1 jw  staff   143602 Sep 14  2015 commons-digester-1.8.jar
-rw-r--r--@ 1 jw  staff   273370 Sep 14  2015 commons-net-3.1.jar
-rw-r--r--@ 1 jw  staff   307244 Sep 21  2017 curator-framework-4.0.0.jar
-rw-r--r--@ 1 jw  staff   294100 Sep 21  2017 curator-recipes-4.0.0.jar
-rw-r--r--@ 1 jw  staff    49786 Dec  2 00:48 druid-kerberos-0.13.0-incubating.jar
-rw-r--r--@ 1 jw  staff   190432 Nov  3  2015 gson-2.2.4.jar
-rw-r--r--@ 1 jw  staff   123169 Apr  6  2018 hadoop-auth-2.8.3.jar
-rw-r--r--@ 1 jw  staff  3979262 Apr  6  2018 hadoop-common-2.8.3.jar
-rw-r--r--@ 1 jw  staff  1485102 Apr  8  2017 htrace-core4-4.0.1-incubating.jar
-rw-r--r--@ 1 jw  staff    18323 Nov  3  2015 jackson-jaxrs-1.9.2.jar
-rw-r--r--@ 1 jw  staff    27075 Nov  3  2015 jackson-xc-1.9.2.jar
-rw-r--r--@ 1 jw  staff    18490 Mar 23  2017 java-xmlbuilder-0.4.jar
-rw-r--r--@ 1 jw  staff    95806 Sep 14  2015 javax.servlet-api-3.1.0.jar
-rw-r--r--@ 1 jw  staff   105134 Sep 14  2015 jaxb-api-2.2.2.jar
-rw-r--r--@ 1 jw  staff   890168 Sep 14  2015 jaxb-impl-2.2.3-1.jar
-rw-r--r--@ 1 jw  staff     2254 Apr  8  2017 jcip-annotations-1.0.jar
-rw-r--r--@ 1 jw  staff   164191 Jun 12  2017 jersey-json-1.19.3.jar
-rw-r--r--@ 1 jw  staff   704349 Jun 12  2017 jersey-server-1.19.3.jar
-rw-r--r--@ 1 jw  staff   539735 Mar 23  2017 jets3t-0.9.0.jar
-rw-r--r--@ 1 jw  staff    67758 Sep 14  2015 jettison-1.1.jar
-rw-r--r--@ 1 jw  staff   539912 Sep 14  2015 jetty-6.1.26.jar
-rw-r--r--@ 1 jw  staff   281039 Jun 25  2018 jetty-client-9.4.10.v20180503.jar
-rw-r--r--@ 1 jw  staff    16681 Jun 25  2018 jetty-continuation-9.4.10.v20180503.jar
-rw-r--r--@ 1 jw  staff   192718 Jun 25  2018 jetty-http-9.4.10.v20180503.jar
-rw-r--r--@ 1 jw  staff   135122 Jun 25  2018 jetty-io-9.4.10.v20180503.jar
-rw-r--r--@ 1 jw  staff    87512 Jun 25  2018 jetty-proxy-9.4.10.v20180503.jar
-rw-r--r--@ 1 jw  staff    93070 Jun 25  2018 jetty-security-9.4.10.v20180503.jar
-rw-r--r--@ 1 jw  staff   590108 Jun 25  2018 jetty-server-9.4.10.v20180503.jar
-rw-r--r--@ 1 jw  staff   110825 Jun 25  2018 jetty-servlet-9.4.10.v20180503.jar
-rw-r--r--@ 1 jw  staff    93189 Jun 25  2018 jetty-servlets-9.4.10.v20180503.jar
-rw-r--r--@ 1 jw  staff    18891 Apr  8  2017 jetty-sslengine-6.1.26.jar
-rw-r--r--@ 1 jw  staff   498249 Jun 25  2018 jetty-util-9.4.10.v20180503.jar
-rw-r--r--@ 1 jw  staff   280515 Apr  6  2018 jsch-0.1.54.jar
-rw-r--r--@ 1 jw  staff    51484 Apr  8  2017 json-smart-1.1.1.jar
-rw-r--r--@ 1 jw  staff   100636 Sep 14  2015 jsp-api-2.1.jar
-rw-r--r--@ 1 jw  staff   178648 Apr  8  2017 nimbus-jose-jwt-3.9.jar
-rw-r--r--@ 1 jw  staff    55684 Apr  6  2018 objenesis-2.6.jar
-rw-r--r--@ 1 jw  staff   105112 Sep 14  2015 servlet-api-2.5.jar
-rw-r--r--@ 1 jw  staff    23346 Sep 14  2015 stax-api-1.0-2.jar
-rw-r--r--@ 1 jw  staff    15010 Sep 14  2015 xmlenc-0.52.jar

jon-wei pushed a commit that referenced this issue Feb 9, 2019
* Fix:
  1. hadoop-common dependency for druid-hdfs and druid-kerberos extensions
 Refactoring:
  2. Hadoop config call in the inner static class to avoid class path conflicts for stopGracefully kill

* Fix:
  1. hadoop-common test dependency

* Fix:
  1. Avoid issue of kill command once the job is actually completed
jon-wei pushed a commit to jon-wei/druid that referenced this issue Feb 9, 2019
apache#7015)

* Fix:
  1. hadoop-common dependency for druid-hdfs and druid-kerberos extensions
 Refactoring:
  2. Hadoop config call in the inner static class to avoid class path conflicts for stopGracefully kill

* Fix:
  1. hadoop-common test dependency

* Fix:
  1. Avoid issue of kill command once the job is actually completed
fjy pushed a commit that referenced this issue Feb 9, 2019
…) (#7045)

* Fix:
  1. hadoop-common dependency for druid-hdfs and druid-kerberos extensions
 Refactoring:
  2. Hadoop config call in the inner static class to avoid class path conflicts for stopGracefully kill

* Fix:
  1. hadoop-common test dependency

* Fix:
  1. Avoid issue of kill command once the job is actually completed
@jihoonson
Copy link
Contributor

Fixed in #7015.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants