title: org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource
body: <p>I am trying to create velocity template and send mail. I am getting error -  org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'template.vm'</p>
  
  <p>I am using velocity1.7.jar and java 7. Please find the code below for reference.</p>
  
  <pre><code>VelocityContext velCtx = new VelocityContext();
  velCtx.put("cepcnEmailBean", cepcnEmailBean);
  VelocityEngine velEngine = new VelocityEngine();
  velEngine.setProperty("resource.loader", "class");
  velEngine.setProperty("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
  velEngine.init();
  Template vtl = null;
  vtl = velEngine.getTemplate("template.vm");
  StringWriter strWriter = new StringWriter();
  vtl.merge(velCtx, strWriter);
  </code></pre>
  
  <p>I am getting exception on line no 9 and file "template.vm" was there in the classpath. Please check and let me know if I want to fix anything. </p>