cancel
Showing results for 
Search instead for 
Did you mean: 

XSL Include in WCM Template, incorrect FileNotFoundException

cgarnoud
Champ in-the-making
Champ in-the-making
Hello,

I am working on a project and we are using Alfresco Enterprise 2.2.0 with Alfresco WCM 2.2.0. Currently I am trying to get my WebForm XSLT renditions to render and run into trouble when I try to use xsl:includes.

Currently I am totally lost on why and how the xsl:include is failing. I updated the main Tomcat log4j with:

log4j.logger.org.apache.xalan.templates = debug
log4j.logger.org.alfresco.web.forms=debug
log4j.logger.org.alfresco.web.bean =debug

The debug information shows that the rendering engine is unable to retrieve the included xsl file (/templates-common/content-page.html.xsl, full path: http://preview.admin.fimf.www--sandbox.10-36-184-74.ip.alfrescodemo.net:8180/templates-common/conten...).

When I however open a remote desktop connection to the server, and enter the url mentioned in the below log, I can actually access the file and see all its contents. (This indicates that the virtual tomcat is running correctly I assume?)

Is the rendering engine using some sort of other DNS, rather than the system one, or do I need to set additional configuration settings?

I don't get any security warnings in my windows Event viewer, or in the firewall.

This doesn't seem to be a caching issue, as I have restarted the tomcat's and still get the same problem.


09:16:29,532 DEBUG [web.forms.XSLTRenderingEngine] request to resolve href /templates-common/content-page.html.xsl using base C:\Tomcat 5.5\dummy.xsl
09:16:29,532 DEBUG [web.forms.RenderingEngineTemplateImpl] request to resolve resource /templates-common/content-page.html.xsl webapp url is http://preview.admin.fimf.www--sandbox.10-36-184-74.ip.alfrescodemo.net:8180 and data dictionary workspace is workspace://SpacesStore/d06dd4e3-5f89-11dd-9e9f-39ce74196925
09:16:29,532 DEBUG [web.forms.RenderingEngineTemplateImpl] loading http://preview.admin.fimf.www--sandbox.10-36-184-74.ip.alfrescodemo.net:8180/templates-common/conten...
09:16:29,547 DEBUG [web.forms.RenderingEngineTemplateImpl] java.io.FileNotFoundException: http://preview.admin.fimf.www--sandbox.10-36-184-74.ip.alfrescodemo.net:8180/templates-common/conten...
09:16:29,547 DEBUG [web.forms.XSLTRenderingEngine] error unable to resolve href /templates-common/content-page.html.xsl
09:16:29,563 ERROR [ui.common.Utils] error regenerating rendition using themelist.html.xsl: errors encountered creating tranformer …
unable to resolve href /templates-common/content-page.html.xsl

org.alfresco.web.forms.RenderingEngine$RenderingException: errors encountered creating tranformer …
unable to resolve href /templates-common/content-page.html.xsl

   at org.alfresco.web.forms.XSLTRenderingEngine.render(XSLTRenderingEngine.java:490)
   at org.alfresco.web.forms.XSLTRenderingEngine.render(XSLTRenderingEngine.java:377)
   at org.alfresco.web.forms.RenderingEngineTemplateImpl.render(RenderingEngineTemplateImpl.java:328)
   at org.alfresco.web.forms.RenderingEngineTemplateImpl.render(RenderingEngineTemplateImpl.java:301)
   at org.alfresco.web.forms.FormInstanceDataImpl.regenerateRenditions(FormInstanceDataImpl.java:255)
   at org.alfresco.web.bean.wcm.EditWebContentWizard.saveContent(EditWebContentWizard.java:218)
   at org.alfresco.web.bean.wcm.CreateWebContentWizard.finishImpl(CreateWebContentWizard.java:390)
   at org.alfresco.web.bean.dialog.BaseDialogBean$1.execute(BaseDialogBean.java:122)
   at org.alfresco.web.bean.dialog.BaseDialogBean$1.execute(BaseDialogBean.java:119)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:241)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:171)
   at org.alfresco.web.bean.dialog.BaseDialogBean.finish(BaseDialogBean.java:128)
   at org.alfresco.web.bean.wizard.WizardManager.finish(WizardManager.java:540)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   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:269)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:81)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
   at java.lang.Thread.run(Unknown Source)
