AnsweredAssumed Answered

Error en WebForm y WebProject

Question asked by ruben.arjonilla on Jun 1, 2011
Buenos dias,

Tengo un problema con un WebForm que estoy utilizando dentro de un web project.
Estoy usando alfresco 3.4d, aunque en 3.3g tambien me da el mismo error.
Este WebForm, me genera un html, usando una plantilla ftl.

En el webProject, cuando le damos al "botón" Browse Website, tengo creada una carpeta con el nombre "www", y dentro de ella, otra carpeta con el nombre "menus", y dentro de esta tengo varios ficheros .ftl, entre ellos un fichero que se llama menu_home.ftl
por lo que me queda /www/menus/menu_home.ftl

Os pongo el WebForm en cuestion (es muy simple, simplemente para hacer la prueba del error que me da)

prueba.xsd:

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:alf="http://www.alfresco.org" elementFormDefault="qualified">
     <xs:element name="webform">
      <xs:complexType>
         <xs:sequence>
            <xs:element name="title" type="xs:normalizedString" minOccurs="1" maxOccurs="1" />
         </xs:sequence>
      </xs:complexType>
   </xs:element>
</xs:schema>

prueba.ftl:
<html>
   <head>
      <title>${webform.title}</title>
   </head>
   <body>
<#– Este include es el que me hace fallar el WebForm –>
      <#include "/www/menus/menu_home.ftl">
   </body>
</html>

El webForm me funciona correctamente, siempre y cuando no haga el include, me genera el html en la carpeta donde yo le digo al configurar el webForm el WebProject, el unico problema lo tengo al intentar hacer el include a el fichero de dentro del website "/www/menus/menu_home.ftl".

En el WebSite, el fichero existe, esta en la ruta que le pongo en el prueba.ftl, pero siempre me salta el siguiente error al intentar generar el html:
freemarker.template.TemplateException: Error reading included file www/menus/menu_home.ftl
   at freemarker.core.Include.accept(Include.java:167)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.MixedContent.accept(MixedContent.java:92)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.Environment.process(Environment.java:190)
   at freemarker.template.Template.process(Template.java:237)
   at org.alfresco.web.forms.FreeMarkerRenderingEngine.render(FreeMarkerRenderingEngine.java:129)
   at org.alfresco.web.forms.RenderingEngineTemplateImpl.render(RenderingEngineTemplateImpl.java:365)
   at org.alfresco.web.forms.RenderingEngineTemplateImpl.render(RenderingEngineTemplateImpl.java:332)
   at org.alfresco.web.bean.wcm.CreateWebContentWizard.saveContent(CreateWebContentWizard.java:551)
   at org.alfresco.web.bean.wcm.CreateWebContentWizard$2.execute(CreateWebContentWizard.java:276)
   at org.alfresco.web.bean.wcm.CreateWebContentWizard$2.execute(CreateWebContentWizard.java:272)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:381)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:253)
   at org.alfresco.web.bean.wcm.CreateWebContentWizard.next(CreateWebContentWizard.java:284)
   at org.alfresco.web.bean.wizard.WizardManager.next(WizardManager.java:554)
   at sun.reflect.GeneratedMethodAccessor1413.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:132)
   at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:61)
   at javax.faces.component.UICommand.broadcast(UICommand.java:109)
   at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
   at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
   at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
   at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
   at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:104)
   at sun.reflect.GeneratedMethodAccessor774.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:116)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
   at $Proxy235.doFilter(Unknown Source)
   at org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:82)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.alfresco.repo.web.filter.beans.NullFilter.doFilter(NullFilter.java:68)
   at sun.reflect.GeneratedMethodAccessor774.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:116)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
   at $Proxy235.doFilter(Unknown Source)
   at org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:82)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:58)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
   at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.FileNotFoundException: Template www/menus/menu_home.ftl not found.
   at freemarker.template.Configuration.getTemplate(Configuration.java:489)
   at freemarker.core.Environment.getTemplateForInclusion(Environment.java:1465)
   at freemarker.core.Include.accept(Include.java:157)
   … 64 more
10:05:27,509 User:admin ERROR [ui.common.Utils] Error generating rendition using webForm.ftl: freemarker.template.TemplateException: Error reading included file www/menus/menu_home.ftl
org.alfresco.web.forms.RenderingEngine$RenderingException: freemarker.template.TemplateException: Error reading included file www/menus/menu_home.ftl
   at org.alfresco.web.forms.FreeMarkerRenderingEngine.render(FreeMarkerRenderingEngine.java:134)
   at org.alfresco.web.forms.RenderingEngineTemplateImpl.render(RenderingEngineTemplateImpl.java:365)
   at org.alfresco.web.forms.RenderingEngineTemplateImpl.render(RenderingEngineTemplateImpl.java:332)
   at org.alfresco.web.bean.wcm.CreateWebContentWizard.saveContent(CreateWebContentWizard.java:551)
   at org.alfresco.web.bean.wcm.CreateWebContentWizard$2.execute(CreateWebContentWizard.java:276)
   at org.alfresco.web.bean.wcm.CreateWebContentWizard$2.execute(CreateWebContentWizard.java:272)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:381)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:253)
   at org.alfresco.web.bean.wcm.CreateWebContentWizard.next(CreateWebContentWizard.java:284)
   at org.alfresco.web.bean.wizard.WizardManager.next(WizardManager.java:554)
   at sun.reflect.GeneratedMethodAccessor1413.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:132)
   at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:61)
   at javax.faces.component.UICommand.broadcast(UICommand.java:109)
   at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
   at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
   at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
   at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
   at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:104)
   at sun.reflect.GeneratedMethodAccessor774.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:116)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
   at $Proxy235.doFilter(Unknown Source)
   at org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:82)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.alfresco.repo.web.filter.beans.NullFilter.doFilter(NullFilter.java:68)
   at sun.reflect.GeneratedMethodAccessor774.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:116)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
   at $Proxy235.doFilter(Unknown Source)
   at org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:82)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:58)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
   at java.lang.Thread.run(Thread.java:619)
Caused by: freemarker.template.TemplateException: Error reading included file www/menus/menu_home.ftl
   at freemarker.core.Include.accept(Include.java:167)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.MixedContent.accept(MixedContent.java:92)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.Environment.process(Environment.java:190)
   at freemarker.template.Template.process(Template.java:237)
   at org.alfresco.web.forms.FreeMarkerRenderingEngine.render(FreeMarkerRenderingEngine.java:129)
   … 58 more
Caused by: java.io.FileNotFoundException: Template www/menus/menu_home.ftl not found.
   at freemarker.template.Configuration.getTemplate(Configuration.java:489)
   at freemarker.core.Environment.getTemplateForInclusion(Environment.java:1465)
   at freemarker.core.Include.accept(Include.java:157)
   … 64 more

Basicamente dice que no encuentra el fichero menu_home.ftl

Alguna idea de que puedo estar haciendo mal?
o acaso desde el .ftl del WebForm no tengo acceso dentro del webSite?

De ser asi, alguna idea de como puedo solucionar el problema?

Muchas gracias de antemano

Outcomes