Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-360

Logger error with multiple Velocity engines

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 1.4
    • 1.5
    • Engine
    • None
    • Operating System: Windows 2000
      Platform: PC
    • 33695

    Description

      If you instance and init multiple engines, under some circumstances that are not
      yet clear, there is an error on the log4j logger.

      For example the following code:

      public static void main(String[] args) throws Exception
      {
      VelocityEngine[] engines = new VelocityEngine[4];

      for (int i = 0; i < engines.length; i++)

      { VelocityEngine engine = new VelocityEngine(); engine.setProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, "C:\\temp"); engine.init(); }

      }

      will generate 141 lines of the following error:

      log4j:ERROR Attempted to append to closed appender named [null].

      Debugging Velocity source code we noticed that all the engines add an appender
      to the same shared logger and sometime a null appender is added.
      We are currently using Velocity 1.4 and Log4J 1.2.9.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              a.vaccaro@quinary.com Andrea Vaccaro
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: