Forums Register Login
Configuring Velocity - ResourceNotFoundException
Hi guys!

I need to know how to configure Velocity properly. I'm using velocity in a batch(CLI) process to send an e-mail and my template file located in a directory somewhere in the file system. I'm using Eclipse and I made sure that the location of my template is included in the classpath (if it is ever needed to do so).

Assuming that my .vm (template) file is located in C:/opt/templates/

I initialize Velocity like this

And load my template like the following

A call to getTemplate throws the error below:

org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'my_template.vm'

Is anyone familiar with this? Thanks!

Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards

This thread has been viewed 11176 times.

All times above are in ranch (not your local) time.
The current ranch time is
Jan 20, 2018 20:11:46.