我通过DotCMIS+HTTPS从Alfresco 4.2.0获得ChangeLog更改,如下所示:
string lastTokenOnClient = "1857698"; // actually updated using last token
boolean includeProperties = false;
int maxNumItems = 100;
session.GetContentChanges(lastTokenOnClient, includeProperties, maxNumItems);
虽然它通常工作,但有时它开始给出以下错误(客户端):
CmisSync.Lib.Cmis.BaseException: Unauthorized ---> DotCMIS.Exceptions.CmisRuntimeException: Unauthorized
at DotCMIS.Binding.AtomPub.AbstractAtomPubService.Read(UrlBuilder url) in C:Userswin7pro32bitDocumentsGitHubCmisSyncExtrasOpenDataSpaceDotCMISDotCMISbindingatompubatompub.cs:line 439
at DotCMIS.Binding.AtomPub.DiscoveryService.GetContentChanges(String repositoryId, String& changeLogToken, Nullable`1 includeProperties, String filter, Nullable`1 includePolicyIds, Nullable`1 includeAcl, Nullable`1 maxItems, IExtensionsData extension) in C:Userswin7pro32bitDocumentsGitHubCmisSyncExtrasOpenDataSpaceDotCMISDotCMISbindingatompubatompub.cs:line 2708
at DotCMIS.Client.Impl.Session.GetContentChanges(String changeLogToken, Boolean includeProperties, Int64 maxNumItems, IOperationContext context) in C:Userswin7pro32bitDocumentsGitHubCmisSyncExtrasOpenDataSpaceDotCMISDotCMISclientclient-impl.cs:line 766
at DotCMIS.Client.Impl.Session.GetContentChanges(String changeLogToken, Boolean includeProperties, Int64 maxNumItems) in C:Userswin7pro32bitDocumentsGitHubCmisSyncExtrasOpenDataSpaceDotCMISDotCMISclientclient-impl.cs:line 758
这个错误出现在Alfresco一侧:
ERROR [extensions.webscripts.AbstractRuntime] [http-apr-8080-exec-12]
Exception from executeScript - redirecting to status template error: 01276459
Web Script org/alfresco/cmis/changes.get requires admin authentication;
however, a non-admin has attempted access.
org.springframework.extensions.webscripts.WebScriptException: 01276459 Web Script org/alfresco/cmis/changes.get requires admin authentication; however, a non-admin has attempted access.
at org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryContainer.java:337)
at org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryContainer.java:312)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:447)
at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:354)
at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:376)
at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)
at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:132)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
在几分钟内,我看不出对GetContentChanges
的调用是如何成功的,但随后在同一会话中开始返回Unauthorized
。
我做错什么了吗?
问题是使用了旧的CMIS URL http://[host]:[port]/alfresco/cmisatom
。
解决方案:
将配置中的该URL替换为新的CMIS URL http://[host]:[port]/alfresco/api/-default-/public/cmis/versions/1.0/atom
解决了问题。