AnsweredAssumed Answered

Freemarker Sort_by gives : InvalidNodeRefException

Question asked by dranakan on Nov 16, 2009
Hello,

I have written a webscript showing node properties. We give the type and get the properties of the nodes. It is not working all the time when I use the sort_by (it's works with somes types but not all). I think I have problem with some data in my Alfresco…

I have a problem when I use Sort_by in my ftl like this :

<#list results?sort_by(["properties","cm:modified"]) as child>
   …
I get this error :

Alfresco    Web Script Status 500 - Erreur Interne de Servlet

The Web Script /alfresco/service/custom/search has responded with a status of 500 - Erreur Interne de Servlet.

500 Description:   Le serveur a recontrer une erreur interne qui l''a empêché de satisfaire la requête.

Message:   Wrapped Exception (with status template): Error during processing of the template 'get(properties) failed on instance of org.alfresco.repo.template.TemplateNode'. Veuillez contacter votre administrateur système.
   
Exception:   org.alfresco.service.cmr.repository.InvalidNodeRefException - Node does not exist: workspace://SpacesStore/92f828be-13d3-44bf-acaa-a4373b3abc5c
   
   org.alfresco.repo.node.db.DbNodeServiceImpl.getNodePairNotNull(DbNodeServiceImpl.java:156)
   org.alfresco.repo.node.db.DbNodeServiceImpl.hasAspect(DbNodeServiceImpl.java:712)
   sun.reflect.GeneratedMethodAccessor273.invoke(Unknown Source)
   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   java.lang.reflect.Method.invoke(Method.java:597)
   org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)
   org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)
   org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
   org.alfresco.repo.transaction.SingleEntryTransactionResourceInterceptor.invokeInternal(SingleEntryTransactionResourceInterceptor.java:163)
   org.alfresco.repo.transaction.SingleEntryTransactionResourceInterceptor.invoke(SingleEntryTransactionResourceInterceptor.java:138)
   org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
   org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   $Proxy7.hasAspect(Unknown Source)
   sun.reflect.GeneratedMethodAccessor273.invoke(Unknown Source)
   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   java.lang.reflect.Method.invoke(Method.java:597)
   org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)
   org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)
   org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
   org.alfresco.repo.tenant.MultiTNodeServiceInterceptor.invoke(MultiTNodeServiceInterceptor.java:110)
   org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
   org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   $Proxy7.hasAspect(Unknown Source)
   sun.reflect.GeneratedMethodAccessor273.invoke(Unknown Source)
   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   java.lang.reflect.Method.invoke(Method.java:597)
   org.alfresco.repo.service.StoreRedirectorProxyFactory$RedirectorInvocationHandler.invoke(StoreRedirectorProxyFactory.java:221)
   $Proxy8.hasAspect(Unknown Source)
   org.alfresco.repo.node.MLPropertyInterceptor.getPivotNodeRef(MLPropertyInterceptor.java:320)
   org.alfresco.repo.node.MLPropertyInterceptor.invoke(MLPropertyInterceptor.java:174)
   org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
   org.alfresco.repo.node.NodeRefPropertyMethodInterceptor.invoke(NodeRefPropertyMethodInterceptor.java:217)
   org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
   org.alfresco.repo.node.NodeRefPropertyMethodInterceptor.invoke(NodeRefPropertyMethodInterceptor.java:217)
   org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
   org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   $Proxy7.getProperties(Unknown Source)
   sun.reflect.GeneratedMethodAccessor286.invoke(Unknown Source)
   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   java.lang.reflect.Method.invoke(Method.java:597)
   org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)
   org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)
   org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
   net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80)
   org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
   org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
   org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
   org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:275)
   org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)
   org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
   org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
   org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
   org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   $Proxy7.getProperties(Unknown Source)
   org.alfresco.repo.template.TemplateNode.getProperties(TemplateNode.java:219)
   sun.reflect.GeneratedMethodAccessor375.invoke(Unknown Source)
   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   java.lang.reflect.Method.invoke(Method.java:597)
   freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:835)
   freemarker.ext.beans.BeanModel.invokeThroughDescriptor(BeanModel.java:276)
   freemarker.ext.beans.BeanModel.get(BeanModel.java:183)
   freemarker.core.SequenceBuiltins$sortBI.sort(SequenceBuiltins.java:318)
   freemarker.core.SequenceBuiltins$sort_byBI$BIMethod.exec(SequenceBuiltins.java:520)
   freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:93)
   freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
   freemarker.core.SequenceBuiltins$SequenceBuiltIn._getAsTemplateModel(SequenceBuiltins.java:89)
   freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
   freemarker.core.IteratorBlock.accept(IteratorBlock.java:94)
   freemarker.core.Environment.visit(Environment.java:208)
   freemarker.core.MixedContent.accept(MixedContent.java:92)
   freemarker.core.Environment.visit(Environment.java:208)
   freemarker.core.IfBlock.accept(IfBlock.java:82)
   freemarker.core.Environment.visit(Environment.java:208)
   freemarker.core.MixedContent.accept(MixedContent.java:92)
   freemarker.core.Environment.visit(Environment.java:208)
   freemarker.core.Environment.process(Environment.java:188)
   freemarker.template.Template.process(Template.java:237)
   org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:201)
   org.alfresco.web.scripts.AbstractWebScript.renderTemplate(AbstractWebScript.java:505)
   org.alfresco.web.scripts.DeclarativeWebScript.renderFormatTemplate(DeclarativeWebScript.java:241)
   org.alfresco.web.scripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:147)
   org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryContainer.java:319)
   org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:320)
   org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:227)
   org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:368)
   org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:390)
   org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:273)
   org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:261)
   org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:139)
   org.alfresco.web.scripts.servlet.WebScriptServlet.service(WebScriptServlet.java:116)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
   org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
   org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
   org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
   java.lang.Thread.run(Thread.java:619)
   
Exception:   freemarker.template.TemplateModelException - get(properties) failed on instance of org.alfresco.repo.template.TemplateNode
   
   freemarker.ext.beans.BeanModel.get(BeanModel.java:223)
   
Exception:   org.alfresco.service.cmr.repository.TemplateException - Error during processing of the template 'get(properties) failed on instance of org.alfresco.repo.template.TemplateNode'. Veuillez contacter votre administrateur système.
   
   org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:205)
   
Exception:   org.alfresco.web.scripts.WebScriptException - Wrapped Exception (with status template): Error during processing of the template 'get(properties) failed on instance of org.alfresco.repo.template.TemplateNode'. Veuillez contacter votre administrateur système.
   
   org.alfresco.web.scripts.AbstractWebScript.createStatusException(AbstractWebScript.java:595)
   
Server:   Alfresco Labs v3.0.0 (Stable 1526) schema 1'002
Time:   16 nov. 2009 11:50:22
   
Diagnostics:   Inspect Web Script (org/alfresco/module/custom/searchresult/searchResults.get)
If I remove the "?sort_by(["properties","cm:modified"])" it's working fine… but I need this sort_by. Same problem if I try with "cm:name"

Thanks

Outcomes