Hi, thank you for your replies.
Martijn - i have pemissons set up as per documentation. Sitewriters have edit on hippodoc, versioning, and hipporequests, and readwrite on form data and hippo folders.
The documents in question were oririginally created by the sitewriter user via the api. The create and return method makes the doc for which publishing succedes. The propblem is editing those doc via subsequent API calls.
My guess is that the code should obtain an editable instance somehow - rather than just calling 'get document' if the document exists already. Unfortunatelly all hippo examples only deal with creating a new doc, not editing an existing one, so i haven't found a way to do it.
Like i mentioned before - the funny thing is - if i 'touch' (edit,save,publish) the same doc form the CMS - the api can edit it fine. It's just that consequtive edits by the api leaves the doc in some kind of locked state - so the api can't edit it again, until a proper workflow go-around from via the CMS unlocks it.
Jeroen: please see the full stack trace and some encompassing logs bellow.
Thank you all for your help!
2014-06-30 09:41:35,171 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - ########################### Got an Event ###########################
2014-06-30 09:41:35,172 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - got event: workflow
2014-06-30 09:41:35,173 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - Got workFlow method name of obtainEditableInstance
2014-06-30 09:41:35,173 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - we got an unhandled method obtainEditableInstance
2014-06-30 09:41:35,173 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - ####################################################################
2014-06-30 09:41:35,308 [ERROR] org.onehippo.repository.scxml.SCXMLWorkflowExecutor - Cannot invoke workflow documentworkflow action publish: action not allowed or undefined
org.hippoecm.repository.api.WorkflowException: Cannot invoke workflow documentworkflow action publish: action not allowed or undefined
at org.onehippo.repository.scxml.SCXMLWorkflowExecutor.triggerAction(SCXMLWorkflowExecutor.java:199)
at org.onehippo.repository.scxml.SCXMLWorkflowExecutor.triggerAction(SCXMLWorkflowExecutor.java:172)
at org.onehippo.repository.documentworkflow.DocumentWorkflowImpl.publish(DocumentWorkflowImpl.java:228)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.hippoecm.repository.impl.WorkflowManagerImpl$WorkflowInvocationHandler.invoke(WorkflowManagerImpl.java:370)
at $Proxy326.publish(Unknown Source)
at com.publishing.service.hst.repositories.ArticleRepositoryImpl$1.processWorkflow(ArticleRepositoryImpl.java:69)
at com.publishing.service.hst.repositories.ArticleRepositoryImpl$1.processWorkflow(ArticleRepositoryImpl.java:1)
at org.hippoecm.hst.content.beans.manager.workflow.WorkflowPersistenceManagerImpl.update(WorkflowPersistenceManagerImpl.java:417)
at com.condenast.style.service.hst.repositories.ArticleRepositoryImpl.save(ArticleRepositoryImpl.java:80)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy255.save(Unknown Source)
at com.publishing.service.hst.services.CreationServiceImpl.saveArticle(CreationServiceImpl.java:55)
at com.publishing.site.hst.endpoints.CreationControllerImpl.createArticle(CreationControllerImpl.java:41)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:55)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy257.createArticle(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:165)
at org.hippoecm.hst.jaxrs.cxf.AroundProcessableJAXRSInvoker.invoke(AroundProcessableJAXRSInvoker.java:94)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:89)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:57)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:93)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:237)
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:239)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:213)
at org.hippoecm.hst.jaxrs.cxf.CXFJaxrsService.invoke(CXFJaxrsService.java:147)
at org.hippoecm.hst.core.container.JaxrsRestServiceValve.invoke(JaxrsRestServiceValve.java:38)
at org.hippoecm.hst.core.container.HstSitePipeline$Invocation.invokeNext(HstSitePipeline.java:271)
at org.hippoecm.hst.core.container.GenericResponseHeadersValve.invoke(GenericResponseHeadersValve.java:83)
at org.hippoecm.hst.core.container.HstSitePipeline$Invocation.invokeNext(HstSitePipeline.java:271)
at org.hippoecm.hst.core.container.SubjectBasedSessionValve.invoke(SubjectBasedSessionValve.java:58)
at org.hippoecm.hst.core.container.HstSitePipeline$Invocation.invokeNext(HstSitePipeline.java:271)
at org.hippoecm.hst.core.container.SecurityValve.invoke(SecurityValve.java:158)
at org.hippoecm.hst.core.container.HstSitePipeline$Invocation.invokeNext(HstSitePipeline.java:271)
at org.hippoecm.hst.core.container.CmsSecurityValve.invoke(CmsSecurityValve.java:79)
at org.hippoecm.hst.core.container.HstSitePipeline$Invocation.invokeNext(HstSitePipeline.java:271)
at org.hippoecm.hst.core.container.InitializationValve.invoke(InitializationValve.java:72)
at org.hippoecm.hst.core.container.HstSitePipeline$Invocation.invokeNext(HstSitePipeline.java:271)
at org.hippoecm.hst.core.container.HstSitePipeline.invokeValves(HstSitePipeline.java:170)
at org.hippoecm.hst.core.container.HstSitePipeline.invoke(HstSitePipeline.java:153)
at org.hippoecm.hst.core.container.HstRequestProcessorImpl.processRequest(HstRequestProcessorImpl.java:79)
at org.hippoecm.hst.container.HstFilter.processResolvedSiteMapItem(HstFilter.java:829)
at org.hippoecm.hst.container.HstFilter.doFilter(HstFilter.java:464)
at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:89)
at org.hippoecm.hst.container.XSSUrlFilter.doFilter(XSSUrlFilter.java:49)
at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:89)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:89)
at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:156)
at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:289)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:838)
at com.caucho.network.listen.TcpSocketLink.dispatchRequest(TcpSocketLink.java:1346)
at com.caucho.network.listen.TcpSocketLink.handleRequest(TcpSocketLink.java:1302)
at com.caucho.network.listen.TcpSocketLink.handleRequestsImpl(TcpSocketLink.java:1286)
at com.caucho.network.listen.TcpSocketLink.handleRequests(TcpSocketLink.java:1194)
at com.caucho.network.listen.TcpSocketLink.handleAcceptTaskImpl(TcpSocketLink.java:993)
at com.caucho.network.listen.ConnectionTask.runThread(ConnectionTask.java:117)
at com.caucho.network.listen.ConnectionTask.run(ConnectionTask.java:93)
at com.caucho.network.listen.SocketLinkThreadLauncher.handleTasks(SocketLinkThreadLauncher.java:169)
at com.caucho.network.listen.TcpSocketAcceptThread.run(TcpSocketAcceptThread.java:61)
at com.caucho.env.thread2.ResinThread2.runTasks(ResinThread2.java:173)
at com.caucho.env.thread2.ResinThread2.run(ResinThread2.java:118)
2014-06-30 09:41:35,325 [INFO] com.condenast.style.cms.spring.service.HippoPublicationEventListener - ########################### Got an Event ###########################
2014-06-30 09:41:35,352 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - got event: workflow
2014-06-30 09:41:35,353 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - Got workFlow method name of commitEditableInstance
2014-06-30 09:41:35,354 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - we got an unhandled method commitEditableInstance
2014-06-30 09:41:35,405 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - ####################################################################
2014-06-30 09:41:35,354 [WARN] org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper - javax.ws.rs.WebApplicationException
at com.condenast.style.site.utils.ExceptionAspect.convertHSTToWebApplicationException(ExceptionAspect.java:31)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:603)
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:59)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy257.createArticle(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:165)
at org.hippoecm.hst.jaxrs.cxf.AroundProcessableJAXRSInvoker.invoke(AroundProcessableJAXRSInvoker.java:94)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:89)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:57)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:93)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:237)
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:239)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:213)
at org.hippoecm.hst.jaxrs.cxf.CXFJaxrsService.invoke(CXFJaxrsService.java:147)
at org.hippoecm.hst.core.container.JaxrsRestServiceValve.invoke(JaxrsRestServiceValve.java:38)
at org.hippoecm.hst.core.container.HstSitePipeline$Invocation.invokeNext(HstSitePipeline.java:271)
at org.hippoecm.hst.core.container.GenericResponseHeadersValve.invoke(GenericResponseHeadersValve.java:83)
at org.hippoecm.hst.core.container.HstSitePipeline$Invocation.invokeNext(HstSitePipeline.java:271)
at org.hippoecm.hst.core.container.SubjectBasedSessionValve.invoke(SubjectBasedSessionValve.java:58)
at org.hippoecm.hst.core.container.HstSitePipeline$Invocation.invokeNext(HstSitePipeline.java:271)
at org.hippoecm.hst.core.container.SecurityValve.invoke(SecurityValve.java:158)
at org.hippoecm.hst.core.container.HstSitePipeline$Invocation.invokeNext(HstSitePipeline.java:271)
at org.hippoecm.hst.core.container.CmsSecurityValve.invoke(CmsSecurityValve.java:79)
at org.hippoecm.hst.core.container.HstSitePipeline$Invocation.invokeNext(HstSitePipeline.java:271)
at org.hippoecm.hst.core.container.InitializationValve.invoke(InitializationValve.java:72)
at org.hippoecm.hst.core.container.HstSitePipeline$Invocation.invokeNext(HstSitePipeline.java:271)
at org.hippoecm.hst.core.container.HstSitePipeline.invokeValves(HstSitePipeline.java:170)
at org.hippoecm.hst.core.container.HstSitePipeline.invoke(HstSitePipeline.java:153)
at org.hippoecm.hst.core.container.HstRequestProcessorImpl.processRequest(HstRequestProcessorImpl.java:79)
at org.hippoecm.hst.container.HstFilter.processResolvedSiteMapItem(HstFilter.java:829)
at org.hippoecm.hst.container.HstFilter.doFilter(HstFilter.java:464)
at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:89)
at org.hippoecm.hst.container.XSSUrlFilter.doFilter(XSSUrlFilter.java:49)
at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:89)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:89)
at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:156)
at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:289)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:838)
at com.caucho.network.listen.TcpSocketLink.dispatchRequest(TcpSocketLink.java:1346)
at com.caucho.network.listen.TcpSocketLink.handleRequest(TcpSocketLink.java:1302)
at com.caucho.network.listen.TcpSocketLink.handleRequestsImpl(TcpSocketLink.java:1286)
at com.caucho.network.listen.TcpSocketLink.handleRequests(TcpSocketLink.java:1194)
at com.caucho.network.listen.TcpSocketLink.handleAcceptTaskImpl(TcpSocketLink.java:993)
at com.caucho.network.listen.ConnectionTask.runThread(ConnectionTask.java:117)
at com.caucho.network.listen.ConnectionTask.run(ConnectionTask.java:93)
at com.caucho.network.listen.SocketLinkThreadLauncher.handleTasks(SocketLinkThreadLauncher.java:169)
at com.caucho.network.listen.TcpSocketAcceptThread.run(TcpSocketAcceptThread.java:61)
at com.caucho.env.thread2.ResinThread2.runTasks(ResinThread2.java:173)
at com.caucho.env.thread2.ResinThread2.run(ResinThread2.java:118)
2014-06-30 09:41:35,485 [INFO] com.condenast.style.cms.spring.service.HippoPublicationEventListener - ########################### Got an Event ###########################
2014-06-30 09:41:35,485 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - got event: workflow
2014-06-30 09:41:35,485 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - Got workFlow method name of publish
2014-06-30 09:41:35,486 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - Handeling publish event
2014-06-30 09:41:35,486 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - Document /content/documents/myhippoproject/main/articles/beauty/hair/summer-ponytail-ideas-tom was published
2014-06-30 09:41:43,204 [INFO] com.publishing.service.services.PostPublishServiceImpl - Persisting publish event: PostPublishQueue[id=<null>,publishStatus=RECEIVED,eventType=PUBLISH,canonicalURI=/content/documents/myhippoproject/main/articles/beauty/hair/summer-ponytail-ideas-tom,publishDate=Mon Jun 30 09:41:43 EDT 2014,documentType=article,eventDates=AuditInfoVO[modifiedDate=Mon Jun 30 09:41:43 EDT 2014,createdDate=Mon Jun 30 09:41:43 EDT 2014]]
2014-06-30 09:41:43,328 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - ####################################################################
2014-06-30 09:41:58,525 [WARN] com.publishing.site.hst.endpoints.ArticleControllerV1Impl - beauty/hair/summer-ponytail-ideas-tom
2014-06-30 09:41:35,171 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - ########################### Got an Event ###########################
2014-06-30 09:41:35,172 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - got event: workflow
2014-06-30 09:41:35,173 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - Got workFlow method name of obtainEditableInstance
2014-06-30 09:41:35,173 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - we got an unhandled method obtainEditableInstance
2014-06-30 09:41:35,173 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - ####################################################################
2014-06-30 09:41:35,308 [ERROR] org.onehippo.repository.scxml.SCXMLWorkflowExecutor - Cannot invoke workflow documentworkflow action publish: action not allowed or undefined
org.hippoecm.repository.api.WorkflowException: Cannot invoke workflow documentworkflow action publish: action not allowed or undefined
at org.onehippo.repository.scxml.SCXMLWorkflowExecutor.triggerAction(SCXMLWorkflowExecutor.java:199)
at org.onehippo.repository.scxml.SCXMLWorkflowExecutor.triggerAction(SCXMLWorkflowExecutor.java:172)
at org.onehippo.repository.documentworkflow.DocumentWorkflowImpl.publish(DocumentWorkflowImpl.java:228)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.hippoecm.repository.impl.WorkflowManagerImpl$WorkflowInvocationHandler.invoke(WorkflowManagerImpl.java:370)
at $Proxy326.publish(Unknown Source)
^[[B