[logback-dev] [JIRA] Commented: (LBCORE-18) classloader for loading autoConfig configuration resource

Darryl Smith (JIRA) noreply-jira at qos.ch
Tue Jan 12 05:34:34 CET 2010


    [ http://jira.qos.ch/browse/LBCORE-18?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=11499#action_11499 ] 

Darryl Smith commented on LBCORE-18:
------------------------------------

I think logback should fallback to TCCL, ran into some problems with glassfish v3 http://forums.java.net/jive/message.jspa?messageID=379078#379078

> classloader for loading autoConfig configuration resource
> ---------------------------------------------------------
>
>                 Key: LBCORE-18
>                 URL: http://jira.qos.ch/browse/LBCORE-18
>             Project: logback-core
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: unspecified
>         Environment: Operating System: Windows
> Platform: PC
>            Reporter: Filip Jirsák
>            Assignee: Logback dev list
>            Priority: Blocker
>         Attachments: classloader.patch
>
>
> ContextInitializer.autoConfig(LoggerContext) uses current thread context ClassLoader (TCL) nowadays - it calls Thread.currentThread().getContextClassLoader(). Sometimes this classloader has no access to logback classes - for example TCL is parent of classloader, which loaded current class, in oc4j (Oracle J2EE container) at the time of starting servlet container. So logback-*.jar are in WEB-INF/lib directory, but TCL has no access to these jars and to files in WEB-INF/classes.
> I think ContextInitializer.autoConfig(LoggerContext) should try this.getClass().getClassLoader() first and only if it fails it should use Thread.currentThread().getContextClassLoader().

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       


More information about the logback-dev mailing list