When i am trying to get the template for mail messages am getting following exception -
Apr 25, 2012 7:53:53 PM org.springframework.ui.velocity.CommonsLoggingLogS ystem logVelocityMessage
SEVERE: ResourceManager : unable to find resource 'facebook-user-published-list.vm' in any resource loader.
org.apache.velocity.exception.ResourceNotFoundExce ption: Unable to find resource 'facebook-user-published-list.vm'
at org.apache.velocity.runtime.resource.ResourceManag erImpl.loadResource(ResourceManagerImpl.java:483)
at org.apache.velocity.runtime.resource.ResourceManag erImpl.getResource(ResourceManagerImpl.java:354)
at org.apache.velocity.runtime.RuntimeInstance.getTem plate(RuntimeInstance.java:1400)
at org.apache.velocity.app.VelocityEngine.mergeTempla te(VelocityEngine.java:370)
I am giving my application context configuration and velocity.properties file below, let me know am doing something wrong here.
APP CONTEXT CONF:
Code:<bean id="velocityEngine" class="org.springframework.ui.velocity.VelocityEngineFactoryBean"> <property name="configLocation" value="/WEB-INF/conf/velocity.properties"/> </bean>
velocity.properties file:
resource.loader = file
As per velocity specification we can give multiple directories as well in the "file.resource.loader.path" section.Code:file.resource.loader.description = Velocity File Resource Loader file.resource.loader.class = org.apache.velocity.runtime.resource.loader.FileResourceLoader file.resource.loader.path = /WEB-INF/vm-templates/alert/ #file.resource.loader.path = /WEB-INF/vm-templates/alert/, /WEB-INF/vm-templates/mail/digest/, /WEB-INF/vm-templates/mail/direct/ file.resource.loader.cache = false file.resource.loader.modificationCheckInterval = 0
https://velocity.apache.org/engine/r...rationexamples


Reply With Quote
