Problem enabling CORS on APS

cancel
Showing results for 
Search instead for 
Did you mean: 
Member II

Problem enabling CORS on APS

I am working on my first ADF application.  I have created the template application OK using the yo tooling, I can log onto the Alfresco Content Services however I have trouble when I set the Process Services switch to on.  When I do this I get the following error message..."Request has been terminated Possible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.".  I can log into the Activiti web app OK and the web app is running at 'http://127.0.0.1:9080/activiti-app' and the ADF settings are showing 'http://127.0.0.1:9080'.  I am assuming that there is a CORS issue with APS.

I am running Activiti 6.0.0 in Tomcat 7.0.79.  I have read the CORS instructions for APS, these say modify <activity>/tomcat/lib/activiti-app.properties but in my install I dont have a properties file in this location; the properties file is in <activity>/tomcat/webapps/activiti-app/WEB-INF/classes/META-INF/activiti-app/activiti-app.properties.

I have added the following lines to the above file and changed the admin password to the same as the admin password in Alfresco (lines added are cors.enabled=true, security.csrf.disabled=true).  I have then restarted the Activit tomcat instance, I can now login at the Activiti app with admin/admin so I belived the changes in the file have been read, but when I login to the ADF app I still get the same error described above.  I have also created an activiti-app.properties file in <activiti>/tomcat/lib and placed the CORS lines in this file but it does not change anything.

I really love the idea of ADF and belive we can create much better applications around Alfresco/Activiti in this way, before ADF creating custom applications took a long time.

2 Replies
Senior Member II

Re: Problem enabling CORS on APS

As far as I know ADF works only with Alfresco Process Services (enterprise version of activiti). If you are using Process Services, there is a document around ADF CORS strategies which you can find at https://community.alfresco.com/community/application-development-framework/blog/2017/06/20/adf-cors-... 

Hope this helps!

Member II

Re: Problem enabling CORS on APS

I changes the proxy settings in the webpack.common.js files to map ECM as http://localhost:3000/ecm to http://localhost:8080 and map BPM as http://localhost:3000/bpm to http://localhost:9080. I changed the ECM & BCM information using the settings menu to http://localhost:3000/ecm & http://localhost:3000/bpm and I still had the error.

Using the browser network debug I noticed that the calls from the browser were still going direct to the original ports (i.e. direct to 8080 & 9080), I updated the settings in the prod & dev config files, restarted and could now log on.  I guess changing the settings in the config menu has no affect and they are more for information than real time editing. 

I have now created a business application in Activiti and am trying to access this from the ADF application.  When I click the ADF link I am seeing a 'there are no business applications' type of message in the ADF window so now I will try and work this one through.  There is an error message in the Activiti log but I have not been able to work out the detail yet.

Many thanks for the support and I hope that someone else finds this useful.  I will update with information from Activiti error when I have the details