0

我通过 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:\Users\win7pro32bit\Documents\GitHub\CmisSync\Extras\OpenDataSpaceDotCMIS\DotCMIS\binding\atompub\atompub.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:\Users\win7pro32bit\Documents\GitHub\CmisSync\Extras\OpenDataSpaceDotCMIS\DotCMIS\binding\atompub\atompub.cs:line 2708
at DotCMIS.Client.Impl.Session.GetContentChanges(String changeLogToken, Boolean includeProperties, Int64 maxNumItems, IOperationContext context) in C:\Users\win7pro32bit\Documents\GitHub\CmisSync\Extras\OpenDataSpaceDotCMIS\DotCMIS\client\client-impl.cs:line 766
at DotCMIS.Client.Impl.Session.GetContentChanges(String changeLogToken, Boolean includeProperties, Int64 maxNumItems) in C:\Users\win7pro32bit\Documents\GitHub\CmisSync\Extras\OpenDataSpaceDotCMIS\DotCMIS\client\client-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在同一个会话中开始返回。

难道我做错了什么?

4

1 回答 1

2

问题是使用了旧的 CMIS URL http://[host]:[port]/alfresco/cmisatom

解决方案:

用新的 CMIS URL 替换配置中的那个 URLhttp://[host]:[port]/alfresco/api/-default-/public/cmis/versions/1.0/atom解决了这个问题。

于 2015-03-02T04:27:58.890 回答