AnsweredAssumed Answered

Unable to locate resource resource for :nodes children

Question asked by alexandreb on Jun 26, 2017
Latest reply on Jun 26, 2017 by alexandreb

Hi, I'm currently developping an application using REST api of Alfresco.
I'm uploading files through the following code :

 

var request = require('request')

  var fs = require('fs')
  var r = request.post('http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children?alf_ticket='+ticket, function callback(err, httpResponse, body) {
        if(err || JSON.parse(body).error) {
            console.log('Upload failed : ' + body)
        }else{
            nodeId = JSON.parse(body).entry.id
            console.log('Upload success : '+ nodeId)
        }
    })

 

    var form = r.form()
    form.append("name", fileName)

    form.append("nodeType", "cm:content")   

    form.append("relativePath", "/Sites/test-site/documentLibrary)
    form.append("filedata",fs.createReadStream(filePath))

 

It works fine on Alfresco Community v5.2 tested on Linux and Windows.
But when I try to make it work on Alfresco One v5.1 I get the following message :

 

{"error":{"errorKey":"Unable to locate resource resource for :nodes children","statusCode":400,"briefSummary":"05260205 Unable to locate resource resource for :nodes children","stackTrace":"[org.alfresco.rest.framework.core.ResourceLookupDictionary.locateRelationResource(ResourceLookupDictionary.java:89), org.alfresco.rest.framework.core.ResourceLookupDictionary.locateResource(ResourceLookupDictionary.java:114), org.alfresco.rest.framework.webscripts.AbstractResourceWebScript.execute(AbstractResourceWebScript.java:88), org.alfresco.rest.framework.webscripts.ApiWebScript.execute(ApiWebScript.java:152), org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:467), org.alfresco.rest.api.PublicApiRepositoryContainer.transactionedExecute(PublicApiRepositoryContainer.java:70), org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:656), org.alfresco.repo.web.scripts.RepositoryContainer.executeScriptInternal(RepositoryContainer.java:428), org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:308), org.alfresco.rest.api.PublicApiRepositoryContainer.access$001(PublicApiRepositoryContainer.java:51), org.alfresco.rest.api.PublicApiRepositoryContainer$1.doWork(PublicApiRepositoryContainer.java:106), org.alfresco.repo.tenant.TenantUtil.runAsWork(TenantUtil.java:126), org.alfresco.repo.tenant.TenantUtil.runAsTenant(TenantUtil.java:95), org.alfresco.rest.api.PublicApiRepositoryContainer.executeScript(PublicApiRepositoryContainer.java:102), org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:399), org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:210), org.alfresco.repo.web.scripts.TenantWebScriptServlet.service(TenantWebScriptServlet.java:82), org.alfresco.rest.api.PublicApiWebScriptServlet.service(PublicApiWebScriptServlet.java:60), javax.servlet.http.HttpServlet.service(HttpServlet.java:727), org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303), org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208), org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52), org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241), org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208), org.alfresco.module.aosmodule.service.ContextRootFilter.doFilter(ContextRootFilter.java:93), org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241), org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208), org.alfresco.repo.web.filter.beans.NullFilter.doFilter(NullFilter.java:75), sun.reflect.GeneratedMethodAccessor1814.invoke(Unknown Source), sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source), java.lang.reflect.Method.invoke(Unknown Source), org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:132), org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172), org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204), com.sun.proxy.$Proxy320.doFilter(Unknown Source), org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:89), org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241), org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208), org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:68), org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241), org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208), org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220), org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122), org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504), org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170), org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103), org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950), org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116), org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421), org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074), org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611), org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2466), org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2455), java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source), java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source), org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61), java.lang.Thread.run(Unknown Source)]","descriptionURL":"http://developer.alfresco.com/ErrorsExplained.html#Unable to locate resource resource for :nodes children"}}

 

Does anyone have an idea why it happens ?

Thanks in advance

Outcomes