elton sky wrote:
Hi,
I am new to hadoop programming.


OK. First hint of advice: don't spam the dev lists with user problems, you will only get ignored in both mailing lists.

 I am trying to copy a local file to HDFS. My

.
and when I run it, I got exception:
Exception in thread "main" java.lang.NullPointerException

        at org.apache.hadoop.conf.Configuration.get(Configuration.java:436)

        at
org.apache.hadoop.fs.FileSystem.getDefaultUri(FileSystem.java:103)
        at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:95)

        at HDFSFile.create(HDFSFile.java:42)

        at HDFSFile.main(HDFSFile.java:130)

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

        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at
java.lang.reflect.Method.invoke(Method.java:616)

        at org.apache.hadoop.util.RunJar.main(RunJar.java:156

After dug into source code of hdfs, I found the problem happens at
"Configuration.getProps()". The value of getProps() is null and, obviously,
it shouldn't be.

This is time to reach for your debugger. We don't know why it is null, probably something odd with how your configuration is booted up. Follow the constructor.

The other tactic, and the one I do first, is search for that stack trace on the web and on https://issues.apache.org/jira/ That way, if someone has hit the same problem as you, you'll find the solution

Reply via email to