cancel
Showing results for 
Search instead for 
Did you mean: 

Error communicating with Activit

mahesh_bheema
Champ in-the-making
Champ in-the-making
Hi All,

We are currently in the process of exploring and evaluating Alfresco one and Alfresco Activiti and currently stuck at integration of alfresco one with alfresco activiti using share connector .
Below is the error we see in the alfresco.log , hope you could guide us through this .

"Caused by: java.io.IOException: Error communicating with Activiti when : A
POST to http://192.168.100.77:8090/activiti-app/app/rest/integration/login - Error communicating with Activiti when switching secret key for a token using
http://192.168.100.77:8090/activiti-app/app/rest/integration/login server responded with status code 401
   at com.activiti.alfresco.sso.ActivitiPassThroughWebScript.getActivitiTokens(ActivitiPassThroughWebScript.java:295)
   at com.activiti.alfresco.sso.ActivitiPassThroughWebScript.execute(ActivitiPassThroughWebScript.java:125)
   at org.alfresco.repo.web.scripts.RepositoryContainer$3.execute(RepositoryContainer.java:505)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:457)
   … 32 more
Caused by: java.io.IOException: Error communicating with Activiti when switching secret key for a token using
http://192.168.100.77:8090/activiti-app/app/rest/integration/login server responded with status code 401
   at com.activiti.alfresco.sso.ActivitiPassThroughWebScript.getActivitiTokens(ActivitiPassThroughWebScript.java:291)
   … 35 more
"
8 REPLIES 8

steven_okennedy
Star Contributor
Star Contributor
Hi

It looks like the shared secret that allows Alfresco and Activti to communicate is not in sync in both systems.

Basically you have two places that this secret is configured:
<li>In Actviti - when you add a new repository under the Alfresco Repositories section of the Tenants page.  It's the field "Secret"</li>
<li>In Alfresco - by default a value should be already set ("activiti-share-connector-secret" I think), but you can override this by adding a line to your alfresco-global.properties file:</li>


activiti.secret=my-custom-secret


Make sure the value is the same in both places and you should be fine.  See here for more details: http://docs.alfresco.com/activiti/docs/admin-guide/1.3.2/#_activiti_share_connector

If you still hit errors, please provide more information about your setup and the configuration you've done

Regards

Steven

Hi Steven,

Appreciate the reply.
We configured the same password in tenants and in the properties file but still getting the same error . Attaching the alfresco.log here . Hope you could find some clue .
Thanks again.

hoecake
Champ in-the-making
Champ in-the-making
Hi Steven,
Thanks for your reply,
I have same error, but even i set activiti.secret=somekey that equal to Activiti/Alfresco Repositories - Repository secret (be set as same as somekey). but it doesn't work, Alfresco always throw 401 exception.
Could you pls give me further advice ?
Thanks again,
gary

Hi Gary,

Can you have a look at your Tenants page in your Activiti admin console and verify the id of the Alfresco repository you're trying to connect to?  Activiti allows you have multiple Alfresco repositories configured against the same Activiti instance, and so it is potentially dealing with more than one set of configuration/credential properties.  To do this, it expects Alfresco to send across it's id so that Activiti knows which set of repo config to compare it against.

In Alfresco, the properties you need to set are suffixed by the appropriate id, e.g. activiti.alfrescoRepositoryName=alfresco-1 or activiti.alfrescoRepositoryName=alfresco-2 etc where the 1 & 2 correspond to the id of the repository as seen in the Activiti admin page.

If your repository id is not 1, then you also need to make sure the activiti.alfrescoRepositoryName property is set to the right value in your alfresco-global.properties file.

If you still encounter errors after this, or you already have things set up this way, the best thing to try and do would be to try and capture the details of the traffic being sent between Alfresco and Activiti. The logs show that Alfresco is sending a POST to http://192.168.100.77:8090/activiti-app/app/rest/integration/login which is failing, it might shed some light if you can see what parameters are being sent with the request. If the Alfresco and Activiti apps are on different hosts you can easily capture the traffic using a tool like tcpdump or Wireshark.  If they are on the same host its a bit more complex, but you could use something like Charles Proxy or maybe Fiddler to do it.

Regards

Steven

Thanks Steven,

I couldnt find respository ID in activiti admin page as you mentioned in the answer , could you please let me know where i could see the repository ID in the activit admin page , meanwhile i am trying to analyze what is being sent using fiddler , thanks for the insight and your time .

Hi Mahesh,

When you go login to activiti-app as an admin, go to the Identity Management app, click Tenants, and then the Alfresco Repositories tab.  It shows a table/list of Alfresco repositories that have been configured and the Id column here is the one you're interested in.  See the attached screenshot, the id of my one here being "1"

Regards

Steven

Hi Steven,

Thanks for the help , I have tried all possible ways still the error persists . Is it recommended to have alfresco one and alfresco activiti installed on different hosts ?

steven_okennedy
Star Contributor
Star Contributor
I've set it up locally previously on a single dev box, so no it's not essential and it is possible to get it to work on a single host - the tricky part I found was in getting them talking to the same LDAP and ensuring the LDAP parameters etc all work correctly - this is essential for the proper authentication/authorisation of users between the two systems.