cancel
Showing results for 
Search instead for 
Did you mean: 

Object is not persistent after creation

Not applicable
Hi,
i have an issue in alfresco 4 (same issue does not exist in 3.4.d).
I use alfresco 4.0.d community, solr, mysql, opencmis.
This is my step (in java code):

//create cmis session

//call alfresco webscript with http get (where i create a folder)

// get folder with noderef (webscript answer)
session.getObjectById(noderef);


After this code i have an exception: CMISObjectNotFoundException
I think that this issue is solr issue… but i don't know how resolve it.
Before I open a bug on jira, have you any suggestions?

This is stack trace:


2012-06-27 17:20:19,234  ERROR [extensions.webscripts.AbstractRuntime] [http-8080-42] Exception from executeScript - redirecting to status template error: 05270083 Unable to find object Node Type: {http://www.alfresco.org/model/content/1.0}folder   Node Ref: workspace://SpacesStore/2276cf9a-5b4c-42cc-9c36-2ab101d23ceb
org.springframework.extensions.webscripts.WebScriptException: 05270083 Unable to find object Node Type: {http://www.alfresco.org/model/content/1.0}folder   Node Ref: workspace://SpacesStore/2276cf9a-5b4c-42cc-9c36-2ab101d23ceb
   at org.alfresco.repo.cmis.reference.ObjectIdReference.getNodeRef(ObjectIdReference.java:63)
   at org.alfresco.repo.cmis.rest.CMISScript.getNode(CMISScript.java:362)
   at sun.reflect.GeneratedMethodAccessor803.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:155)
   at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:243)
   at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:66)
   at org.mozilla.javascript.gen.c13._c1(file:/home/qbruser/apps/beefly/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/cmis/item.get.js:14)
   at org.mozilla.javascript.gen.c13.call(file:/home/qbruser/apps/beefly/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/cmis/item.get.js)
   at org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRuntime.java:108)
   at org.mozilla.javascript.gen.c13._c4(file:/home/qbruser/apps/beefly/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/cmis/item.get.js:82)
   at org.mozilla.javascript.gen.c13.call(file:/home/qbruser/apps/beefly/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/cmis/item.get.js)
   at org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRuntime.java:108)
   at org.mozilla.javascript.gen.c13._c0(file:/home/qbruser/apps/beefly/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/cmis/item.get.js:86)
   at org.mozilla.javascript.gen.c13.call(file:/home/qbruser/apps/beefly/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/cmis/item.get.js)
   at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)
   at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2834)
   at org.mozilla.javascript.gen.c13.call(file:/home/qbruser/apps/beefly/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/cmis/item.get.js)
   at org.mozilla.javascript.gen.c13.exec(file:/home/qbruser/apps/beefly/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/cmis/item.get.js)
   at org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:483)
   at org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:191)
   at org.alfresco.repo.processor.ScriptServiceImpl.execute(ScriptServiceImpl.java:212)
   at org.alfresco.repo.processor.ScriptServiceImpl.executeScript(ScriptServiceImpl.java:174)
   at org.alfresco.repo.web.scripts.RepositoryScriptProcessor.executeScript(RepositoryScriptProcessor.java:102)
   at org.springframework.extensions.webscripts.AbstractWebScript.executeScript(AbstractWebScript.java:1193)
   at org.alfresco.repo.cmis.rest.CMISWebScript.executeScript(CMISWebScript.java:46)
   at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:86)
   at org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryContainer.java:393)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:388)
   at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:462)
   at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:500)
   at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:316)
   at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:372)
   at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)
   at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:118)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:58)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
   at java.lang.Thread.run(Thread.java:662)
Caused by: org.alfresco.cmis.CMISObjectNotFoundException: Unable to find object Node Type: {http://www.alfresco.org/model/content/1.0}folder   Node Ref: workspace://SpacesStore/2276cf9a-5b4c-42cc-9c36-2ab101d23ceb
   at org.alfresco.cmis.mapping.CMISServicesImpl.getObject(CMISServicesImpl.java:1384)
   at org.alfresco.cmis.mapping.CMISServicesImpl.getReadableObject(CMISServicesImpl.java:1462)
   at org.alfresco.repo.cmis.reference.ObjectIdReference.getNodeRef(ObjectIdReference.java:59)
   … 52 more


Thanks,

            -ft
4 REPLIES 4

jpotts
World-Class Innovator
World-Class Innovator
If you wait a while before you issue the getObjectById call, does the call eventually succeed? You may be falling victim to the "eventually consistent" limitation of Solr. You cannot create a node and then immediately ask for it because Solr indexing happens asynchronously.

Also, it appears that you may be using the deprecated CMIS URLs (/alfresco/s/api/cmis). Please make sure you are using the new, OpenCMIS based URLs (/alfresco/cmisatom) in Alfresco 4.

Jeff

Not applicable
Hi jeff,

thank you for your reply.
I also try a "do while" after webscript call for retrieve object (don't try at home! ahaha), but i receive same exception every time.
But, if I copy noderef from sysout exception and paste it to node browser, solr retrieve node (during "do while" loops and throws exceptions because solr don't find node)!!!!
It is too strange!

What do you think?


           -ft

jpotts
World-Class Innovator
World-Class Innovator
If your repo is small enough for a lucene full index to be practical, I think I'd reconfigure with Lucene and see if the problem goes away. Then you'd know for sure if it is a Solr thing.

Jeff

mrogers
Star Contributor
Star Contributor
Get Object By Id shouldn't be using search.

Could you post your code please, the detail is sparse.