Hi,

      I am creating two maven projects. my first maven project is having the
Application class, this contains free marker configuration. the FTL files
reffered by this configuration are in second project, which is a web
application.The project1 is added as dependency to project2. 

Application class source code ( project 1 )

private Configuration fmc;
public TestApplication() throws IOException{
      getConnectorService().getClientProtocols().add(Protocol.FILE);
      getConnectorService().getClientProtocols().add(Protocol.CLAP);
      Properties properties =
getProperties("clap://class/config/myApplication.properties");

      this.webRootPath = properties.getProperty("web.root.path");
      try {
            final File templateDir = new File(webRootPath + "/template");
            this.fmc = new freemarker.template.Configuration();
            this.fmc.setDirectoryForTemplateLoading(templateDir);
        } catch (Exception e) {
      ....
      ....

directory structure of project 2 

HotelWebApp
--src
----main
------webapp
--------template
-----------listHotels.ftl

when i run the second project it is throwing exception .. stack trace is
below..

java.io.FileNotFoundException: \template does not exist.
        at 
freemarker.cache.FileTemplateLoader$1.run(FileTemplateLoader.java:125)
        at java.security.AccessController.doPrivileged(Native Method)
        at 
freemarker.cache.FileTemplateLoader.<init>(FileTemplateLoader.java:122)
        at 
freemarker.cache.FileTemplateLoader.<init>(FileTemplateLoader.java:108)
        at
freemarker.template.Configuration.setDirectoryForTemplateLoading(Configuration.java:314)
----
----

can any one please help me to solve this issue? i am trying this by
following
"\restlet-1.1.1\src\org.restlet.example\org\restlet\example\book\restlet\ch8"
sample application.

Thanks in advance. 

-- 
View this message in context: 
http://n2.nabble.com/Maven-Dependancy-Referances-tp2088190p2088190.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=995002

Reply via email to