jQuery in Action, 3rd edition
The moose likes Other Open Source Projects and the fly likes Velocity Path not found Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Velocity Path not found" Watch "Velocity Path not found" New topic

Velocity Path not found

Justin Howard
Ranch Hand

Joined: Feb 19, 2009
Posts: 162
Hi All,

I have trying to make this work for a very long time. I have my templates in WEB-INF/templates. I am just trying to use it for email body generation.

I have this in the web.xml:

This is my servlet:

This is in my velocity.properties

When I execute it throws an exception
Exception: org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource '/appname/WEB-INF/templates/helloworld.vm'

Martijn Verburg

Joined: Jun 24, 2003
Posts: 3275

Hi Justin,

I assume you're using Tomcat? If so then you can allow listDirectory and use your web browser to navigate to that file to make sure it's actually there. Also you need to check how the path lookups are occuring, are they relative to your context root? Absolute? Something else...?

Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Justin Howard
Ranch Hand

Joined: Feb 19, 2009
Posts: 162
Thank you for the reply. Yes i am using Tomcat 6.
The templates are in the path /WEB-INF/templates. But the WEB-INF folder does not come up in the directory listing.
I am using the context-root to access the file.

Template t = Velocity.getTemplate("/appname/WEB-INF/templates/helloworld.vm");


I agree. Here's the link: http://aspose.com/file-tools
subject: Velocity Path not found
It's not a secret anymore!