i got this error once when i was uploading files to hdfs from java code ,The issue was that i was using hadoop 1 jar to connect to hadoop 2 installation,not sure whats the problem in your case but if you ever configured hadoop 1 eariler then something must be messing with it