This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes Configuring Velocity - ResourceNotFoundException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Configuring Velocity - ResourceNotFoundException" Watch "Configuring Velocity - ResourceNotFoundException" New topic

Configuring Velocity - ResourceNotFoundException

Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
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!

SCJP 1.5 -
Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
wood burning stoves
subject: Configuring Velocity - ResourceNotFoundException
Similar Threads
Suppressing Applet alerts when using mail API
Issue while using Apache Velocity with servlets
Velocity Templates with Servlets
Velocity initialization and .IllegalMonitorStateException
Velocity Templates with Servlets