Search code examples
clouderaoozieoozie-coordinator

Oozie null pointer exception when submitting jobs


Just trying to run a very simple word count example but getting the following null pointer when submitting the job:

oozie job -oozie=http://localhost:11000/oozie/ -config job.properties -run

[cloudera@localhost Oozie_Example]$ oozie job -oozie=http://localhost:11000/oozie/ -config job.properties -run
java.lang.RuntimeException: java.lang.NullPointerException
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1242)
    at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:2714)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:477)
    at org.apache.oozie.client.OozieClient$JobSubmit.call(OozieClient.java:586)
    at org.apache.oozie.client.OozieClient$JobSubmit.call(OozieClient.java:561)
    at org.apache.oozie.client.OozieClient$ClientCallable.call(OozieClient.java:479)
    at org.apache.oozie.client.OozieClient.run(OozieClient.java:655)
    at org.apache.oozie.cli.OozieCLI.jobCommand(OozieCLI.java:918)
    at org.apache.oozie.cli.OozieCLI.processCommand(OozieCLI.java:579)
    at org.apache.oozie.cli.OozieCLI.run(OozieCLI.java:552)
    at org.apache.oozie.cli.OozieCLI.main(OozieCLI.java:199)
Caused by: java.lang.NullPointerException
    at java.io.ByteArrayInputStream.<init>(ByteArrayInputStream.java:106)
    at sun.misc.CharacterEncoder.encode(CharacterEncoder.java:188)
    at sun.net.www.protocol.http.NegotiateAuthentication.setHeaders(NegotiateAuthentication.java:156)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1482)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
    ... 8 more
java.lang.NullPointerException

here is my job properties file:

nameNode=hdfs://localhost:8020
jobTracker=localhost:8021
queueName=default


inputDir=${nameNode}/user/dev/oozie/workflow/wordcount/input/ 
outputDir=${nameNode}/user/dev/oozie/workflow/wordcount/output/

oozie.libpath=${nameNode}/user/oozie/workflow/wordcount/lib
oozie.use.system.libpath=true

user.name=dev

oozie.wf.application.path=${nameNode}/user/${user.name}/oozie/workflow/wordcount/

Any ideas? It happens pretty early so I think it has something to do with Oozie or namenode.


Solution

  • Would like to add to the answer of this question.

    When oozie client got a NullPointerException, that usually means that request caused server thread failure. If you want to find out the "true" reason, you should look at the server log such as /var/log/oozie/oozie.log for CDH.

    There you will find detailed stacktrace. That proved to be very helpful. At least in our case, it tells exactly what happened such as "a hdfs workflow file doesn't exist, blah..."