Thursday, April 2, 2015

Server fails to redirect to the view URL.

Issue : checkRedirectAllowed(String url, String servletContextName, String requestStoreId) CMN1245E: Server fails to redirect to the view URL.

Solution: Mostly it happens because you application is not having proper entries in allowed domains. We need to put proper entry in wc-server.xml
For example  I am accessing my store via http://xyz.com/webapp/wcs/stores/servlet/StoreView?storeId=10151
Here xyz.com is domain and we need to make sure wc-server.xml have entry below entries in store modules.
               <Module contextPath="/webapp/wcs/stores"
                    fileServletEnabled="false" name="Stores"
                    urlMappingPath="/servlet" webAlias="/wcsstore">
                    <InitParameters SSLAcceleratorOption="Enabled"
                        adapters="XML/HTTP, BrowserAdapter"
                        contextSetName="Store" handleDoubleClick="true"
                        inNonSSLPort="80" inSSLPort="80"
                        outNonSSLPort="80" outSSLPort="443"/>
                    <URLRedirectFilter enable="true">
<AllowedDomain name="xyz.com"/> <!-- We can put more domains here-->  
                     </URLRedirectFilter>

                </Module>

Same goes for other modules.