You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Costin Manolache <cm...@yahoo.com> on 2002/10/17 02:16:39 UTC

[5] ClassLoader hell. Again.

This time I have problems with commons-logging. It seems 

org.apache.commons.logging.LogConfigurationException: Class 
org.apache.commons.logging.impl.Log4JCategoryLog does not implement Log
        at 
org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:435)

It seems Log is loaded by the common loader, Log4JCategoryLog by the 
webapp loader. And they don't match.

Same thing works fine in 4.1.12. 

I can fix this by moving commons-logging and log4j at top level, but 
that's just a workaround.

Remy - any idea of what changed ?

Costin



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [5] ClassLoader hell. Again.

Posted by Costin Manolache <cm...@yahoo.com>.
Answering my own mail, it seems Log is loaded twice, once
during init ( and it may be related with my setup, as I have
few log uses in the startup code ), and then it is loaded
again from the webapp loader, but this time it's a different
instance ( due to reverse order ). And somehow the check for
assignment happens with the original Log instance. 

If this is correct - we can either make commons-logging(-api) a 
special case, or  make sure it is not used in any code from
the common loader ( the use from the container loader should
be ok ). 

I love ClassLoaders :-)

Costin


Costin Manolache wrote:

> This time I have problems with commons-logging. It seems
> 
> org.apache.commons.logging.LogConfigurationException: Class
> org.apache.commons.logging.impl.Log4JCategoryLog does not implement Log
>         at
> 
org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:435)
> 
> It seems Log is loaded by the common loader, Log4JCategoryLog by the
> webapp loader. And they don't match.
> 
> Same thing works fine in 4.1.12.
> 
> I can fix this by moving commons-logging and log4j at top level, but
> that's just a workaround.
> 
> Remy - any idea of what changed ?
> 
> Costin

-- 
Costin



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>