velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From laredotornado <laredotorn...@gmail.com>
Subject Velocimacro : "velocimacro.library" is not set
Date Wed, 13 Jul 2011 17:03:36 GMT

Hi,

I'm using Velocity 1.6.2.  I'm noticing variables aren't getting substituted
in my template, and I found this error in the velocity.log file ...
2011-07-13 11:32:44,409 - Velocimacro : "velocimacro.library" is not set. 
Trying default library: VM_global_library.vm
2011-07-13 11:32:44,409 - Could not load resource 'VM_global_library.vm'
from ResourceLoader
org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader:
org.apache.velocity.exception.ResourceNotFoundException:
ClasspathResourceLoader Error: cannot find resource VM_global_library.vm
        at
org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader.getResourceStream(ClasspathResourceLoader.java:131)
        at
org.apache.velocity.runtime.resource.loader.ResourceLoader.resourceExists(ResourceLoader.java:224)
        at
org.apache.velocity.runtime.resource.ResourceManagerImpl.getLoaderForResource(ResourceManagerImpl.java:641)
        at
org.apache.velocity.runtime.resource.ResourceManagerImpl.getLoaderNameForResource(ResourceManagerImpl.java:624)
        at
org.apache.velocity.runtime.RuntimeInstance.getLoaderNameForResource(RuntimeInstance.java:1464)
        at
org.apache.velocity.runtime.VelocimacroFactory.initVelocimacro(VelocimacroFactory.java:159)
        at
org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:261)
        at
org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:589)
        at
org.apache.velocity.app.VelocityEngine.init(VelocityEngine.java:135)

What does it mean?  I'm loading my velocity.properties from the classpath,
like so ...

		/*
		 * first, get and initialize an engine
		 */
		VelocityEngine ve = new VelocityEngine();
		final InputStream resourceStream =
Thread.currentThread().getContextClassLoader().getResourceAsStream("velocity.properties");
		final Properties velocityProps = new Properties();
		velocityProps.load(resourceStream);
		ve.init( velocityProps );

Below is my velocity.properties file.  Any help figuring out the above error
is greatly appreciated, - Dave


============Begin velocity.properties ================

# uncomment the next two lines to load templates from the 
# classpath (WEB-INF/classes)
resource.loader=class
class.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader

# comment the next two lines to stop loading templates from the
# file system
#resource.loader=file
#file.resource.loader.class=org.apache.velocity.runtime.resource.loader.FileResourceLoader


# additional config for file system loader only.. tell Velocity where the
root
# directory is for template loading.  You can define multiple root
directories
# if you wish, I just use the one here.  See the text below for a note about
# the ${webapp.root}
#file.resource.loader.path=${webapp.root}/WEB-INF/velocity


# caching should be 'true' in production systems, 'false' is a development
# setting only.  Change to 'class.resource.loader.cache=false' for classpath
# loading
file.resource.loader.cache=false
=============End velocity.properties =================
-- 
View this message in context: http://old.nabble.com/Velocimacro-%3A-%22velocimacro.library%22-is-not-set-tp32055271p32055271.html
Sent from the Velocity - User mailing list archive at Nabble.com.


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


Mime
View raw message