File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Velocity Path not found" Watch "Velocity Path not found" New topic
Author

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'

Thanks
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

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");

Thanks.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Velocity Path not found
 
Similar Threads
Help executing velocity example
Journal Article - Velocity - An Introduction
Velocity Question
NoClassDefFoundError: wrong name
Exception: Unable to find resource '/WEB-INF/templates/hello.vm'