Details
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
- is a clone of
-
VELOCITY-193 Memory/logger leak with multiple VelocityEngine instances
- Closed