Tag Archives: velocity

Velocity generates NullPointerException while evaluating template

While evaluating template with Velocity I am affecting a null point exception but happened only on production environment because it seems that the application is trying to write to tomcat/bin the velocity.log file but it failed due to the permission. I tried to add velocity.property file:

# Fri Dec  6 10:14:26 EST 2013 - Mandatory to prevent Velocity null point exception
runtime.log.logsystem.class=org.apache.velocity.runtime.log.NullLogSystem

but, after every startup I get the same error and, to fix that, it seems to be mandatory to remove the workdir tomcat folder. It’s not acceptable so, I tried to add this row before init the velocity:

Velocity.setProperty("runtime.log.logsystem.class", "org.apache.velocity.runtime.log.NullLogSystem");

Of course, my next step is to migrate to Freemarker because Velocity isn’t really under active development any more.

Tagged , ,