AnsweredAssumed Answered

Simple Freemarker rendition doesn't work

Question asked by dfundak on Jan 16, 2009
Hi, I'm trying to use freemarker rendition in simple wcm form.

I use xsd:

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:si="http://www.alfresco.org/alfresco/simple"
           targetNamespace="http://www.alfresco.org/alfresco/simple"
           elementFormDefault="qualified">
  <xs:element name="simple">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="string" type="xs:normalizedString"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>


and freemarker template:

<#ftl ns_prefixes={"si":"http://www.alfresco.org/alfresco/simple"}>
<html>
  <body>
  ${simple.string}
  </body>
</html>


When I hit next button in WCM form creation dialog I've got an empty error message in Web Client:
http://dfundak.googlepages.com/an_error.JPG

and error like this in tomcat:

java.lang.NullPointerException
        at java.util.StringTokenizer.<init>(StringTokenizer.java:197)
        at java.util.StringTokenizer.<init>(StringTokenizer.java:219)
        at org.alfresco.web.bean.wcm.CreateWebContentWizard.saveContent(CreateWe
bContentWizard.java:600)
        at org.alfresco.web.bean.wcm.CreateWebContentWizard$2.execute(CreateWebC
ontentWizard.java:285)
        at org.alfresco.web.bean.wcm.CreateWebContentWizard$2.execute(CreateWebC
ontentWizard.java:282)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransacti
on(RetryingTransactionHelper.java:320)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransacti
on(RetryingTransactionHelper.java:227)
        at org.alfresco.web.bean.wcm.CreateWebContentWizard.next(CreateWebConten
tWizard.java:293)
        at org.alfresco.web.bean.wizard.WizardManager.next(WizardManager.java:54
1)
        at sun.reflect.GeneratedMethodAccessor1337.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:618)
        at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java
:132)
        at org.apache.myfaces.application.ActionListenerImpl.processAction(Actio
nListenerImpl.java:61)
        at javax.faces.component.UICommand.broadcast(UICommand.java:109)
        at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:9
7)
        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1
71)
        at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(Invoke
ApplicationExecutor.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(Appl
icationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
        at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(Authentica
tionFilter.java:81)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:286)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:845)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ss(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
7)
        at java.lang.Thread.run(Thread.java:810)

Looks like the problem with FreeMarkerRenderingEngine class.

Any ideas?

Outcomes