• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Configuring Velocity - ResourceNotFoundException

 
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Solution:

http://devpinoy.org/blogs/lamia/archive/2009/01/28/velocity-template-engine-resourcenotfound-exception.aspx
 
reply
    Bookmark Topic Watch Topic
  • New Topic