cancel
Showing results for 
Search instead for 
Did you mean: 

Cmis checkin problem

sharma_avtansh
Champ in-the-making
Champ in-the-making
Hi,

I am using widows server 2008 and alfresco Community - 5.0.0 (d r99759-b2). I have a constraint that I cannot use any library. Please suggest the solution and please update the file cmis-article given in sticky post for latest versions. Since you all well versed with the product but as a new comer it becomes very difficult when http urls are changing for every versions

I am using curl to post the request

curl -X POST -uadmin:admin "http://localhost:8080/alfresco/cmisatom/9e576c92-0890-4a49-af4f-eb2acdd478e7/c
hildren?id=workspace://SpacesStore/41c1dd8a-74ed-481f-907c-e0b18fcc7429&versioni
ngState=major" -H "Content-Type: application/atom+xml" -d @/createFile.atom.xml

I have tried the other way too

curl -X POST -uadmin:admin "http://localhost:8080/alfresco/cmisatom/9e576c92-0890-4a49-af4f-eb2acdd478e7/c
hildren?id=workspace://SpacesStore/41c1dd8a-74ed-481f-907c-e0b18fcc7429&versioni
ngState=major" -H "Content-Type: application/atom+xml" -d createFile.atom.xml


Content of file createFile.atom.xml is

<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom"
xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/"
xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908">
<title>sample-a.txt</title>
<summary>A sample whitepaper named Sample A</summary>
<content type="application/text">
d2luZG93cwlhZG1pbmlzdHJhdG9yCWFkbWluQDEyMw0Kc3FsCXNhCXB3ZEAxMjMNCg0Kd2luLXB1cHQyOWhoMTg3
</content>
<cmisraSmiley Surprisedbject>
<cmisSmiley Tongueroperties>
<cmisSmiley TongueropertyId
propertyDefinitionId="cmisSmiley SurprisedbjectTypeId"><cmis:value>cmis:document</c
mis:value></cmisSmiley TongueropertyId>
</cmisSmiley Tongueroperties>
</cmisraSmiley Surprisedbject>
</entry>

I am getting below error
<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–>Invalid XML!<!–/message–></p><hr noshade='noshade'/><!–stacktrace–><pre>
org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException: Invalid XML!
   at org.apache.chemistry.opencmis.server.shared.Dispatcher.dispatch(Dispatcher.java:95)
   at org.apache.chemistry.opencmis.server.impl.atompub.CmisAtomPubServlet.dispatch(CmisAtomPubServlet.java:226)
   at org.apache.chemistry.opencmis.server.impl.atompub.CmisAtomPubServlet.service(CmisAtomPubServlet.java:173)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
   at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
   at org.alfresco.repo.webdav.auth.AuthenticationFilter.doFilter(AuthenticationFilter.java:252)
   at sun.reflect.GeneratedMethodAccessor614.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:125)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   at com.sun.proxy.$Proxy275.doFilter(Unknown Source)
   at org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:82)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
   at org.alfresco.web.app.servlet.CmisSecurityContextCleanerFilter.doFilter(CmisSecurityContextCleanerFilter.java:49)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
   at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
   at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
   at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)
   at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
   at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2466)
   at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2455)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
   at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
   at java.lang.Thread.run(Unknown Source)
Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
at [row,col {unknown-source}]: [1,0]
   at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:677)
   at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2139)
   at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2045)
   at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1134)
   at org.apache.chemistry.opencmis.commons.impl.XMLUtils.next(XMLUtils.java:228)
   at org.apache.chemistry.opencmis.server.impl.atompub.AtomEntryParser.parse(AtomEntryParser.java:223)
   at org.apache.chemistry.opencmis.server.impl.atompub.ObjectService$Create.serve(ObjectService.java:96)
   at org.apache.chemistry.opencmis.server.shared.Dispatcher.dispatch(Dispatcher.java:91)
   … 41 more

</pre><!–/stacktrace–><hr noshade='noshade'/></body></html>


4 REPLIES 4

jpotts
World-Class Innovator
World-Class Innovator
The CMIS service URL for 5.0 looks like this:

http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.0/atom

That will give you the Atom Pub binding for CMIS 1.0. Change the version to 1.1 if you want CMIS 1.1.

If you aren't going to use a library, you might rather use the browser binding. It's a bit easier to work with.

Also, in future posts you might want to wrap code, XML, and stack traces in a blockquote tag so that your tags will show up in your post.

Jeff

Hi,

Thanks for your reply Jeff but I am still unable to check in document. I am getting errors. Csn you please provide me some help regarding what i Should actually use the format. I have tried again using below command and I have attached the error output as error.txt file

curl -X POST -u admin:admi
n "http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.0/atom/9e
576c92-0890-4a49-af4f-eb2acdd478e7/children?id=workspace://SpacesStore/41c1dd8a-
74ed-481f-907c-e0b18fcc7429&versioningState=major" -H "Content-Type: application
/atom+xml" -d checkinfile.atom.xml


sharma_avtansh
Champ in-the-making
Champ in-the-making
Hi Jeff,


Can you please help me out in above problem. I have attached error file as well as the url combinations I tried. May be you can give the cmis-article according to new alfresco versions and all here can benefit from that pdf file.


jpotts
World-Class Innovator
World-Class Innovator
You should be using a library instead of the raw protocol. But I know your original post says you are not able to. If that is the case, you'll need to read the CMIS spec. For example, the spec says that the checkin should be a PUT against the PWC entry and that the content-type should be "application/atom+xml;type=entry".

The spec also includes sample request/response logs which will show you exactly which URL to PUT against and an example entity to send.

See http://docs.oasis-open.org/cmis/CMIS/v1.1/csd01/CMIS-v1.1-csd01.html#x1-4880002.