velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nageshyakkanti <>
Subject javax.servlet.jsp.JspException: Error initializing Velocity: org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'menu.vm'
Date Thu, 02 Aug 2007 17:36:39 GMT


I am working on Tomcat 5.0 , linux fedora
I am facing the following error
javax.servlet.jsp.JspException: Error initializing Velocity:
org.apache.velocity.exception.ResourceNotFoundException: Unable to find
resource 'menu.vm'

my is as follows
resource.loader = classpath
file.resource.loader.description = File Resource Loader
file.resource.loader.class =
file.resource.loader.path = /templates
file.resource.loader.cache = false
file.resource.loader.modificationCheckInterval = 0

velocimacro.library = globalMacros.vm
velocimacro.library.autoreload = true = true

ia m using the following class to load my velocity 
public class VelocityConfigurator
  extends ContextExtendedPropertiesLoader
  private static Category s_log =

   * Configures Velocity using a Properties object that is loaded
   * when the web application starts up. 
   * @param props The loaded Properties object.
   * @param sce The servlet context event that initialized the loading.
  protected void handleExtendedProperties(ExtendedProperties props,
					  ServletContextEvent sce)
    ServletContext sctx = sce.getServletContext();
    s_log.debug("About to load velocity config file");
    try {
      String templatesLocationType = sctx.getInitParameter
      String templatesLocation = sctx.getInitParameter
      String realTemplatesLocation;
      if ((templatesLocationType!=null) &&
      // velocity-templates-location-type equals "absolute"
      // so trust the path
        realTemplatesLocation = templatesLocation;
      // velocity-templates-location-type equals "context-relative"
      // so expand it based on the context deployment location.
        realTemplatesLocation = sctx.getRealPath(templatesLocation);
      props.addProperty ("file.resource.loader.path",
      s_log.debug ("Configuring loader path:" + realTemplatesLocation);
      Velocity.setExtendedProperties (props);
      Velocity.init ();"Velocity configured");
    } catch (Exception e) {
      s_log.error ("Velocity configuration threw exception", e);
      throw new RuntimeException("An error occurred while configuring
   * Returns the name of the context parameter that specifies the location
   * of the velocity properties file.
   * @return "".
  protected String getContextParameter()
    return "";

as i see in the logs the 
Configuring loader path:

but i am still not bale to find the .vm files.

can anybody please guide me on this.

I have tried using the logging for velocity but it does not to the lowest
How to set the logging level of velocity to debug so that i can figure out
what path velocity is taking.


View this message in context:
Sent from the Velocity - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message