Multiple annotations found at this line: - Class 'org.springframework.ui.velocity.VelocityEngineFactoryBean' not found - Class 'org.springframework.ui.velocity.VelocityEngineFactoryBean' not found [config set: MyApp/web- context]
<bean id="velocityEngine" class="org.springframework.ui.velocity.VelocityEngineFactoryBean">
<property name="velocityProperties">
<value>
resource.loader=class
class.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
</value>
</property>
</bean>
Spring has marked Velocity package org.springframework.ui.velocity as deprecated in Spring 4.3 and removed it completely in Spring 5.0.1 (according to Jürgen Höller, it's because Velocity Framework "dates back to 2010").
Source: https://jira.spring.io/browse/SPR-13795.
However, you can still use Velocity 1.7 in Spring 5.0.x Framework.
Just follow the answer of @bekce in this thread.
As it was mentioned on VelocityEngineUtils has been removed in Spring 3.2 so what else to use? you need to have Velocity dependency:
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.7</version>
</dependency>
For XML configs, replace deprecated VelocityEngineFactoryBean with VelocityEngine:
<util:properties id="velocityProperties">
<prop key="resource.loader">class</prop>
<prop key="class.resource.loader.class">org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader</prop>
</util:properties>
<bean id="velocityEngine" class="org.apache.velocity.app.VelocityEngine">
<constructor-arg ref="velocityProperties">
</bean>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With