AnsweredAssumed Answered

cmis atompub connection error

Question asked by sepgs2004 on Nov 2, 2018
Latest reply on Nov 3, 2018 by jpotts

Error:

org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException: Unexpected document! Received: HTML document

 

This exception appears to happen when calling the getRepositories (please see below for code)

In the browser from the same server machine, we are able to access the Alfresco CMIS Atompub url, it gives back the atompub xml. Only from J2EE app, the connection is not working, so to speak.

 

One thing to note is that these servers (J2EE/JBoss server, and Alfresco, etc) are on the "great" cloud environments.

I believe, it has something to do with the security or some cloud/network related process. 

Did anyone have similar issues?

 

Environment fact

Using: Alfresco 5.2 community

Application: EJB has this Alfresco CMIS API code

Host URL for reference

ttp://host//alfresco/api/-default-/public/cmis/versions/1.1/atom

 

Code:

Map<String, String> parametersMap = new HashMap<String, String>();
parametersMap.put(SessionParameter.USER, this.configUser);
parametersMap.put(SessionParameter.PASSWORD, this.configUserPassword);
parametersMap.put(SessionParameter.ATOMPUB_URL, cmisAtomPubUrl);
parametersMap.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());

....

SessionFactory sessionFactory = SessionFactoryImpl.newInstance();
List<Repository> repositories = new ArrayList<Repository>();
repositories = sessionFactory.getRepositories(parametersMap);
if (repositories == null || repositories.size() <= 0) {

 

 

more detailed exception

 

org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException: Unexpected document! Received: HTML documentat org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.parse(AbstractAtomPubService.java:628)at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.getRepositoriesInternal(AbstractAtomPubService.java:809)at org.apache.chemistry.opencmis.client.bindings.spi.atompub.RepositoryServiceImpl.getRepositoryInfos(RepositoryServiceImpl.java:65)at org.apache.chemistry.opencmis.client.bindings.impl.RepositoryServiceImpl.getRepositoryInfos(RepositoryServiceImpl.java:90)at org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.getRepositories(SessionFactoryImpl.java:135)at org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.getRepositories(SessionFactoryImpl.java:112)at com.sa.v4.dms.services.impl.AlfrescoCMISOpenWSProxyAdapter.initialize(AlfrescoCMISOpenWSProxyAdapter.java:154)at com.sa.v4.dms.services.DmsServicesAdapterFactory.getDmsServicesAdapter(DmsServicesAdapterFactory.java:22)at com.sa.v4.dms.DocumentRepositoryBean.ejbCreate(DocumentRepositoryBean.java:50)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptor.java:96)at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)at org.jboss.as.ejb3.component.session.SessionBeanSetSessionContextMethodInvocationInterceptor.processInvocation(SessionBeanSetSessionContextMethodInvocationInterceptor.java:56)at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)at org.jboss.as.ee.component.AroundConstructInterceptorFactory$1.processInvocation(AroundConstructInterceptorFactory.java:28)at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:273)at org.jboss.as.ejb3.tx.CMTTxInterceptor.requiresNew(CMTTxInterceptor.java:347)at org.jboss.as.ejb3.tx.LifecycleCMTTxInterceptor.processInvocation(LifecycleCMTTxInterceptor.java:74)at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:60)at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:53)at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:161)at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:134)at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:88)at org.jboss.as.ejb3.component.stateless.StatelessSessionComponent$1.create(StatelessSessionComponent.java:64)at org.jboss.as.ejb3.component.stateless.StatelessSessionComponent$1.create(StatelessSessionComponent.java:61)at org.jboss.as.ejb3.pool.AbstractPool.create(AbstractPool.java:56)at org.jboss.as.ejb3.pool.strictmax.StrictMaxPool.get(StrictMaxPool.java:124)at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:47)at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:273)at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:330)at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:238)at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)at org.jboss.as.ejb3.remote.EJBRemoteTransactionPropagatingInterceptor.processInvocation(EJBRemoteTransactionPropagatingInterceptor.java:89)at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)at org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:47)at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:100)at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)at org.jboss.as.ejb3.deployment.processors.StartupAwaitInterceptor.processInvocation(StartupAwaitInterceptor.java:22)at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64)at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)at org.jboss.as.ejb3.deployment.processors.EjbSuspendInterceptor.processInvocation(EjbSuspendInterceptor.java:45)at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:67)at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)at org.jboss.as.ejb3.component.interceptors.EjbExceptionTransformingInterceptorFactories$1.processInvocation(EjbExceptionTransformingInterceptorFactories.java:80)at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:54)at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:60)at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:438)at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:619)at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:57)at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:53)at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:198)at org.jboss.as.ejb3.remote.LocalEjbReceiver.processInvocation(LocalEjbReceiver.java:266)at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:454)at org.jboss.ejb.protocol.remote.RemotingEJBClientInterceptor.handleInvocation(RemotingEJBClientInterceptor.java:51)at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:466)at org.jboss.ejb.client.TransactionPostDiscoveryInterceptor.handleInvocation(TransactionPostDiscoveryInterceptor.java:79)at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:466)at org.jboss.ejb.client.DiscoveryEJBClientInterceptor.handleInvocation(DiscoveryEJBClientInterceptor.java:94)at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:466)at org.jboss.ejb.client.NamingEJBClientInterceptor.handleInvocation(NamingEJBClientInterceptor.java:63)at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:466)at org.jboss.ejb.client.TransactionInterceptor.handleInvocation(TransactionInterceptor.java:165)at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:466)at org.wildfly.common.context.Contextual.runExConsumer(Contextual.java:203)at org.jboss.ejb.client.EJBClientInvocationContext.sendRequestInitial(EJBClientInvocationContext.java:302)at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:173)at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:112)

Outcomes