Druid raising ClassNotFoundException for the class javax.xml.bind.ValidationException while indexing data

Hi,

I was trying to use druid server. All the servers i.e. coordinator, overlord, historical, broker, middlemanager etc are working fine. However, while trying to index a dataset wikiticker coordinator is giving error and error logs generated are pasted below. Can please someone look into these error logs.

FTR, I am using Java8 version while launching the servers by explicitly specifying the java command as /usr/local/java/jdk1.8/bin/java.

Thanks,
Archit

2019-08-14 14:02:46,606 main INFO Log4j appears to be running in a Servlet environment, but there’s no log4j-web module available. If you want better web container support, please add the log4j-web JAR to your web archive or server lib directory.
2019-08-14 14:02:46,669 main INFO Registered Log4j as the java.util.logging.LogManager.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/data/utd-staging-nb-a/scratch/bansalar/binary3/druid-0.12.0/lib/guice-4.1.0.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte,int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2019-08-14T14:02:46,858 INFO [main] io.druid.guice.PropertiesModule - Loading properties from common.runtime.properties
2019-08-14T14:02:46,860 INFO [main] io.druid.guice.PropertiesModule - Loading properties from runtime.properties
2019-08-14T14:02:46,888 INFO [main] org.hibernate.validator.internal.util.Version - HV000001: Hibernate Validator 5.1.3.Final
Exception in thread “main” java.lang.NoClassDefFoundError: javax/xml/bind/ValidationException
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:802)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:700)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:623)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at org.hibernate.validator.internal.engine.ConfigurationImpl.(ConfigurationImpl.java:110)
at org.hibernate.validator.internal.engine.ConfigurationImpl.(ConfigurationImpl.java:86)
at org.hibernate.validator.HibernateValidator.createGenericConfiguration(HibernateValidator.java:41)
at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:276)
at javax.validation.Validation.buildDefaultValidatorFactory(Validation.java:110)
at io.druid.guice.ConfigModule.configure(ConfigModule.java:39)
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 io.druid.guice.GuiceInjectors.makeStartupInjector(GuiceInjectors.java:60)
at io.druid.cli.Main.main(Main.java:99)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.ValidationException
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
… 23 more

Hi Archit, sounds like still a Java environmental problem. Did you happen to have multiple JDKs installed in your nodes? Would this article help? https://stackoverflow.com/questions/43574426/how-to-resolve-java-lang-noclassdeffounderror-javax-xml-bind-jaxbexception-in-j

thanks

Hi Ming,

Thanks for your update and issue has been fixed. Problem here was different in Java environment picked up by the servers.

On appending the Java 8 path to PATH variable it worked fine. Earlier I was setting only the JAVA_HOME variable without setting the PATH variable where issue was being faced while indexing.

It seems we need to append Java 8 path both o PATH variable and JAVA_HOME.

Thanks,

Archit