Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-456

Problem locating logback.xml from JEE deployment

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 0.9.21
    • logback-classic
    • None
    • Glassfish 2.1

    Description

      Logback seems to have a problem in locating the logback.xml configuration while being deployed as part of an EAR app on Glassfish. This incapability exists because the logback classic ContextInitializer class tries to locate the resource through a local classloader instead of the current thread context classloader. In some JEE app servers things are guaranteed to break if you try to locate resources with local classloaders.

      The findURLOfDefaultConfigurationFile method of the ch.qos.logback.classic.util.ContextInitializer class retrieves its current classloader with getClassLoader(). The current classloader returned during glassfish startup is not able to sense to full context of the deployed ear. At this startup stage it will return the ASURLClassloader instead of the needed EJBClassLoader.

      I fixed the problem by supplying the context class loader with Thread.currentThread().getContextClassLoader().

      Could anybody please change this in one of the future releases.

      Thanks Rob

      Attachments

        Activity

          People

            logback-dev Logback dev list
            betgem Rob Betgem
            Votes:
            2 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: