velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shinobu Kawai <shinobu.ka...@gmail.com>
Subject Re: Resource Not Found Exception
Date Fri, 18 Mar 2005 17:59:14 GMT
Hi Elton,

> First, I am very new to Velocity. I have installed it and I ran 'ant
> test' and it came back successful.

Welcome to Velocity-World and congratulations on a working copy of Velocity!  :)

> I am learning Velocity by reading
> 'Pro Jakarta Velocity' by Rob Harrop. In the first example program, I
> entered:

## snip

>                // initialize Velocity
>                Velocity.init();
> 
>                // get the template
>                Template template =
> Velocity.getTemplate("classes/templates/ch02/HelloWorld.vm");

## snip

> It compiles, but when I run the program I get:
> 
> ----------
> -> java org.novaworks.ch02.HelloWorld
> Exception in thread "main"
> org.apache.velocity.exception.ResourceNotFoundException: Unable to find
> resource 'classes/templates/ch02/HelloWorld.vm'

## snip

> I know Velocity works because I am able to run the first example
> program that came with the distribution. Any thoughts on what is not
> happening?

1. Where are you running HelloWorld?
2. What are your resource loader settings in the velocity.properties?
3. Where is the HelloWorld.vm?

Some more to help:
    http://jakarta.apache.org/velocity/developer-guide.html#Configuring%20Resource%20Loaders

Best regards,
-- Shinobu

--
Shinobu Kawai <shinobu.kawai@gmail.com>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message