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: ant DVSL task can't find VM_global_library.vm
Date Wed, 10 Nov 2004 03:21:10 GMT

Hi Larry,

I'm new to DVSL, so I'm making a lot of guesses here.  ;)

> 		<dvsl basedir="."
> 			in="${target.dir}/svjp-ui-tabbed.xml" 
> 			out="${target.dir}/svjp-ui-tabbed.html" 
> 			style="${target.dir}/svjp-ui-tabbed.dvsl" 
> 			toolboxfile="${target.dir}/toolbox.properties"
> 			classpath="${dvsl.toolbox.classpath}">
> 			<velconfig name="velocimacro.library" 
> value="${basedir}\veltemplate\VM_global_library.vm"/>
> 		</dvsl>

> In particular:
> C:\Views\lsiden_view_2\sdm_svc\SDMservices\GKN\Phase2\DeveloperRepository\veltemplate\VM_global_library.vm
> : org.apache.velocity.exception.ResourceNotFoundException: Unable to
> find resource
> 
> However, this is exactly where VM_global_library.vm is found on my
> system!  What am I missing?
First, Velocity, by default, uses the FileResourceLoader with the
current path as the template root.
    http://jakarta.apache.org/velocity/developer-guide.html#Configuring%20Resource%20Loaders
    http://jakarta.apache.org/velocity/api/org/apache/velocity/runtime/resource/loader/FileResourceLoader.html

The Velocimacro libraries are also resources, loaded by
VelocimacroFactory.
    http://jakarta.apache.org/velocity/api/org/apache/velocity/runtime/VelocimacroFactory.html#initVelocimacro()

${basedir}\... is converted to the absolute path in the file system, so
the specified resource can only be found if the current directory was
the root (C:\).

Try removing the "${basedir}\" part, and see what happens.  If my
assumptions are correct (and if ${basedir} == current dir),  it should
work.

Best regards,
-- Shinobu Kawai

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