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 Juwei Shi <sh...@gmail.com> on 2011/07/20 08:16:07 UTC

error of loading logging class

Hi,

We faced a problem of loading logging class when start the name node.  It
seems that hadoop can not find commons-logging-*.jar

We have tried other commons-logging-1.0.4.jar and
commons-logging-api-1.0.4.jar. It does not work!

The following are error logs from starting console:

Exception in thread "main" java.lang.NoSuchMethodError:
org/apache/commons/loggi
ng/LogFactory.getClassLoader(Ljava/lang/Class;)Ljava/lang/ClassLoader;
        at
org.apache.commons.logging.impl.LogFactoryImpl.getClassLoader(LogFact
oryImpl.java:447)
        at
org.apache.commons.logging.impl.LogFactoryImpl.initDiagnostics(LogFac
toryImpl.java:476)
        at
org.apache.commons.logging.impl.LogFactoryImpl.<init>(LogFactoryImpl.
java:95)
        at java.lang.J9VMInternals.newInstanceImpl(Native Method)
        at java.lang.Class.newInstance(Class.java:1345)
        at org.apache.commons.logging.LogFactory$2.run(LogFactory.java:531)
        at
java.security.AccessController.doPrivileged(AccessController.java:202
)
        at
org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:517)
        at
org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:316)



Thanks in advanced!
-- 
- Juwei

Re: error of loading logging class

Posted by Juwei Shi <sh...@gmail.com>.
The problem is caused by conflict with another jar with
org/apache/commons/logging/ path.

2011/7/20 Juwei Shi <sh...@gmail.com>

> Hi,
>
> We faced a problem of loading logging class when start the name node.  It
> seems that hadoop can not find commons-logging-*.jar
>
> We have tried other commons-logging-1.0.4.jar and
> commons-logging-api-1.0.4.jar. It does not work!
>
> The following are error logs from starting console:
>
> Exception in thread "main" java.lang.NoSuchMethodError:
> org/apache/commons/loggi
> ng/LogFactory.getClassLoader(Ljava/lang/Class;)Ljava/lang/ClassLoader;
>         at
> org.apache.commons.logging.impl.LogFactoryImpl.getClassLoader(LogFact
> oryImpl.java:447)
>         at
> org.apache.commons.logging.impl.LogFactoryImpl.initDiagnostics(LogFac
> toryImpl.java:476)
>         at
> org.apache.commons.logging.impl.LogFactoryImpl.<init>(LogFactoryImpl.
> java:95)
>         at java.lang.J9VMInternals.newInstanceImpl(Native Method)
>         at java.lang.Class.newInstance(Class.java:1345)
>         at org.apache.commons.logging.LogFactory$2.run(LogFactory.java:531)
>         at
> java.security.AccessController.doPrivileged(AccessController.java:202
> )
>         at
> org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:517)
>         at
> org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:316)
>
>
>
> Thanks in advanced!
> --
> - Juwei
>



-- 
- Juwei

Re: error of loading logging class

Posted by madhu phatak <ph...@gmail.com>.
Its the problem of multiple versions of same jar.

On Thu, Jul 21, 2011 at 5:15 PM, Steve Loughran <st...@apache.org> wrote:

> On 20/07/11 07:16, Juwei Shi wrote:
>
>> Hi,
>>
>> We faced a problem of loading logging class when start the name node.  It
>> seems that hadoop can not find commons-logging-*.jar
>>
>> We have tried other commons-logging-1.0.4.jar and
>> commons-logging-api-1.0.4.jar. It does not work!
>>
>> The following are error logs from starting console:
>>
>>
> I'd drop the -api file as it isn't needed, and as you say, avoid duplicate
> versions. Make sure that log4j is at the same point in the class hierarchy
> too (e.g in hadoop/lib)
>
> to debug commons logging, tell it to log to stderr. It's useful in
> emergencies
>
> -Dorg.apache.commons.logging.**diagnostics.dest=STDERR
>

Re: error of loading logging class

Posted by Steve Loughran <st...@apache.org>.
On 20/07/11 07:16, Juwei Shi wrote:
> Hi,
>
> We faced a problem of loading logging class when start the name node.  It
> seems that hadoop can not find commons-logging-*.jar
>
> We have tried other commons-logging-1.0.4.jar and
> commons-logging-api-1.0.4.jar. It does not work!
>
> The following are error logs from starting console:
>

I'd drop the -api file as it isn't needed, and as you say, avoid 
duplicate versions. Make sure that log4j is at the same point in the 
class hierarchy too (e.g in hadoop/lib)

to debug commons logging, tell it to log to stderr. It's useful in 
emergencies

-Dorg.apache.commons.logging.diagnostics.dest=STDERR