velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Will Glass-Husain" <wgl...@forio.com>
Subject Re: Problem with decimal in most recent snapshot
Date Thu, 14 Apr 2005 22:40:03 GMT
Here's a question,

Could you have another copy of Velocity floating around?  Maybe in one of 
the Tomcat directories?

Here's what I think is happening:

(1) In Velocity 1.5-dev we changed the way properties files are discovered. 
I'm thinking that when you leave out the "velocity.properties" file it can't 
find the default one.  That's a possible cause of the NPE.  Sometimes this 
can happen if there's a Velocity jar in the app server and a Velocity jar in 
the webapp.  I'm not sure about this - but maybe that's a bug causing the 
NPE.

(2) You are incorrectly configuring the webappresourceloader path.  The 
WebappResourceLoader is turned on by default in VVS with a base path of "/". 
You are overriding that in your velocity file by saying:
      webapp.resource.loader.path = /WEB-INF/templates

Thus when you look for a resource 
'/WEB-INF/templates/pub/common/tiles/defaultTemplate.vm' it looks for:
     '/WEB-INF/templates/WEB-INF/templates/pub/common/tiles/defaultTemplate.vm'

I think the short term solution is to continue to include your own 
"velocity.properties" (which would skip around problem 1), and change the 
line to this:
      webapp.resource.loader.path = /

Or pass in templates (including web pages) without "/WEB-INF/templates"

WILL

----- Original Message ----- 
From: <jeichels@optonline.net>
To: "Velocity Users List" <velocity-user@jakarta.apache.org>
Sent: Thursday, April 14, 2005 2:48 PM
Subject: Re: Problem with decimal in most recent snapshot


>
> I feel like I am spamming and am sorry for it, but more information.
>
> When I use full paths, it still shows the same error message of:
> org.apache.velocity.exception.ResourceNotFoundException: Unable to find 
> resource '/WEB-INF/templates/pub/common/tiles/defaultTemplate.vm'
>
> This happens only in Velocity 1.5 when I have the 
> webapp.resource.loader.path set.  When I don't have it set, merging 
> templates internally gets a null pointer exception.
>
> I think this problem might be an interaction with Tiles.   I am using 
> Tiles, Velocity, and Velocity-Tools all together.  I think that when 
> webapp.resource.loader.path is set, Tiles somehow gets messed up for 
> normal web pathing.   I think only the Tiles relative path is sent in 
> hense the error message above rather then the full path I had expected to 
> see.
>
> In 1.4, Tiles always used relative path to the root web path but I think 
> that gets messed up somehow when webapp is set.  I really am not sure.
>
> I am stuck obviously.  This has been working in 1.4 for for over six 
> months for me.
>
> I want to give up and keep on 1.4, but I think that is a mistake also and 
> it doesn't help make Velocity better too.  I have a complex setup, but not 
> one that other people might want to use.  It is one that has worked in the 
> past.
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
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