Skip to content

Embedded demo with RequireJS, No 'Access-Control-Allow-Origin' Error #1

@joser93

Description

@joser93

Expected behavior:

The file "countries.js" loaded and the dashboard embedded in html page.

Steps to reproduce the mentioned issue:

  1. Prepare Pentaho BI Server 6.1

  2. Add "<allow-cross-domain-resources>true</allow-cross-domain-resources>" at settings.xml in “/pentaho-solutions/system/pentaho-cdf” and “/pentaho-solutions/system/pentaho-cdf-dd”

  3. Change requestParameterAuthenticationEnabled to true in "/pentaho-solutions/system/security.properties"

  4. Add the NMC-samples folder in "/Public/" folder with the content of this github

  5. Open "custom_fillColor" with “generatedContent” method, this should work if all previous steps were done correctly.

  6. Add this html file on apache server: https://gist.github.com/joser93/a61bc87d2c001df4476b33ff6ca96e75

  7. Replace $HOST with the hostname or IP address of BI Server.

  8. Open HTML file in browser, countries.js will not load.

Actual behavior of this issue:

The file "countries.js" can’t load and the dashboard should display similar or the same as it’s opened in Pentaho “generatedContent” method, but embedded in the html page and without the geojson shapes. Plus, this message should be printed in the browser console:

XMLHttpRequest cannot load http://$HOST:8080/pentaho/plugin/pentaho-cdf-dd/api/resources/public/NMC-samples/resources/geojson/south-america.geojson.js. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://$HOST' is therefore not allowed access. The response had HTTP status code 401.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions