Foren

Liferay7: Velocity fails to initialize when re-deploying, works on startup

Thomas Kellerer, geändert vor 6 Jahren.

Liferay7: Velocity fails to initialize when re-deploying, works on startup

Expert Beiträge: 490 Beitrittsdatum: 09.06.08 Neueste Beiträge
I have a several portlets that I have ported from Liferay6 to Liferay7.

The portlets send emails that are customized using Velocity.

I have a singleton Velocity Service (based on Velocity 1.6.4) that works just fine after Liferay started.

However, when I re-deploy my portlets that service fails to initialize with the following error message:

Caused by: org.apache.velocity.exception.VelocityException: The specified logger class org.apache.velocity.runtime.log.Log4JLogChute does not implement the org.apache.velocity.runtime.log.LogChute interface.

Now the Log4JLogChute class obviously implements that interface. Error messages like that typically indicate a problem with the classloader - which I don't understand. My OSGI bundle contains the velocity jar file and the needed libraries for it - shouldn't the OSGI container prevent exactly this kind of problems?

Why does my VelocityService work when Liferay is re-started, but not when I re-deploy my module?
(Note that it also works fine, when I re-start Liferay immediately after the deployment)

Restarting Liferay after each deployment is a very big PITA as that takes around 2 Minutes (and something I can't really do in production)
Thomas Kellerer, geändert vor 6 Jahren.

RE: Liferay7: Velocity fails to initialize when re-deploying, works on star

Expert Beiträge: 490 Beitrittsdatum: 09.06.08 Neueste Beiträge
Is there an alternative to using a bundled Velocity library? Maybe using the Velocity engine that is part of Liferay? (Or Freemarker?)

I really need to solve this.
Thomas Kellerer, geändert vor 6 Jahren.

RE: Liferay7: Velocity fails to initialize when re-deploying, works on star

Expert Beiträge: 490 Beitrittsdatum: 09.06.08 Neueste Beiträge
Bump ...
Thomas Kellerer, geändert vor 6 Jahren.

RE: Liferay7: Velocity fails to initialize when re-deploying, works on star

Expert Beiträge: 490 Beitrittsdatum: 09.06.08 Neueste Beiträge
Is nobody using Velocity (or Freemarker) in their portlets?