Friday, December 6, 2013

Alfresco Share webscript Connection timeout


Recently We faced HTTP connection timeout issue in Alfresco share webscript while calling repository webscrtipt.
This timeout occurs for several reasons like high load on server or custom logical operation on huge amount of data so alfresco explorer takes too much time to respond etc.
So sometimes you might need to change this timeout parameters used by Share remote client. Here I will describe how we can change them.

Initially, this parameters was hard coded, now you can set them through configuration in newer version of alfresco.
Connection timeout default value is 10s.

Need to follow below steps

Step 1:
Locate spring-webscript-application-context.xml. This settings are defined in this file.

This file is in spring-webscripts-1.2.0-SNAPSHOT.jar [tomcat\webapps\alfresco\WEB-INF\lib] and go to org/springframework/extensions/webscripts/.

Step 2:
Search for "connector.remoteclient.abstract" and copy entire bean definition.


Step 3:
Go to tomcat\shared\classes\alfresco\web-extension and create custom-slingshot-application-context.xml if you don't have else modify this file.

Copy remoteclient bean defination into this and update "connectTimeout" value as per your requirement.

Step 4:
Restart server and verify.

You can increase logs to debug if any issue.
log4j.logger.org.springframework.extensions.webscripts.connector.RemoteClient=debug

NOTE: This might affect your system performance. So till possible rectify your code which is causing this issue.

Alfresco version: 4.2

Hope this helps!

1 comment: