I've setup a document repostory in our account.
When I deploy my application and go the part of the app that connects to the repository, I get this exception:
org.apache.chemistry.opencmis.commons.exceptions.CmisPermissionDeniedException: Config entry with unique name com.vertexinc.etms.document.Repo1 is not allowed to be accessed
I don't know if the repository is setup correctly or I need to do something different in the code. I'm following the few code examples that are given.
The examples and documentation for the cockpit do not talk about needing a destination for this service. But the API documentation does mention Destinations in the EcmService and EcmFactory. So I assume this is for on-premise repositories only.
Also, code examples show creating the repository programmatically if the connection fails with a CmisObjectNotFoundException. Currently, I am not getting that exception so I don't think that the current problem.
There are no examples of needing other CMIS options when creating the Session but I would assume that would only be needed for on-premise as well. The Repository defined in HCP should abstract these things.
I'm currently stalled in our HCP proof of concept effort. I hope someone can help please.
ContentManagementServiceCMIS
public Session getSession()
{
if(LOGGER.isInfoEnabled())
LOGGER.info("getSession()...");
if(null == session)
{
if(LOGGER.isInfoEnabled())
LOGGER.info("getSession() connecting...");
session = getEcmService().connect("com.vertexinc.etms.document.Repo1", "vertexinc1");
}
return session;
}
public EcmService getEcmService()
{
if(LOGGER.isInfoEnabled())
LOGGER.info("getEcmService()...");
if(null == ecmService)
{
if(LOGGER.isInfoEnabled())
LOGGER.info("getEcmService() ecmService is null.");
try
{
if(LOGGER.isInfoEnabled())
LOGGER.info("getEcmService() looking up java:comp/env/EcmService...");
InitialContext ctx = new InitialContext();
setEcmService((EcmService)ctx.lookup("java:comp/env/EcmService"));
}
catch(Exception e)
{
if(LOGGER.isInfoEnabled())
LOGGER.info("getEcmService() Error looking up java:comp/env/EcmService...", e);
}
}
return ecmService;
}
public void setEcmService(EcmService ecmService)
{
if(LOGGER.isInfoEnabled())
LOGGER.info("setEcmService(" + ecmService + ")...");
this.ecmService = ecmService;
}
Stack Trace:
2015 09 11 17:12:31#+00#INFO#com.vertexinc.etms.document.ContentManagementServiceCMIS##anonymous#http-bio-8041-exec-5#na#be3122574#vertexenterprisews#web#be3122574#getSession()...|
2015 09 11 17:12:31#+00#INFO#com.vertexinc.etms.document.ContentManagementServiceCMIS##anonymous#http-bio-8041-exec-5#na#be3122574#vertexenterprisews#web#be3122574#getSession() connecting...|
2015 09 11 17:12:31#+00#INFO#com.vertexinc.etms.document.ContentManagementServiceCMIS##anonymous#http-bio-8041-exec-5#na#be3122574#vertexenterprisews#web#be3122574#getEcmService()...|
2015 09 11 17:12:31#+00#INFO#com.vertexinc.etms.document.ContentManagementServiceCMIS##anonymous#http-bio-8041-exec-5#na#be3122574#vertexenterprisews#web#be3122574#getEcmService() ecmService is null.|
2015 09 11 17:12:31#+00#INFO#com.vertexinc.etms.document.ContentManagementServiceCMIS##anonymous#http-bio-8041-exec-5#na#be3122574#vertexenterprisews#web#be3122574#getEcmService() looking up java:comp/env/EcmService...|
2015 09 11 17:12:31#+00#INFO#com.vertexinc.etms.document.ContentManagementServiceCMIS##anonymous#http-bio-8041-exec-5#na#be3122574#vertexenterprisews#web#be3122574#setEcmService(com.sap.ecm.impl.EcmServiceImpl@2c20c861)...|
2015 09 11 17:12:31#+00#INFO#com.sap.ecm.api.internal.impl.LandscapeHelper#BC-NEO-ECM#anonymous#http-bio-8041-exec-5#com.sap.ecm.api.impl.cloud#be3122574#vertexenterprisews#web#be3122574#Computed ecm default destination name to ecmserver|
2015 09 11 17:12:31#+00#INFO#com.sap.core.connectivity.cloud.destinations.configuration.CloudFallbackDestinationConfigurationReader##anonymous#http-bio-8041-exec-5#na#be3122574#vertexenterprisews#web#be3122574#Properties for destination ecmserver not found in repository - fallback to local file system.|
2015 09 11 17:12:31#+00#INFO#com.sap.core.connectivity.cloud.destinations.configuration.CloudFallbackDestinationConfigurationReader##anonymous#http-bio-8041-exec-5#na#be3122574#vertexenterprisews#web#be3122574#Properties for destination ecmserver not found in repository - fallback to local file system.|
2015 09 11 17:12:31#+00#INFO#com.sap.core.connectivity.cloud.destinations.configuration.CloudFallbackDestinationConfigurationReader##anonymous#http-bio-8041-exec-5#na#be3122574#vertexenterprisews#web#be3122574#Properties for destination ecmserver not found in repository - fallback to local file system.|
2015 09 11 17:12:31#+00#INFO#com.sap.core.connectivity.cloud.destinations.configuration.CloudFallbackDestinationConfigurationReader##anonymous#http-bio-8041-exec-5#na#be3122574#vertexenterprisews#web#be3122574#Properties for destination ecmserver not found in repository - fallback to local file system.|
2015 09 11 17:12:31#+00#INFO#com.sap.core.connectivity.cloud.destinations.configuration.CloudFallbackDestinationConfigurationReader##anonymous#http-bio-8041-exec-5#na#be3122574#vertexenterprisews#web#be3122574#Properties for destination ecmserver not found in repository - fallback to local file system.|
2015 09 11 17:12:31#+00#INFO#com.sap.core.connectivity.cloud.destinations.configuration.CloudFallbackDestinationConfigurationReader##anonymous#http-bio-8041-exec-5#na#be3122574#vertexenterprisews#web#be3122574#Properties for destination ecmserver not found in repository - fallback to local file system.|
2015 09 11 17:12:31#+00#INFO#com.sap.ecm.api.internal.SessionLookup#BC-NEO-ECM#anonymous#http-bio-8041-exec-5#com.sap.ecm.api.cmis.spi#be3122574#vertexenterprisews#web#be3122574#Found ecm destination and parsed ecm server to be https://ecm.us1.hana.ondemand.com/s/json|
2015 09 11 17:12:31#+00#INFO#com.sap.ecm.api.internal.SessionLookup#BC-NEO-ECM#anonymous#http-bio-8041-exec-5#com.sap.ecm.api.cmis.spi#be3122574#vertexenterprisews#web#be3122574#Tenant found: Id: 164cd85c-cd26-43fb-9de3-65c7f3a92111, Name: Default, Alias: be3122574|
2015 09 11 17:12:31#+00#INFO#com.sap.ecm.api.internal.SessionLookup#BC-NEO-ECM#anonymous#http-bio-8041-exec-5#com.sap.ecm.api.cmis.spi#be3122574#vertexenterprisews#web#be3122574#Computed ECM URL is: https://ecm-be3122574.us1.hana.ondemand.com:8443/s/json|
2015 09 11 17:12:31#+00#INFO#com.sap.ecm.api.internal.SessionLookup#BC-NEO-ECM#anonymous#http-bio-8041-exec-5#com.sap.ecm.api.cmis.spi#be3122574#vertexenterprisews#web#be3122574#Computed user and calculated ECM Server URL from destination 'ecmserver' to https://ecm-be3122574.us1.hana.ondemand.com:8443/s/json.|
2015 09 11 17:12:31#+00#INFO#com.sap.ecm.api.internal.cert.ClientCertificate#BC-NEO-ECM#anonymous#http-bio-8041-exec-5#com.sap.ecm.api.impl.cloud#be3122574#vertexenterprisews#web#be3122574#Created socket factory|
2015 09 11 17:12:32#+00#ERROR#com.vertexinc.etms.exception.EtmsSoapExceptionResolver##anonymous#http-bio-8041-exec-5#na#be3122574#vertexenterprisews#web#be3122574#Config entry with unique name com.vertexinc.etms.document.Repo1 is not allowed to be accessed|
2015 09 11 17:12:32#+00#ERROR#com.vertexinc.etms.exception.EtmsSoapExceptionResolver##anonymous#http-bio-8041-exec-5#na#be3122574#vertexenterprisews#web#be3122574#Stack Trace
org.apache.chemistry.opencmis.commons.exceptions.CmisPermissionDeniedException: Config entry with unique name com.vertexinc.etms.document.Repo1 is not allowed to be accessed
at org.apache.chemistry.opencmis.client.bindings.spi.browser.AbstractBrowserBindingService.convertStatusCode(AbstractBrowserBindingService.java:280)
at org.apache.chemistry.opencmis.client.bindings.spi.browser.AbstractBrowserBindingService.read(AbstractBrowserBindingService.java:388)
at org.apache.chemistry.opencmis.client.bindings.spi.browser.AbstractBrowserBindingService.getRepositoriesInternal(AbstractBrowserBindingService.java:456)
at org.apache.chemistry.opencmis.client.bindings.spi.browser.RepositoryServiceImpl.getRepositoryInfo(RepositoryServiceImpl.java:58)
at org.apache.chemistry.opencmis.client.bindings.impl.RepositoryServiceImpl.getRepositoryInfo(RepositoryServiceImpl.java:74)
at org.apache.chemistry.opencmis.client.runtime.SessionImpl.connect(SessionImpl.java:1051)
at org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.createSession(SessionFactoryImpl.java:106)
at org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.createSession(SessionFactoryImpl.java:68)
at com.sap.ecm.api.EcmFactory.connectInternal(EcmFactory.java:890)
at com.sap.ecm.api.EcmFactory.connect(EcmFactory.java:185)
at com.sap.ecm.impl.EcmServiceImpl.connect(EcmServiceImpl.java:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.eclipse.gemini.naming.ReflectionUtils.invokeMethodOnObject(ReflectionUtils.java:77)
at org.eclipse.gemini.naming.ServiceInvocationHandler.invokeMethodOnService(ServiceInvocationHandler.java:85)
at org.eclipse.gemini.naming.ServiceInvocationHandler.handleMethodInvocation(ServiceInvocationHandler.java:70)
at org.eclipse.gemini.naming.ServiceInvocationHandler.access$0(ServiceInvocationHandler.java:68)
at org.eclipse.gemini.naming.ServiceInvocationHandler$ServiceInvokeAction.invokeMethod(ServiceInvocationHandler.java:175)
at org.eclipse.gemini.naming.ReflectiveInvokeAction.run(ReflectiveInvokeAction.java:43)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.gemini.naming.SecurityUtils.invokePrivilegedAction(SecurityUtils.java:45)
at org.eclipse.gemini.naming.ServiceInvocationHandler.invoke(ServiceInvocationHandler.java:64)
at com.sun.proxy.$Proxy15.connect(Unknown Source)
at com.vertexinc.etms.document.ContentManagementServiceCMIS.getSession(ContentManagementServiceCMIS.java:103)
at com.vertexinc.etms.document.ContentManagementServiceCMIS.getRoot(ContentManagementServiceCMIS.java:240)
This failure is coming from the chemistry side, this is the code fragment mentioned in the stack-trace:
378 /**
379 * Performs a GET on an URL, checks the response code and returns the
380 * result.
381 */
382 protectedResponse read(UrlBuilder url) {
383 // make the call
384 Response resp = getHttpInvoker().invokeGET(url, session);
385
386 // check response code
387 if (resp.getResponseCode() != 200) {
388 throw convertStatusCode(resp.getResponseCode(), resp.getResponseMessage(), resp.getErrorContent(), null);
389 }
390
391 return resp;