cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hynek Mlnarik (JIRA)" <j...@apache.org>
Subject [jira] Updated: (CXF-2893) CXF should use class' classloader for initialization of its loggers
Date Wed, 14 Jul 2010 07:31:54 GMT

     [ https://issues.apache.org/jira/browse/CXF-2893?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Hynek Mlnarik updated CXF-2893:
-------------------------------

    Attachment: patch.diff

Diff to fix the described issue.

> CXF should use class' classloader for initialization of its loggers
> -------------------------------------------------------------------
>
>                 Key: CXF-2893
>                 URL: https://issues.apache.org/jira/browse/CXF-2893
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.2.9
>            Reporter: Hynek Mlnarik
>            Priority: Trivial
>         Attachments: patch.diff
>
>
> The class org.apache.cxf.common.logging.LogUtils should attempt to use plain Class.forName(cname)
if Class.forName(cname, true, Thread.currentThread().getContextClassLoader()) fails.
> Rationale: Current thread might not be able to access cxf classes. Take as an example
the following OSGi bundles:
> 1) bundle with a http server
> 2) bundle with CXF-based servlet SomeCXFServlet
> A servlet SomeCXFServlet from bundle (2) has access to CXF via SomeCXFServlet.class.getClassloader(),
similarly for LogUtils class via its classloader. However, its initialization is performed
from http server thread that does not have access to bundle (2) classes. Initialization of
a logger is hence also made from the http thread. CXF tries to load its org.apache.cxf.common.logging.*Logger
classes - the attempt however fails because the current thread's classloader is used instead
of the LogUtils'.
> Solution: Try to load the class using Class.forName(cname) if Class.forName(cname, true,
Thread.currentThread().getContextClassLoader()) fails.
> Will attach diff in a separate comment

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message