AnsweredAssumed Answered

freemarker.core.InvalidReferenceException

Question asked by kapil.k@globallogic.com on Mar 13, 2008
19:18:37,270 DEBUG [org.alfresco.repo.template.FreeMarkerProcessor] Executing template: com/gl/pac/pac.get.html.ftl
19:18:37,833 ERROR [freemarker.runtime]
Error on line 9, column 1 in com/gl/pac/pac.get.html.ftl
avm.lookupNode('pac-alfresco:/www/avm_webapps/ROOT/media/releases/content/bidding_for_aztec.xml') is undefined.
It cannot be assigned to someNode
The problematic instruction:
———-
==> assignment: someNode=avm.lookupNode('pac-alfresco:/www/avm_webapps/ROOT/media/releases/content/bidding_for_aztec.xml') [on line 9, column 1 in com/gl/pac/pac.get.html.ftl]
———-

Java backtrace for programmers:
———-
freemarker.core.InvalidReferenceException: Error on line 9, column 1 in com/gl/pac/pac.get.html.ftl
avm.lookupNode('pac-alfresco:/www/avm_webapps/ROOT/media/releases/content/bidding_for_aztec.xml') is undefined.
It cannot be assigned to someNode
   at freemarker.core.Assignment.accept(Assignment.java:111)
   at freemarker.core.Environment.visit(Environment.java:196)
   at freemarker.core.MixedContent.accept(MixedContent.java:92)
   at freemarker.core.Environment.visit(Environment.java:196)
   at freemarker.core.Environment.process(Environment.java:176)
   at freemarker.template.Template.process(Template.java:232)

***********************************************************
I get this error when I try to lookup node in ftl:
<#assign someNode = avm.lookupNode('pac-alfresco:/www/avm_webapps/ROOT/media/releases/content/bidding_for_aztec.xml')>
<#assign someDom = someNode.xmlNodeModel>

but NOT if I do this:
>> In JS file
var someNode = avm.lookupNode('pac-alfresco:/www/avm_webapps/ROOT/media/releases/content/bidding_for_aztec.xml');
model.someNode = someNode
>> In FTL file
<#assign someDom = someNode.xmlNodeModel> WORKS FINE.

Please advise what is the resolution?
Also refer: http://issues.alfresco.com/browse/WCM-905

Thanks,
Kapil

Outcomes