2016-11-22 39 views
0

我連接到露天使用下面的化學CMIS代碼服務不可用異常,同時連接到露天與化學CMIS

final SessionFactory sessionFactory = SessionFactoryImpl.newInstance(); 
// prepare connection parameters 
final Map<String, String> connectionParameters = new HashMap<String, String>(); 
// User credentials. 
connectionParameters.put(SessionParameter.USER,"******"); 
connectionParameters.put(SessionParameter.PASSWORD,"*****"); 
// Connection settings. 
connectionParameters.put(SessionParameter.ATOMPUB_URL,"https://******/alfresco/api/-default-/public/cmis/versions/1.1/atom"); 
connectionParameters.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value()); 
connectionParameters.put(SessionParameter.OBJECT_FACTORY_CLASS, "org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl"); 
session = sessionFactory.getRepositories(connectionParameters).get(0).createSession(); 

我使用

<dependency> 
    <groupId>org.apache.chemistry.opencmis</groupId> 
    <artifactId>chemistry-opencmis-client-impl</artifactId> 
    <version>1.0.0</version> 
</dependency> 

連接到它,但提示以下錯誤:

Exception in thread "main" org.apache.chemistry.opencmis.commons.exceptions.CmisServiceUnavailableException: Service Unavailable 
    at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(AbstractAtomPubService.java:518) 
    at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.read(AbstractAtomPubService.java:701) 
    at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.getRepositoriesInternal(AbstractAtomPubService.java:873) 
    at org.apache.chemistry.opencmis.client.bindings.spi.atompub.RepositoryServiceImpl.getRepositoryInfos(RepositoryServiceImpl.java:66) 
    at org.apache.chemistry.opencmis.client.bindings.impl.RepositoryServiceImpl.getRepositoryInfos(RepositoryServiceImpl.java:92) 
    at org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.getRepositories(SessionFactoryImpl.java:120) 
    at org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.getRepositories(SessionFactoryImpl.java:107) 
    at com.ge.dms.batch.TestAPP.main(TestAPP.java:71) 

請幫忙。

+0

什麼是你的露天和cmis庫版本? –

+0

如果您在瀏覽器中訪問atompub網址,是否提示您登錄,或者您是否從服務器收到錯誤消息? – Gagravarr

+0

alfresco 5.0.2 enterprise and cmis 1.1 – user2361591

回答

0

該問題是由於在AWS中安裝了不穩定的露天咖啡館。當Alfresco正確重新安裝時,上面的代碼工作正常。

相關問題