AnsweredAssumed Answered

Cross-Origin Request Blocked: (Reason: CORS header ‘Access-Control-Allow-Origin’ missing) issue while trying to hit an alfresco webscript from Alfresco Activiti application.

Question asked by paiyyavj13 on Mar 16, 2017

Hi,

I am trying to hit a Cross-domain webscript hit to Alfresco community server running on 8090 port from an Alfresco Activiti application running on 8080 port.

 

The error I see in Firebug is:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at <<service _url>> (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).

 

I have enabled the below in the Tomcat Application server: web.xml:

<filter>
<filter-name>CORS</filter-name>
<filter-class>com.thetransactioncompany.cors.CORSFilter</filter-class>
<init-param>
<param-name>cors.allowGenericHttpRequests</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>cors.allowOrigin</param-name>
<!-- <param-value>http://localhost:8081</param-value> -->
<param-value>*</param-value>
</init-param>
<init-param>
<param-name>cors.allowSubdomains</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>cors.supportedMethods</param-name>
<param-value>GET, HEAD, POST, PUT, DELETE, OPTIONS</param-value>
</init-param>
<init-param>
<param-name>cors.supportedHeaders</param-name>
<param-value>origin, authorization, x-file-size, x-file-name, content-type, accept, x-file-type, Access-Control-Request-Method, Access-Control-Request-Headers, Access-Control-Allow-Origin</param-value>
</init-param>
<init-param>
<param-name>cors.supportsCredentials</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>cors.maxAge</param-name>
<param-value>3600</param-value>
</init-param>
</filter>

<!-- CORS Filter End -->

<!-- Enterprise filter placeholder -->

<filter-mapping>
<filter-name>Global Localization Filter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>

<!-- CORS Filter Mappings Begin -->
<filter-mapping>
<filter-name>CORS</filter-name>
<url-pattern>/api/*</url-pattern>
<url-pattern>/service/*</url-pattern>
<url-pattern>/s/*</url-pattern>
<url-pattern>/cmisbrowser/*</url-pattern>
</filter-mapping>
<!-- CORS Filter Mappings End -->

 

But still it gives the same error, Is there any additional configuration that is needed? Am I missing something?

 

Appreciate some help... Thank you...

 

Regards.

Outcomes