<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic CmisStorageException on cmis checkin in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/cmisstorageexception-on-cmis-checkin/m-p/286482#M239612</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;i have a big problem with cmis checkin.&lt;/P&gt;&lt;P&gt;I use Alfresco 5.0.d with Apache OpenCmis 1.0.0 (previous 0.13.0) and AtomPub implementation.&lt;/P&gt;&lt;P&gt;My client side&amp;nbsp;code is:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Document doc = null;&lt;BR /&gt; Document pwc = null;&lt;BR /&gt; ContentStream contentStream = null;&lt;BR /&gt; try {&lt;BR /&gt; // refresh object&lt;BR /&gt; //document.refresh();&lt;/P&gt;&lt;P&gt;// document checkout&lt;BR /&gt; log.info("try to check-out document..");&lt;BR /&gt; ObjectId idOfCheckedOutDocument = document.checkOut();&lt;BR /&gt; log.info("successfully check-out document!");&lt;BR /&gt; // get private working copy of document&lt;BR /&gt; pwc = (Document) session.getObject(idOfCheckedOutDocument);&lt;/P&gt;&lt;P&gt;// create the content stream&lt;BR /&gt; contentStream = getContentStream(session, fileName, content);&lt;/P&gt;&lt;P&gt;log.info(String.format("Content Stream value -&amp;gt; %s", contentStream.getStream()));&lt;BR /&gt; log.info(String.format("Content Stream value -&amp;gt; %s", contentStream.getLength()));&lt;/P&gt;&lt;P&gt;// document checkin&lt;BR /&gt; log.info("try to check-in document");&lt;BR /&gt; //pwc.refresh(); // refresh the pwc object&lt;BR /&gt; ObjectId objectId = pwc.checkIn(majorFlag, additionalProperties, contentStream, null);&lt;BR /&gt; log.info("successfully check-in document");&lt;/P&gt;&lt;P&gt;// get &amp;amp; refresh object&lt;BR /&gt; doc = (Document) session.getObject(objectId);&lt;BR /&gt; doc.refresh();&lt;BR /&gt; log.info("Document Version label is now:" + doc.getVersionLabel());&lt;/P&gt;&lt;P&gt;}catch(CmisBaseException cbe) {&lt;BR /&gt; log.error(cbe.getMessage(), cbe);&lt;BR /&gt; if(pwc!=null){&lt;BR /&gt; log.info("try to cancel the checkout on private working copy");&lt;BR /&gt; pwc.cancelCheckOut();&lt;BR /&gt; log.info("cancel checkout successfully completed");&lt;BR /&gt; }&lt;BR /&gt; throw cbe;&lt;/P&gt;&lt;P&gt;}finally {&lt;BR /&gt; if (contentStream != null) {&lt;BR /&gt; IOUtils.closeQuietly(contentStream);&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;I'm sure the stream is properly loaded.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I randomly get this exception on client side:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;org.apache.chemistry.opencmis.commons.exceptions.CmisStorageException: Expected &lt;SPAN style="background-color: #f6f6f6;"&gt;2780 &lt;/SPAN&gt;bytes but retrieved 0 bytes!&lt;BR /&gt; at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(AbstractAtomPubService.java:521) ~[chemistry-opencmis-client-bindings-1.0.0.jar:1.0.0]&lt;BR /&gt; at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.put(AbstractAtomPubService.java:750) ~[chemistry-opencmis-client-bindings-1.0.0.jar:1.0.0]&lt;BR /&gt; at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.put(AbstractAtomPubService.java:737) ~[chemistry-opencmis-client-bindings-1.0.0.jar:1.0.0]&lt;BR /&gt; at org.apache.chemistry.opencmis.client.bindings.spi.atompub.VersioningServiceImpl.checkIn(VersioningServiceImpl.java:215) ~[chemistry-opencmis-client-bindings-1.0.0.jar:1.0.0]&lt;BR /&gt; at org.apache.chemistry.opencmis.client.runtime.DocumentImpl.checkIn(DocumentImpl.java:322) ~[chemistry-opencmis-client-impl-1.0.0.jar:1.0.0]&lt;BR /&gt; at org.apache.chemistry.opencmis.client.runtime.DocumentImpl.checkIn(DocumentImpl.java:624) ~[chemistry-opencmis-client-impl-1.0.0.jar:1.0.0]&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While Server side exception, on Alfresco (debug level) log, is:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;2016-11-11 13:39:16,778 DEBUG [server.shared.Dispatcher] [http-apr-8080-exec-6] -default- / entry, PUT -&amp;gt; org.apache.chemistry.opencmis.server.impl.atompub.ObjectService$UpdateProperties&lt;BR /&gt; 2016-11-11 13:39:16,780 DEBUG [alfresco.util.TempFileProvider] [http-apr-8080-exec-6] Created system temporary directory: /storage/alfresco-5.0.d/tomcat/temp&lt;BR /&gt; 2016-11-11 13:39:16,780 DEBUG [alfresco.util.TempFileProvider] [http-apr-8080-exec-6] Creating tmp file: /storage/alfresco-5.0.d/tomcat/temp/Alfresco/cmis3549815024799568990content&lt;BR /&gt; 2016-11-11 13:39:16,970 DEBUG [alfresco.util.TempFileProvider] [http-apr-8080-exec-6] Created system temporary directory: /storage/alfresco-5.0.d/tomcat/temp&lt;BR /&gt; 2016-11-11 13:39:16,970 DEBUG [alfresco.util.TempFileProvider] [http-apr-8080-exec-6] Creating tmp file: /storage/alfresco-5.0.d/tomcat/temp/Alfresco/cmis3338959984438601081content&lt;BR /&gt; 2016-11-11 13:39:16,971 DEBUG [alfresco.opencmis.AlfrescoCmisServiceInterceptor] [http-apr-8080-exec-6]&lt;BR /&gt;CMIS invocation:&lt;BR /&gt; Method: checkIn&lt;BR /&gt; Arguments:&lt;BR /&gt; -default-&lt;BR /&gt; Holder(67730bc4-fab0-4ad7-bb69-bbeba48baa24;pwc)&lt;BR /&gt; true&lt;BR /&gt; Properties Data [properties=[Property [id=ara:riservato, display Name=null, local name=null, query name=null, values=[false]][extensions=null], Property [id=ara:codiceAOO-protocollo, display Name=null, local name=null, query name=null, values=[aoo_test_2]][extensions=null], Property [id=ara:tipo-protocollo, display Name=null, local name=null, query name=null, values=[Entrata]][extensions=null], Property [id=ara:stato, display Name=null, local name=null, query name=null, values=[1]][extensions=null], Property [id=ara:utente-creatore, display Name=null, local name=null, query name=null, values=[provarest]][extensions=null], Property [id=ara:urgente, display Name=null, local name=null, query name=null, values=[false]][extensions=null], Property [id=ara:numero-protocollo, display Name=null, local name=null, query name=null, values=[1757]][extensions=null], Property [id=ara:data-ricezione, display Name=null, local name=null, query name=null, values=[java.util.GregorianCalendar[time=?,areFieldsSet=false,areAllFieldsSet=false,lenient=true,zone=sun.util.calendar.ZoneInfo[id="GMT+02:00",offset=7200000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=?,YEAR=2016,MONTH=9,WEEK_OF_YEAR=?,WEEK_OF_MONTH=?,DAY_OF_MONTH=18,DAY_OF_YEAR=?,DAY_OF_WEEK=?,DAY_OF_WEEK_IN_MONTH=?,AM_PM=?,HOUR=?,HOUR_OF_DAY=0,MINUTE=0,SECOND=0,MILLISECOND=0,ZONE_OFFSET=?,DST_OFFSET=?]]][extensions=null], Property [id=ara:codiceUfficio-protocollo, display Name=null, local name=null, query name=null, values=[furtrica]][extensions=null], Property [id=ara:barcode, display Name=null, local name=null, query name=null, values=[]][extensions=null], Property [id=cm:description, display Name=null, local name=null, query name=null, values=[sodhiyfy.pdf]][extensions=null], Property [id=ara:utente-modificatore, display Name=null, local name=null, query name=null, values=[provarest]][extensions=null], Property [id=ara:in-risposta-a-numero-protocollo, display Name=null, local name=null, query name=null, values=[]][extensions=null], Property [id=ara:note, display Name=null, local name=null, query name=null, values=[]][extensions=null], Property [id=ara:mittente-esterno, display Name=null, local name=null, query name=null, values=[Giancarlo Prova]][extensions=null], Property [id=ara:info-procedimento, display Name=null, local name=null, query name=null, values=[]][extensions=null], Property [id=cm:title, display Name=null, local name=null, query name=null, values=[sodhiyfy.pdf]][extensions=null], Property [id=ara:numero-protocollo-emergenza, display Name=null, local name=null, query name=null, values=[]][extensions=null], Property [id=ara:codice-registro-protocollo, display Name=null, local name=null, query name=null, values=[aaaa]][extensions=null], Property [id=ara:spedito, display Name=null, local name=null, query name=null, values=[false]][extensions=null], Property [id=ara:anno-protocollo, display Name=null, local name=null, query name=null, values=[2016]][extensions=null], Property [id=ara:codiceEnte-protocollo, display Name=null, local name=null, query name=null, values=[entetest]][extensions=null], Property [id=ara:hash, display Name=null, local name=null, query name=null, values=[]][extensions=null], Property [id=ara:data-protocollo, display Name=null, local name=null, query name=null, values=[java.util.GregorianCalendar[time=?,areFieldsSet=false,areAllFieldsSet=false,lenient=true,zone=sun.util.calendar.ZoneInfo[id="GMT+01:00",offset=3600000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=?,YEAR=2016,MONTH=10,WEEK_OF_YEAR=?,WEEK_OF_MONTH=?,DAY_OF_MONTH=11,DAY_OF_YEAR=?,DAY_OF_WEEK=?,DAY_OF_WEEK_IN_MONTH=?,AM_PM=?,HOUR=?,HOUR_OF_DAY=13,MINUTE=39,SECOND=15,MILLISECOND=542,ZONE_OFFSET=?,DST_OFFSET=?]]][extensions=null]]][extensions=null]&lt;BR /&gt; ContentStream [filename=sodhiyfy.pdf, length=2780, MIME type=application/pdf, has stream=true][extensions=null]&lt;BR /&gt; null&lt;BR /&gt; null&lt;BR /&gt; null&lt;BR /&gt; null&lt;BR /&gt; null&lt;BR /&gt; Pre-call authentication:&lt;BR /&gt; Full auth: admin&lt;BR /&gt; Effective auth: admin&lt;BR /&gt; In-call authentication:&lt;BR /&gt; Full auth: admin&lt;BR /&gt; Effective auth: admin&lt;BR /&gt; Post-call authentication:&lt;BR /&gt; Full auth: admin&lt;BR /&gt; Effective auth: admin&lt;BR /&gt; Throwing: Expected 2780 bytes but retrieved 0 bytes!&lt;BR /&gt; org.apache.chemistry.opencmis.commons.exceptions.CmisStorageException: Expected 2780 bytes but retrieved 0 bytes!&lt;BR /&gt; at org.alfresco.opencmis.AlfrescoCmisServiceImpl.copyToTempFile(AlfrescoCmisServiceImpl.java:2947)&lt;BR /&gt; at org.alfresco.opencmis.AlfrescoCmisServiceImpl.checkIn(AlfrescoCmisServiceImpl.java:2158)&lt;BR /&gt; at sun.reflect.GeneratedMethodAccessor814.invoke(Unknown Source)&lt;BR /&gt; at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)&lt;BR /&gt; at java.lang.reflect.Method.invoke(Method.java:483)&lt;BR /&gt; at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)&lt;BR /&gt; at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)&lt;BR /&gt; at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)&lt;BR /&gt; at org.alfresco.repo.transaction.RetryingTransactionInterceptor$1.execute(RetryingTransactionInterceptor.java:79)&lt;BR /&gt; at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:457)&lt;BR /&gt; at org.alfresco.repo.transaction.RetryingTransactionInterceptor.invoke(RetryingTransactionInterceptor.java:69)&lt;BR /&gt; at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)&lt;BR /&gt; at org.alfresco.opencmis.AlfrescoCmisStreamInterceptor.invoke(AlfrescoCmisStreamInterceptor.java:72)&lt;BR /&gt; at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)&lt;BR /&gt; at org.alfresco.opencmis.AlfrescoCmisServiceInterceptor.invoke(AlfrescoCmisServiceInterceptor.java:101)&lt;BR /&gt; at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)&lt;BR /&gt; at org.alfresco.opencmis.AlfrescoCmisExceptionInterceptor.invoke(AlfrescoCmisExceptionInterceptor.java:83)&lt;/P&gt;&lt;P&gt;at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)&lt;BR /&gt; at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)&lt;BR /&gt; at com.sun.proxy.$Proxy332.checkIn(Unknown Source)&lt;BR /&gt; at org.apache.chemistry.opencmis.server.support.wrapper.ConformanceCmisServiceWrapper.checkIn(ConformanceCmisServiceWrapper.java:1058)&lt;BR /&gt; at org.apache.chemistry.opencmis.server.impl.atompub.ObjectService$UpdateProperties.serve(ObjectService.java:579)&lt;BR /&gt; at org.apache.chemistry.opencmis.server.shared.Dispatcher.dispatch(Dispatcher.java:91)&lt;BR /&gt; at org.apache.chemistry.opencmis.server.impl.atompub.CmisAtomPubServlet.dispatch(CmisAtomPubServlet.java:226)&lt;BR /&gt; at org.apache.chemistry.opencmis.server.impl.atompub.CmisAtomPubServlet.service(CmisAtomPubServlet.java:173)&lt;BR /&gt; at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)&lt;BR /&gt; at org.alfresco.opencmis.CMISServletDispatcher.execute(CMISServletDispatcher.java:188)&lt;BR /&gt; at org.alfresco.opencmis.CMISWebScript.execute(CMISWebScript.java:51)&lt;BR /&gt; at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:437)&lt;BR /&gt; at org.alfresco.rest.api.PublicApiRepositoryContainer.transactionedExecute(PublicApiRepositoryContainer.java:45)&lt;BR /&gt; at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:619)&lt;BR /&gt; at org.alfresco.repo.web.scripts.RepositoryContainer.executeScriptInternal(RepositoryContainer.java:399)&lt;BR /&gt; at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:280)&lt;BR /&gt; at org.alfresco.rest.api.PublicApiRepositoryContainer.access$001(PublicApiRepositoryContainer.java:26)&lt;BR /&gt; at org.alfresco.rest.api.PublicApiRepositoryContainer$1.doWork(PublicApiRepositoryContainer.java:81)&lt;BR /&gt; at org.alfresco.repo.tenant.TenantUtil.runAsWork(TenantUtil.java:119)&lt;BR /&gt; at org.alfresco.repo.tenant.TenantUtil.runAsTenant(TenantUtil.java:88)&lt;BR /&gt; at org.alfresco.rest.api.PublicApiRepositoryContainer.executeScript(PublicApiRepositoryContainer.java:77)&lt;BR /&gt; at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:378)&lt;BR /&gt; at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)&lt;BR /&gt; at org.alfresco.repo.web.scripts.TenantWebScriptServlet.service(TenantWebScriptServlet.java:74)&lt;BR /&gt; at org.alfresco.rest.api.PublicApiWebScriptServlet.service(PublicApiWebScriptServlet.java:53)&lt;BR /&gt; at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)&lt;BR /&gt; at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)&lt;BR /&gt; at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)&lt;BR /&gt; at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)&lt;BR /&gt; at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)&lt;BR /&gt; at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)&lt;BR /&gt; at org.alfresco.repo.web.filter.beans.NullFilter.doFilter(NullFilter.java:68)&lt;BR /&gt; at sun.reflect.GeneratedMethodAccessor562.invoke(Unknown Source)&lt;BR /&gt; at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)&lt;BR /&gt; at java.lang.reflect.Method.invoke(Method.java:483)&lt;BR /&gt; at org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:125)&lt;BR /&gt; at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)&lt;BR /&gt; at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)&lt;BR /&gt; at com.sun.proxy.$Proxy268.doFilter(Unknown Source)&lt;BR /&gt; at org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:82)&lt;BR /&gt; at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)&lt;BR /&gt; at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)&lt;BR /&gt; at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61)&lt;BR /&gt; at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)&lt;BR /&gt; at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)&lt;BR /&gt; at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)&lt;BR /&gt; at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)&lt;BR /&gt; at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)&lt;BR /&gt; at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)&lt;BR /&gt; at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)&lt;BR /&gt; at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)&lt;BR /&gt; at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)&lt;BR /&gt; at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)&lt;BR /&gt; at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)&lt;BR /&gt; at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)&lt;BR /&gt; at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2466)&lt;BR /&gt; at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2455)&lt;BR /&gt; at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)&lt;BR /&gt; at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)&lt;BR /&gt; at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)&lt;BR /&gt; at java.lang.Thread.run(Thread.java:745)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;As you can see, after the dispatcher calling, the "Creating tmp file" is called twice:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;2016-11-11 13:39:16,778 DEBUG [server.shared.Dispatcher] [http-apr-8080-exec-6] -default- / entry, PUT -&amp;gt; org.apache.chemistry.opencmis.server.impl.atompub.ObjectService$UpdateProperties&lt;BR /&gt; 2016-11-11 13:39:16,780 DEBUG [alfresco.util.TempFileProvider] [http-apr-8080-exec-6] &lt;STRONG&gt;Created system temporary directory&lt;/STRONG&gt;: /storage/alfresco-5.0.d/tomcat/temp&lt;BR /&gt; 2016-11-11 13:39:16,780 DEBUG [alfresco.util.TempFileProvider] [http-apr-8080-exec-6] &lt;STRONG&gt;Creating tmp file:&lt;/STRONG&gt; /storage/alfresco-5.0.d/tomcat/temp/Alfresco/cmis3549815024799568990content&lt;BR /&gt; 2016-11-11 13:39:16,970 DEBUG [alfresco.util.TempFileProvider] [http-apr-8080-exec-6] &lt;STRONG&gt;Created system temporary directory&lt;/STRONG&gt;: /storage/alfresco-5.0.d/tomcat/temp&lt;BR /&gt; 2016-11-11 13:39:16,970 DEBUG [alfresco.util.TempFileProvider] [http-apr-8080-exec-6] &lt;STRONG&gt;Creating tmp file&lt;/STRONG&gt;: /storage/alfresco-5.0.d/tomcat/temp/Alfresco/cmis3338959984438601081content&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;the first time the file is created correctly, however the second time its size is &lt;STRONG&gt;0 bytes&lt;/STRONG&gt;!!!&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;I guess because the stream has already been read and consumed..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;This happens randomly.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;When the checkin works, &lt;/SPAN&gt;&lt;SPAN lang="en"&gt;I see only one call for creation of temporary file:&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;2016-11-11 13:35:33,398 DEBUG [server.shared.Dispatcher] [http-apr-8080-exec-2] -default- / entry, PUT -&amp;gt; org.apache.chemistry.opencmis.server.impl.atompub.ObjectService$UpdateProperties&lt;BR /&gt; 2016-11-11 13:35:33,399 DEBUG [alfresco.util.TempFileProvider] [http-apr-8080-exec-2] &lt;STRONG&gt;Created system temporary&lt;/STRONG&gt; directory: /storage/alfresco-5.0.d/tomcat/temp&lt;BR /&gt; 2016-11-11 13:35:33,400 DEBUG [alfresco.util.TempFileProvider] [http-apr-8080-exec-2] &lt;STRONG&gt;Creating tmp file:&lt;/STRONG&gt; /storage/alfresco-5.0.d/tomcat/temp/Alfresco/cmis3970331843228445713content&lt;BR /&gt; 2016-11-11 13:35:33,470 DEBUG [alfresco.opencmis.AlfrescoCmisServiceInterceptor] [http-apr-8080-exec-2]&lt;BR /&gt;CMIS invocation:&lt;BR /&gt; Method: checkIn&lt;BR /&gt; Arguments:&lt;BR /&gt; -default-&lt;BR /&gt; Holder(b8728a2d-020d-4d41-882d-17d4044260f8;pwc)&lt;BR /&gt; true&lt;BR /&gt; Properties Data [properties=[]][extensions=null]&lt;BR /&gt; ContentStream [filename=Segnatura.xml, length=3853, MIME type=application/xml, has stream=true][extensions=null]&lt;BR /&gt; null&lt;BR /&gt; null&lt;BR /&gt; null&lt;BR /&gt; null&lt;BR /&gt; null&lt;BR /&gt; Pre-call authentication:&lt;BR /&gt; Full auth: admin&lt;BR /&gt; Effective auth: admin&lt;BR /&gt; In-call authentication:&lt;BR /&gt; Full auth: admin&lt;BR /&gt; Effective auth: admin&lt;BR /&gt; Post-call authentication:&lt;BR /&gt; Full auth: admin&lt;BR /&gt; Effective auth: admin&lt;BR /&gt; Returning: null&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;Can you help me?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;Is&amp;nbsp;a bug?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;Thank you very much.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Nov 2016 15:39:01 GMT</pubDate>
    <dc:creator>marcolf</dc:creator>
    <dc:date>2016-11-11T15:39:01Z</dc:date>
    <item>
      <title>CmisStorageException on cmis checkin</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cmisstorageexception-on-cmis-checkin/m-p/286482#M239612</link>
      <description>Hi,i have a big problem with cmis checkin.I use Alfresco 5.0.d with Apache OpenCmis 1.0.0 (previous 0.13.0) and AtomPub implementation.My client side&amp;nbsp;code is&lt;IMG id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://migration33.stage.lithium.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt;ocument doc = null; Document pwc = null; ContentStream contentStream = null; try { // refresh object //document.refresh();// document checkou</description>
      <pubDate>Fri, 11 Nov 2016 15:39:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cmisstorageexception-on-cmis-checkin/m-p/286482#M239612</guid>
      <dc:creator>marcolf</dc:creator>
      <dc:date>2016-11-11T15:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: CmisStorageException on cmis checkin</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cmisstorageexception-on-cmis-checkin/m-p/286483#M239613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am wary of using a version of OpenCMIS that is newer than what Alfresco ships with. In your case, 5.0.d ships with OpenCMIS 0.11.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you see this problem when using 0.11?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, can you post the source of your getContentStream method?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Nov 2016 19:15:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cmisstorageexception-on-cmis-checkin/m-p/286483#M239613</guid>
      <dc:creator>jpotts</dc:creator>
      <dc:date>2016-11-21T19:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: CmisStorageException on cmis checkin</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cmisstorageexception-on-cmis-checkin/m-p/286484#M239614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Jeff Potts ha scritto:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am wary of using a version of OpenCMIS that is newer than what Alfresco ships with. In your case, 5.0.d ships with OpenCMIS 0.11.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you see this problem when using 0.11?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, can you post the source of your getContentStream method?&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Jeff,&lt;/P&gt;&lt;P&gt;thank you for reply.&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;First I tried with OpenCMIS 0.13 with the same results. I will try with 0.11 and I'll let you know.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;The source code of getContentStream method is: &lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static ContentStream getContentStream(Session session, String fileName, byte[] content) {&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;// get mime-type&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;String mimeType = MimeTypes.getMIMEType(fileName);&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;// create content stream&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;ByteArrayInputStream stream = new ByteArrayInputStream(content);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;ContentStream contentStream = session.getObjectFactory().createContentStream(fileName, content.length, mimeType, stream);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;return contentStream;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;I checked in debug and all parameters of&amp;nbsp;&lt;EM&gt;session.getObjectFactory().createContentStream(...)&lt;/EM&gt; are correctly filled.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;If I insert a (little 500ms) waiting time between checkout and checkin the problem does not occur. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;If I insert a loop that retry n times the checkin, the second time it works properly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;Thank you very much,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;Marco.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2016 08:44:57 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cmisstorageexception-on-cmis-checkin/m-p/286484#M239614</guid>
      <dc:creator>marcolf</dc:creator>
      <dc:date>2016-11-22T08:44:57Z</dc:date>
    </item>
  </channel>
</rss>

