java - Moved Velocity jar from Bundle-ClassPath to Import-Package(Plugin dependancies) in MANIFEST.MF Then what should be the place for .vm file? -
shown above project structure. in code,
/* define velocity engine , template */ velocityengine ve = new velocityengine(); ve.setproperty("resource.loader", "classpath"); ve.setproperty("classpath.resource.loader.class",classpathresourceloader.class.getname()); ve.init(); template t = ve.gettemplate("filetemplates/dcm_default.vm");
previously, velocity.jar present in /lib folder. hence, dcm_default.vm had found.menifest.mf had entry below in classpath,
bundle-classpath: .,
lib/velocity-1.7-dep.jar
now, velocity. jar removed classpath , present in plugin dependancies in menifest.mf have below changes-
import-package:
org.apache.velocity,
org.apache.velocity.app,
org.apache.velocity.context,
org.apache.velocity.exception,
org.apache.velocity.runtime, org.apache.velocity.runtime.resource.loader
i unable find path have put .vm because faced below exception caused by: org.apache.velocity.exception.resourcenotfoundexception: unable find resource 'filetemplates/dcm_default.vm'.
can 1 has idea? please suggest.
if use classpathresourceloader, @ runtime must have jar contains filetemplates/dcm_default.vm. putting under src directory wont guarantee it's part of classpath, depends upon ide (which documentation should tell how so).
if know absolute path towards templates, can use fileresourceloader.
Comments
Post a Comment