Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-217

PluginManager does not close streams if exceptions occur during plugin init

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta4
    • Fix Version/s: 2.0-beta6
    • Component/s: Core
    • Labels:
      None

      Description

      If an exception occurs during plugin initialization,
      the currently open Log4j2Plugins.dat file is not closed, because
      the call to inputstream.close is not in a finally block.

      o.a.l.l.c.c.p.PluginManager#decode(ClassLoader) line 234

      This may cause the issue reported by Fabian in the log4j-user mailing list:

      From: Fabien Sanglard <fsanglard <at> timeplay.com>
      Subject: Issue with Tomcat auto-redeploy on Windows.
      Newsgroups: gmane.comp.jakarta.log4j.user
      Date: 2013-04-17 20:28:37 GMT (4 days, 13 hours and 8 minutes ago)

      It seems there is an issue with log4j 2 not closing the core JAR handle on Windows.
      It prevents Tomcat from auto redeploying an app.

      Upon updating an hypothetical DiscoveryService.war in the 'webapps' folder, the redeploy will fail:

      SEVERE: [C:\Program Files\apache-tomcat-7.0.39\webapps\DiscoveryService\WEB-INF\lib] could
      not be completely deleted. The presence of the remaining files may cause problems

      Upon inspection it looks like:
      C:\Program Files\apache-tomcat-7.0.39\webapps\DiscoveryService\WEB-INF\lib\log4j-core-2.0-beta4.jar

      Cannot be deleted :/ ! Is there anything special to do so log4j 2 close the JAR handle ?

      Fab

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              remkop@yahoo.com Remko Popma
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: