Hi,
I have an instance of the Alfresco Content Services 6.2.2 (Enterprise).
I'm trying to configure CORS like in previous ACS versions.
As follows in 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,http://myapp.example.com</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, range</param-value> </init-param> <init-param> <param-name>cors.exposedHeaders</param-name> <param-value>Accept-Ranges, Content-Encoding, Content-Length, Content-Range</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> <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> <url-pattern>/definitions/*</url-pattern> </filter-mapping>
In documentation (6.1) https://docs.alfresco.com/6.1/tasks/enable-cors.html but in https://docs.alfresco.com/6.2/concepts/welcome.html I can't find section about CORS configuration.
When I put it into my web.xml I got an exception while start ACS:
SEVERE: Exception starting filter [CORS] java.lang.ClassNotFoundException: com.thetransactioncompany.cors.CORSFilter at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1358) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1180) at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:545) at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:526) at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:150) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260) at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:106) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4538) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5181) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
Is possible to configure CORS in ACS 6.2.2?
How to achieve this?
Solved! Go to Solution.
Did you try this one?
https://docs.alfresco.com/6.2/concepts/enabling-cors.html
Did you try this one?
https://docs.alfresco.com/6.2/concepts/enabling-cors.html
Thank you! I will try this one.
I didn't notice that the enabling-cors section had moved
Hi @jmal
Great that you have a solution & thanks for updating us.
Cheers,
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.