Skip to Content
Author's profile photo Former Member

UI5 TDG Demo – CORS Error – Alternative Solution


You are working on TDG Demo provided in UI5 developer guide. Your application fails to load data from sample OData service due to web security / CORS Cross-origin resource sharing (CORS).

As per sap help documentation , you should over come this issue by using simple proxy servlet with additional context param as mentioned at this link. But, sometime this may not work due to some unknown reasons.

Below is the alternative solution to overcome this issue.


XMLHttpRequest cannot load http://domain2.example. Origin http://domain1.example is not allowed by Access-Control-Allow-Origin.

HTTP Status 500 – Server redirected too many times (20)

Solution: Use CORSPROXY


1. Install CORSPROXY by giving below command at command or $ prompt

npm install -g corsproxy

2. Start CORSPROXY by giving below command at command prompt

$ corsproxy

3. This starts corsproxy in it’s default port 9292. You can launch it by http://localhost:9292

4. Now, you can use your ODATA service url by appending it to corsproxy url



     will be called by below url




      You can test it by launching directly.

5. Now use this new url in component.js. Run UI5 TDG Demo app and you should see list of products from odata service.


Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Thank you so much! 🙂