You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Dennis Thrysøe <dt...@conscius.com> on 2007/06/14 17:36:02 UTC

commons-logging classloading

Hello,

I'm having trouble with commons-logging in a scenario where I am 
embedding tomcat's jasper in another servlet container.

I keep getting the exception about commons-logging being available from 
multiple classloaders.

This seeems to be caused by LogFactory using the ContextClassLoader 
instead of the classloader that loaded Log and LogFactory. (In this case 
the classloader that loaded jasper.

Therefore I cannot seem to get my JSPs loaded and executed with my 
webapp classloader, as commons-logging is distributed with both the 
servlet container and the webapp in question.

Is there any way to force commons-logging to use a specific classloader, 
or any other good ideas on how to use jasper with a webapp that contains 
commons-logging?

Thanks,

-dennis

---------------------------------------------------------------------------
The information in this email is confidential and may be legally protected.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: commons-logging classloading

Posted by Dennis Thrysøe <dt...@conscius.com>.
Dennis Lundberg wrote:
> Hi
> 
> Diagnostics, that was introduced in Commons Logging 1.1, is a great way 
> to troubleshoot classloading issues:
> 
> 
> http://jakarta.apache.org/commons/logging/troubleshooting.html#Using_JCL_Diagnostics 

I'm not really in doubt what's going on, so I don't think diagnostics 
would help me.

Essentially I would like LogFactory to use it's own classloader instead 
of the context classloader.

This is because I'm trying to load some classes by one (parent) 
classloader, and invoking methods afterwards that are supposed to use 
another (child) classloader.

Thanks,

-dennis
---------------------------------------------------------------------------
The information in this email is confidential and may be legally protected.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: commons-logging classloading

Posted by Dennis Lundberg <de...@apache.org>.
Hi

Diagnostics, that was introduced in Commons Logging 1.1, is a great way 
to troubleshoot classloading issues:

 
http://jakarta.apache.org/commons/logging/troubleshooting.html#Using_JCL_Diagnostics

Dennis Thrysøe wrote:
> Hello,
> 
> I'm having trouble with commons-logging in a scenario where I am 
> embedding tomcat's jasper in another servlet container.
> 
> I keep getting the exception about commons-logging being available from 
> multiple classloaders.
> 
> This seeems to be caused by LogFactory using the ContextClassLoader 
> instead of the classloader that loaded Log and LogFactory. (In this case 
> the classloader that loaded jasper.
> 
> Therefore I cannot seem to get my JSPs loaded and executed with my 
> webapp classloader, as commons-logging is distributed with both the 
> servlet container and the webapp in question.
> 
> Is there any way to force commons-logging to use a specific classloader, 
> or any other good ideas on how to use jasper with a webapp that contains 
> commons-logging?
> 
> Thanks,
> 
> -dennis
> 
> ---------------------------------------------------------------------------
> The information in this email is confidential and may be legally protected.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 


-- 
Dennis Lundberg


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org