cancel
Showing results for 
Search instead for 
Did you mean: 

Should Nuxeo CMIS return a HTTP Status 404 for an object (repository) that does not exist?

janice_
Champ in-the-making
Champ in-the-making

Ran the following command which attempts to retrieve repository information on a non-existent repository named "foobar". Nuxeo CMIS returns a HTTP Status 400 invalidArgument. Should a HTTP Status 404 objectNotFound be returned instead for an object (repository) that does not exist?

$ curl -uusername:password "http://demo.nuxeo.com:80/nuxeo/atom/cmis/foobar"

<html><head><title>Apache Chemistry OpenCMIS - invalidArgument error</title><style><!--H1 {font-size:24px;line-height:normal;font-weight:bold;background-color:#f0f0f0;color:#003366;border-bottom:1px solid #3c78b5;padding:2px;} BODY {font-family:Verdana,arial,sans-serif;color:black;font-size:14px;} HR {color:#3c78b5;height:1px;}--></style></head><body><h1>HTTP Status 400 - <!--exception-->invalidArgument<!--/exception--></h1><p><!--message-->No such repository: foobar<!--/message--></p><hr noshade='noshade'/><!--stacktrace--><pre> org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException: No such repository: foobar at org.nuxeo.ecm.core.opencmis.bindings.NuxeoCmisServiceFactory.getService(NuxeoCmisServiceFactory.java:65) at org.apache.chemistry.opencmis.server.impl.atompub.CmisAtomPubServlet.dispatch(CmisAtomPubServlet.java:213) at ... ...

3 REPLIES 3

Florent_Guillau
World-Class Innovator
World-Class Innovator

Yes we could return 404 (objectNotFound) in that case, as the CMIS 1.1 spec now says:

objectNotFound
    Cause: The service call has speci?ed an object, an object-type or a repository that does not exist.

Note that for CMIS 1.0 the spec was simply the following, so 400 (invalidArgument) was legitimate:

objectNotFound
    Cause: The service call has specified an object that does not exist in the Repository.

Could you open a NXP ticket for this improvement?

Note that I haven't looked yet, but it may very well be that the fix has to be in the OpenCMIS library and not Nuxeo's code.

Opened JIRA https

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.