Invoking an Alfresco page on WCMQS works fine and I get the page rendered properly. Then after long inactivity, which I didn't measure but seems to be at least an hour, I get this exception while accessing the page again (I am just showing part of the exception):
org.apache.chemistry.opencmis.commons.exceptions.CmisUnauthorizedException: Unauthorized
org.apache.chemistry.opencmis.commons.exceptions.CmisUnauthorizedException: Unauthorized
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(AbstractAtomPubService.java:466)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.post(AbstractAtomPubService.java:635)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.DiscoveryServiceImpl.query(DiscoveryServiceImpl.java:179)
at org.apache.chemistry.opencmis.client.runtime.SessionImpl$5.fetchPage(SessionImpl.java:872)
at org.apache.chemistry.opencmis.client.runtime.util.AbstractIterator.getCurrentPage(AbstractIterator.java:132)
at org.apache.chemistry.opencmis.client.runtime.util.CollectionIterator.hasNext(CollectionIterator.java:48)
at it.wzm.alfresco.client.WebSiteServiceImpl.refreshWebsiteCache(WebSiteServiceImpl.java:172)
at it.wzm.alfresco.client.WebSiteServiceImpl.getWebSiteCache(WebSiteServiceImpl.java:155)
at it.wzm.alfresco.client.WebSiteServiceImpl.getWebSite(WebSiteServiceImpl.java:122)
I have tried to track down the problem, but I was unable to come out with a solution.I don't know if it is relevant, but I have only seen for example that GuestSessionFactoryImpl, which is supposed (by reading the javadoc) to create a pool of connection, gets called at startup, and its init method is launching a thread (isn't it forbidden by the specs ?) which is supposed to poll the CMIS server, such thread die as soon as it gets a connection, so the polling stops.
@Override
public void run()
{
Thread thisThread = Thread.currentThread();
while (waitForRepository == thisThread)
{
// See if the repository can be reached
try
{
getRepository();
log.info("Repository available");
break; // <– this stops the thread ?!
}
catch (Exception e)
{
lastException = e;
log.warn("WQS unable to connect to repository: " + e.getMessage());
if (log.isDebugEnabled())
{
log.debug("Caught exception while attempting to connect to repository over CMIS", e);
}
}
// Wait a bit
try
{
Thread.sleep(repositoryPollInterval);
}
catch (InterruptedException e)
{
}
}
waitForRepository = null;
}