hadoop-hdfs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shahab Yunus <shahab.yu...@gmail.com>
Subject Re: Fwd: Properties file not loaded with hadoop jar command
Date Fri, 17 Jul 2015 14:17:44 GMT
This seems to be a Java issue rather than Hadoop?

Have you seen these below, regarding intricacies involved in reading a
resource file in Java jar?
http://javarevisited.blogspot.com/2014/07/how-to-load-resources-from-classpath-in-java-example.html
http://stackoverflow.com/questions/20389255/reading-a-resource-file-from-within-jar
http://stackoverflow.com/questions/403256/how-do-i-read-a-resource-file-from-a-java-jar-file?rq=1

Regards,
Shahab

On Fri, Jul 17, 2015 at 10:09 AM, Harshit Mathur <mathursharp@gmail.com>
wrote:

> Are you reading the file in map or reduce task?
> On Jul 17, 2015 2:51 AM, "Nishanth S" <chinchu2884@gmail.com> wrote:
>
>> Hello,
>> I have built a  jar file with maven as build tool which  reads properties
>> from a  file.I am doing this  like  InputStream is =
>> ClassLoader.getSystemResourceAsStream(("hadoop.properties")) on start
>> iup.No qonce the jar is built  I could see that the properties get loaded
>> when  I do java -jar but when I am trying to execute the map reduce with
>>  hadoop jar  ClassLoader.getSystemResourceAsStream returns input stream
>> null.I want to keep this property file  within the jar and is available  in
>> the classpath.Please  advise  if any one has met this scenario before.
>>
>>
>> -Chinchu
>>
>>

Mime
View raw message