You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by "Maha A. Alabduljalil" <ma...@umail.ucsb.edu> on 2010/12/12 01:00:21 UTC

Error: ... It is indirectly referenced from required .class files - implements

Hi all,

   I extended my project path with the hadoop-0.20.2-core.jar file,  
but I can see that some of the classes I need aren't there, so for  
example an error I get:

   "  The type org.apache.commons.logging.Log cannot be resolved. It  
is indirectly referenced from required .class files- implements  "

   Because I'm trying to use a MultiFileInputFormat for the WordCount  
example as follows:

public class wcMultiFileInputFormat extends  
MultiFileInputFormat<LongWritable, Text>{

	public LineRecordReader getRecordReader(InputSplit split, JobConf  
job, Reporter reporter){
		return (new LineRecordReader());
	}
}

  Can someone guide me to how to solve this in a different way  
(ie.Make each input file unSplittable) ... or how to add the required  
missing log.class?

   Thank you so much,
       Maha



Re: Error: ... It is indirectly referenced from required .class files - implements

Posted by maha <ma...@umail.ucsb.edu>.
Thanks for the advice Harsh! This worked :)

Maha

On Dec 11, 2010, at 8:48 PM, Harsh J wrote:

> Try adding the commons-logging jar to your build path. It is available
> in the lib/ folder of your Hadoop distribution.
> 
> If you use the MapReduce eclipse plugin which comes with the Hadoop
> distro, it would add all required jars to create a Hadoop project
> automatically (i.e. everything in lib/*.jar +
> hadoop-mapred/hdfs/common).
> 
> On Sun, Dec 12, 2010 at 10:06 AM, maha <ma...@umail.ucsb.edu> wrote:
>> This is a compilation error I get in Eclipse ... So, I don't so how putting the hadoop-core.jar in the lib/ directory will change the error.
>> Do you suggest another way of running a hadoop java program ?
>> 
>> The way I do it is .. Create an Eclipse project , Build Paths --> Add External Archives: hadoop-core.jar and that's it !  When I check inside the jar, I can't find the binary class file I'm looking for. So how can I add a binary files to this jar? I tried adding the source file, but this requires a cascading addition of other files. What shall I do?
>> 
>>   Although, I still appreciate your thoughts, thanks,
>> 
>> Maha
>> 
>> What I do is create a new pro
>> On Dec 11, 2010, at 6:27 PM, li ping wrote:
>> 
>>> Can you try to add the jar file in your Hadoop lib directory.
>>> 
>>> On Sun, Dec 12, 2010 at 8:00 AM, Maha A. Alabduljalil
>>> <ma...@umail.ucsb.edu>wrote:
>>> 
>>>> 
>>>> Hi all,
>>>> 
>>>> I extended my project path with the hadoop-0.20.2-core.jar file, but I can
>>>> see that some of the classes I need aren't there, so for example an error I
>>>> get:
>>>> 
>>>> "  The type org.apache.commons.logging.Log cannot be resolved. It is
>>>> indirectly referenced from required .class files- implements  "
>>>> 
>>>> Because I'm trying to use a MultiFileInputFormat for the WordCount example
>>>> as follows:
>>>> 
>>>> public class wcMultiFileInputFormat extends
>>>> MultiFileInputFormat<LongWritable, Text>{
>>>> 
>>>>       public LineRecordReader getRecordReader(InputSplit split, JobConf
>>>> job, Reporter reporter){
>>>>               return (new LineRecordReader());
>>>>       }
>>>> }
>>>> 
>>>> Can someone guide me to how to solve this in a different way (ie.Make each
>>>> input file unSplittable) ... or how to add the required missing log.class?
>>>> 
>>>> Thank you so much,
>>>>     Maha
>>>> 
>>>> 
>>>> 
>>> 
>>> 
>>> --
>>> -----李平
>> 
>> 
> 
> 
> 
> -- 
> Harsh J
> www.harshj.com


Re: Error: ... It is indirectly referenced from required .class files - implements

Posted by Harsh J <qw...@gmail.com>.
Try adding the commons-logging jar to your build path. It is available
in the lib/ folder of your Hadoop distribution.

If you use the MapReduce eclipse plugin which comes with the Hadoop
distro, it would add all required jars to create a Hadoop project
automatically (i.e. everything in lib/*.jar +
hadoop-mapred/hdfs/common).

On Sun, Dec 12, 2010 at 10:06 AM, maha <ma...@umail.ucsb.edu> wrote:
> This is a compilation error I get in Eclipse ... So, I don't so how putting the hadoop-core.jar in the lib/ directory will change the error.
> Do you suggest another way of running a hadoop java program ?
>
> The way I do it is .. Create an Eclipse project , Build Paths --> Add External Archives: hadoop-core.jar and that's it !  When I check inside the jar, I can't find the binary class file I'm looking for. So how can I add a binary files to this jar? I tried adding the source file, but this requires a cascading addition of other files. What shall I do?
>
>   Although, I still appreciate your thoughts, thanks,
>
> Maha
>
> What I do is create a new pro
> On Dec 11, 2010, at 6:27 PM, li ping wrote:
>
>> Can you try to add the jar file in your Hadoop lib directory.
>>
>> On Sun, Dec 12, 2010 at 8:00 AM, Maha A. Alabduljalil
>> <ma...@umail.ucsb.edu>wrote:
>>
>>>
>>> Hi all,
>>>
>>> I extended my project path with the hadoop-0.20.2-core.jar file, but I can
>>> see that some of the classes I need aren't there, so for example an error I
>>> get:
>>>
>>> "  The type org.apache.commons.logging.Log cannot be resolved. It is
>>> indirectly referenced from required .class files- implements  "
>>>
>>> Because I'm trying to use a MultiFileInputFormat for the WordCount example
>>> as follows:
>>>
>>> public class wcMultiFileInputFormat extends
>>> MultiFileInputFormat<LongWritable, Text>{
>>>
>>>       public LineRecordReader getRecordReader(InputSplit split, JobConf
>>> job, Reporter reporter){
>>>               return (new LineRecordReader());
>>>       }
>>> }
>>>
>>> Can someone guide me to how to solve this in a different way (ie.Make each
>>> input file unSplittable) ... or how to add the required missing log.class?
>>>
>>> Thank you so much,
>>>     Maha
>>>
>>>
>>>
>>
>>
>> --
>> -----李平
>
>



-- 
Harsh J
www.harshj.com

Re: Error: ... It is indirectly referenced from required .class files - implements

Posted by maha <ma...@umail.ucsb.edu>.
This is a compilation error I get in Eclipse ... So, I don't so how putting the hadoop-core.jar in the lib/ directory will change the error. 
Do you suggest another way of running a hadoop java program ?

The way I do it is .. Create an Eclipse project , Build Paths --> Add External Archives: hadoop-core.jar and that's it !  When I check inside the jar, I can't find the binary class file I'm looking for. So how can I add a binary files to this jar? I tried adding the source file, but this requires a cascading addition of other files. What shall I do?

   Although, I still appreciate your thoughts, thanks,

Maha

What I do is create a new pro
On Dec 11, 2010, at 6:27 PM, li ping wrote:

> Can you try to add the jar file in your Hadoop lib directory.
> 
> On Sun, Dec 12, 2010 at 8:00 AM, Maha A. Alabduljalil
> <ma...@umail.ucsb.edu>wrote:
> 
>> 
>> Hi all,
>> 
>> I extended my project path with the hadoop-0.20.2-core.jar file, but I can
>> see that some of the classes I need aren't there, so for example an error I
>> get:
>> 
>> "  The type org.apache.commons.logging.Log cannot be resolved. It is
>> indirectly referenced from required .class files- implements  "
>> 
>> Because I'm trying to use a MultiFileInputFormat for the WordCount example
>> as follows:
>> 
>> public class wcMultiFileInputFormat extends
>> MultiFileInputFormat<LongWritable, Text>{
>> 
>>       public LineRecordReader getRecordReader(InputSplit split, JobConf
>> job, Reporter reporter){
>>               return (new LineRecordReader());
>>       }
>> }
>> 
>> Can someone guide me to how to solve this in a different way (ie.Make each
>> input file unSplittable) ... or how to add the required missing log.class?
>> 
>> Thank you so much,
>>     Maha
>> 
>> 
>> 
> 
> 
> -- 
> -----李平


Re: Error: ... It is indirectly referenced from required .class files - implements

Posted by li ping <li...@gmail.com>.
Can you try to add the jar file in your Hadoop lib directory.

On Sun, Dec 12, 2010 at 8:00 AM, Maha A. Alabduljalil
<ma...@umail.ucsb.edu>wrote:

>
> Hi all,
>
>  I extended my project path with the hadoop-0.20.2-core.jar file, but I can
> see that some of the classes I need aren't there, so for example an error I
> get:
>
>  "  The type org.apache.commons.logging.Log cannot be resolved. It is
> indirectly referenced from required .class files- implements  "
>
>  Because I'm trying to use a MultiFileInputFormat for the WordCount example
> as follows:
>
> public class wcMultiFileInputFormat extends
> MultiFileInputFormat<LongWritable, Text>{
>
>        public LineRecordReader getRecordReader(InputSplit split, JobConf
> job, Reporter reporter){
>                return (new LineRecordReader());
>        }
> }
>
>  Can someone guide me to how to solve this in a different way (ie.Make each
> input file unSplittable) ... or how to add the required missing log.class?
>
>  Thank you so much,
>      Maha
>
>
>


-- 
-----李平