You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Jason van Zyl <jv...@apache.org> on 2001/03/18 23:39:25 UTC

Re: Cannot find template messages

"Geir Magnusson Jr." wrote:
> 
> "Geir Magnusson Jr." wrote:
> >
> > Bojan Smojver wrote:
> > >
> > > The FileResourceLoader.java writes an error message to the log file when
> > > it cannot find the template and includes the name of the template in the
> > > message. This all works fine but could we change lines 174 and 175 in
> > > that file to be:
> > >
> > > String msg = "FileResourceLoader Error: cannot find resource " +
> > >             path + template;
> > >
> > > so that people get informed straight away where is the file being pulled
> > > from (ie. print out the path as well). It will save a hassle or two to
> > > someone that doesn't read mailing list thoroughly, like me ;-)
> > >
> > > Bojan
> >
> > I take that 'yep' back...
> >
> > It is saying that it can't find the template in *any* of the
> > directories, so 'path' doesn't mean anything at that point.
> >
> > And it would be pretty yecchy to have it log for each path that it can't
> > find a template in - that's not something we should clog the log
> > with...  because then, for a multipath setup, it will blather to the log
> > for the other paths that it failed finding in, if the template is in the
> > last path..
> 
> Which brings up a good point -
> 
> we might want to make these failure messages emanate from the
> ResourceManager, not the loaders.
> 
> Why?  because if you have 3 loaders setup at the same time - you don't
> want an 'error message' to the log for the other 2 loaders that don't
> find it if the last one does.
> 
> So if no one objects, I will move the 'resource not found' message out
> of the specific loaders into the Manager....

Yes, definitely. I ran into that a couple days ago when trying
a version of turbine that I have that uses the FileResourceLoader
and the ClasspathResourceLoader. The FileResourceLoader failed
to find the template and didn't attempt to use the
ClasspathResourceLoader.
I will take a look at this tonight while I'm rummaging around
doing other things.

-- 
jvz.

Jason van Zyl
jvanzyl@periapt.com

http://jakarta.apache.org/velocity
http://jakarta.apache.org/turbine
http://tambora.zenplex.org