'An error occured' - Document of type 'picture' created through PHP automation client

I'm using the PHP automation client to bulk import some images. When I create document 'file' everything works fine, but if I change it to 'picture' it seems to work and I get a response like: _{"entity-type":"document","repository":"default","uid":"6f71c94b-92e6-48ef-a3bb-bc20ed9ddce7","path":"/default-domain/workspaces/Sample Content/13445.jpg","type":"Picture","state":"project","parentRef":"e5ff9e6a-a019-4fc8-a0e0-167db9eb6488","isCheckedOut":true,"changeToken":"1470662900757","title":"13445.jpg","lastModified":"2016-08-08T13:28:20.75Z","facets":["Versionable","Publishable","Picture","Commentable","HasRelatedText"]}_ But then when I go to click on the document I get 'An error occurred'. Even trying an empty picture through curl has the same issue: _curl -X POST -H 'Content-Type: applicat, "properties": {"dc:title": "My great new picture"}}' http://localhost:8080/nuxeo/api/v1/path/default-domain/workspaces/Sample%20Content_ Any advice on any config/parameters I'm missing? Or other ways to achieve this? Thanks

0 votes

1 answers

2173 views

ANSWER

"An error occurred" Yes but what error? Please check the server logs.
08/08/2016

Hi. The full error log is http://pastebin.com/Rm6qsb1w. From what I can tell the main parts are

  • ERROR [http-bio-0.0.0.0-8080-exec-54] [org.nuxeo.ecm.platform.actions.DefaultActionFilter] evaluation of condition #{previewActions.hasPreview} failed: returning false javax.el.ELException: Error reading 'hasPreview' on type org.nuxeo.ecm.platform.preview.seam.PreviewActionBean$$javassist_seam_57
  • ERROR [http-bio-0.0.0.0-8080-exec-54] [org.nuxeo.ecm.platform.web.common.exceptionhandling.DefaultNuxeoExceptionHandler] javax.servlet.ServletException: /widgets/summary/comments_widget_template.xhtml @9,95 test="#{currentDocument.hasFacet('Commentable') and (documentThreadedComments.size > 0)}" Cannot register synch handler in current tx
  • Caused by: javax.transaction.RollbackException: Transaction is marked for rollback
  • exception_message : Transaction is marked for rollback
08/08/2016



Retrying with the automation client (instead of curl/the API) this is now working fine - I think there may have been an issue with permissions.

1 votes