Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Exception using cloudera hadoop maven dependency 2.0.0-cdh4.6.0

Exception using cloudera hadoop maven dependency 2.0.0-cdh4.6.0

New Contributor

I am trying to run a mapreduce program in eclipse using cloudera hadoop maven dependencies in the pom.xml in Windows 7. While using 2.0.0-cdh4.0.0 dependency version in pom.xml, program is working smoothly but when I change the version to 2.0.0-cdh4.6.0, it is throwing following warning message.

WARN fs.LocalDirAllocator$AllocatorPerContext: Failed to create /tmp/hadoop-Abhijeet/mapred/local/file:/tmp/hadoop-Abhijeet/mapred/local/localRunner/Abhijeet/job_local83327001_0001/attempt_local83327001_0001_m_000001_0

 

and eventually it is throwing an exception which is following,

 java.lang.Exception: java.lang.IllegalArgumentException: n must be positive
     at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:401)Caused by: java.lang.IllegalArgumentException: n must be positive
at java.util.Random.nextInt(Random.java:250)at org.apache.hadoop.fs.LocalDirAllocator$AllocatorPerContext.confChanged(LocalDirAllocator.java:305)at org.apache.hadoop.fs.LocalDirAllocator$AllocatorPerContext.getLocalPathForWrite(LocalDirAllocator.java:344)at org.apache.hadoop.fs.LocalDirAllocator.getLocalPathForWrite(LocalDirAllocator.java:150)at org.apache.hadoop.fs.LocalDirAllocator.getLocalPathForWrite(LocalDirAllocator.java:131)at org.apache.hadoop.mapred.MROutputFiles.getSpillFileForWrite(MROutputFiles.java:146)at org.apache.hadoop.mapred.MapTask$MapOutputBuffer.sortAndSpill(MapTask.java:1558)at org.apache.hadoop.mapred.MapTask$MapOutputBuffer.flush(MapTask.java:1452)at org.apache.hadoop.mapred.MapTask$NewOutputCollector.close(MapTask.java:693)at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:761)at org.apache.hadoop.mapred.MapTask.run(MapTask.java:338)at org.apache.hadoop.mapred.LocalJobRunner$Job$MapTaskRunnable.run(LocalJobRunner.java:233)at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)at java.util.concurrent.FutureTask.run(FutureTask.java:138)at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)at java.lang.Thread.run(Thread.java:662)

The program also works for 2.2.0 version. I have to use the 2.0.0-cdh4.6.0 version. What can be the possible fix for my situation ?

2 REPLIES 2

Re: Exception using cloudera hadoop maven dependency 2.0.0-cdh4.6.0

New Contributor

I too have the same issue. Simple word count Code works with CDH 4.0 but not with 4.5 or 4.6 . 

Re: Exception using cloudera hadoop maven dependency 2.0.0-cdh4.6.0

Contributor

Can you make sure that your mapred local directories are valid? See https://issues.apache.org/jira/browse/MAPREDUCE-635