Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

hive insert query is failing with following exception

avatar

Exception in thread "main" java.lang.ExceptionInInitializerError at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) at org.apache.atlas.hive.hook.HiveHook.initialize(HiveHook.java:71) at org.apache.atlas.hive.hook.HiveHook.<init>(HiveHook.java:41) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:422) at java.lang.Class.newInstance(Class.java:442) at org.apache.hadoop.hive.ql.hooks.HookUtils.getHooks(HookUtils.java:60) at org.apache.hadoop.hive.ql.Driver.getHooks(Driver.java:1384) at org.apache.hadoop.hive.ql.Driver.getHooks(Driver.java:1368) at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1595) at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1289) at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1156) at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1146) at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:216) at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:168) at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:379) at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:739) at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:684) at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:624) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.apache.hadoop.util.RunJar.run(RunJar.java:233) at org.apache.hadoop.util.RunJar.main(RunJar.java:148) Caused by: java.lang.NullPointerException at org.apache.atlas.hook.AtlasHook.<clinit>(AtlasHook.java:73)

1 ACCEPTED SOLUTION

avatar
Super Guru

remove property ‘org.apache.atlas.hive.hook.HiveHook’ from ‘hive.exec.post.hooks’ in hive-site.xml, and restart all affected components

View solution in original post

3 REPLIES 3

avatar
Super Guru

remove property ‘org.apache.atlas.hive.hook.HiveHook’ from ‘hive.exec.post.hooks’ in hive-site.xml, and restart all affected components

avatar
Contributor

I got this problem once, and it was because the Hive-client component was not installed on the server I was running hive command from.

avatar
New Contributor

After installing Atlas and the datanodes in the cluster do not have the log path for hive you get the below stack:

Exception in thread "main" java.lang.ExceptionInInitializerError

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:348)

at org.apache.atlas.hive.hook.HiveHook.initialize(HiveHook.java:71)

at org.apache.atlas.hive.hook.HiveHook.<init>(HiveHook.java:41)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

at java.lang.Class.newInstance(Class.java:442)

at org.apache.hadoop.hive.ql.hooks.HookUtils.getHooks(HookUtils.java:60)

at org.apache.hadoop.hive.ql.Driver.getHooks(Driver.java:1386)

at org.apache.hadoop.hive.ql.Driver.getHooks(Driver.java:1370)

at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1598)

at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1291)

at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1158)

at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1148)

at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:217)

at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:169)

at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:380)

at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:315)

at org.apache.hadoop.hive.cli.CliDriver.processReader(CliDriver.java:413)

at org.apache.hadoop.hive.cli.CliDriver.processFile(CliDriver.java:429)

at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:718)

at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:685)

at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:625)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.apache.hadoop.util.RunJar.run(RunJar.java:233)

at org.apache.hadoop.util.RunJar.main(RunJar.java:148)

Caused by: java.lang.NullPointerException

at java.io.File.<init>(File.java:277)

at org.apache.atlas.hook.FailedMessagesLogger.getRootLoggerDirectory(FailedMessagesLogger.java:86)

at org.apache.atlas.hook.FailedMessagesLogger.init(FailedMessagesLogger.java:49)

at org.apache.atlas.hook.AtlasHook.<clinit>(AtlasHook.java:77)

... 31 more

To resolve this do the following, i.e. create the path for the hive process to dump log files in the cluster:

pdsh -g allhosts 'mkdir -p /var/hadoop/log/hive/ ; chmod 1777 /var/hadoop/log/hive/ '

# verify

pdsh -g allhosts 'stat -c"%a %U:%G %N" /var/hadoop/log/hive/ ' | dshbak -c