log.info("Able to establish mail session");
props.setProperty("resource.loader", "class");
props.setProperty("class.resource.loader.class", "org.apache."
+
"velocity.runtime.resource.loader.ClasspathResourceLoader");
props.setProperty("file.resource.loader.path", "/");
Velocity.init(props);
Template template = Velocity.getTemplate("MarketingAlert.html");
log.info("Able to find Template.");
VelocityContext vContext = new VelocityContext();
vContext.put("url", url);
vContext.put("userId", createdBy.toUpperCase());
vContext.put("appName", applicationName);
vContext.put("custName", customerName);
StringWriter writer = new StringWriter();
template.merge(vContext, writer);
IM working on enhancement...im getting the below exception:
INFO,Application,com.cypress.webapps.vp.util.Mail,,,"Able to establish mail session"
org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'MarketingAlert.html'
at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:458)
at org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:341)
at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:831)
at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:813)
at org.apache.velocity.runtime.RuntimeSingleton.getTemplate(RuntimeSingleton.java:285)
at org.apache.velocity.app.Velocity.getTemplate(Velocity.java:469)
at com.cypress.webapps.vp.util.Mail.MarketingAlert(Mail.java:272)
I know in which line the problem is coming while debugging but dont know why it is coming...
the problem is in
Template template = Velocity.getTemplate("MarketingAlert.html");
may people with more experienced and more knowledge on velocity engine can help on this.
i tried all path so no problem with path..i think wen this same code was in production it was working..
i shud get mail in my inbox with Marketingalert.html which im not getting bcoz of this exception.
plz help me .. im tryng since many days not able to cme out of this.....
kindly help me :-(
Thanks in advance