09:16:29,578 ERROR [ui.common.Utils] error regenerating rendition using themelist-all.html.xsl: errors encountered creating tranformer …
unable to resolve href /templates-common/content-page.html.xsl

org.alfresco.web.forms.RenderingEngine$RenderingException: errors encountered creating tranformer …
unable to resolve href /templates-common/content-page.html.xsl

   at org.alfresco.web.forms.XSLTRenderingEngine.render(XSLTRenderingEngine.java:490)
   at org.alfresco.web.forms.XSLTRenderingEngine.render(XSLTRenderingEngine.java:377)
   at org.alfresco.web.forms.RenderingEngineTemplateImpl.render(RenderingEngineTemplateImpl.java:328)
   at org.alfresco.web.forms.RenderingEngineTemplateImpl.render(RenderingEngineTemplateImpl.java:301)
   at org.alfresco.web.forms.FormInstanceDataImpl.regenerateRenditions(FormInstanceDataImpl.java:255)
   at org.alfresco.web.bean.wcm.EditWebContentWizard.saveContent(EditWebContentWizard.java:218)
   at org.alfresco.web.bean.wcm.CreateWebContentWizard.finishImpl(CreateWebContentWizard.java:390)
   at org.alfresco.web.bean.dialog.BaseDialogBean$1.execute(BaseDialogBean.java:122)
   at org.alfresco.web.bean.dialog.BaseDialogBean$1.execute(BaseDialogBean.java:119)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:241)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:171)
   at org.alfresco.web.bean.dialog.BaseDialogBean.finish(BaseDialogBean.java:128)
   at org.alfresco.web.bean.wizard.WizardManager.finish(WizardManager.java:540)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   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:269)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:81)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
   at java.lang.Thread.run(Unknown Source)
6 REPLIES 6

howejr77
Champ in-the-making
Champ in-the-making
Do you push the included schema file into the staging site and do you have the virtualization server running?

Both of these are necessary for included schema to be picked up…

cgarnoud
Champ in-the-making
Champ in-the-making
Yes, the virtualization server is running.

Loading the xsl manually from the url mentioned by the debug logging actually works.

The xsl is also on the staging server, although in the future might be in an other version. That should not give a java.io.FileNotFoundException, but only some XSL errors at most.

Thank you for looking into my thread.

roxanne
Champ in-the-making
Champ in-the-making
hi!

while trying to include another xsl using include,

i get this error:

unable to resolve href

please let me know a solution

cgarnoud
Champ in-the-making
Champ in-the-making
Hi Roxanne,

We worked around the problem by having our Ant scripts resolve the imports before deploying them into Alfresco. This however does not solve the actual problem.

Kind regards

-r-

roxanne
Champ in-the-making
Champ in-the-making
Hi Arnoud!

Thanks a lot for looking into this….

is there any other way i can include an external xml file in my xsl?

i've tried the following:

this is my xsl:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  xmlns:sample="http://sample.org" xmlns:my_ns="http://www.alfresco.org/alfresco/my_ns" exclude-result-prefixes="xsl sample fn" xmlns:fn="http://www.w3.org/2005/02/xpath-functions"  version="1.0">       
   <xsl:output method="xml" indent="yes"/>



<xsl:template match="/Home/properties">

        <xsl:apply-templates select="document('properties.xml')/Home/properties/property[name='country']/value"/>  
   

</xsl:template>
</xsl:stylesheet>



this is my simple xml:


<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="properties2.xsl"?>
<Home>
<properties>
  <property>
   <name>language</name>
   <value>en</value>
</property>

<property>
   <name>country</name>
   <value>US</value>
</property>
</properties>
</Home>





i'm trying to retrieve a value for a key…
outside alfresco, i get this answer: US, which is right.

but i don't know how to implement it in alfresco.

do i have to correct the relative path/should there be another namespace? /is there any other alternative?

in any case, please do send me a complete solution!

thanku very very much!

rox

dman776
Champ in-the-making
Champ in-the-making
any resolution to this?  I am also trying to include an XML document (web script) in my rend template.