Welcome to Knowage Q&A, where you can ask questions and receive answers from other members of the community.
0 votes
1 view
Hi, I'm trying to integrate knowage with my java application through the use of the file "sbisdk-all-production.js" and the invocation of the "executeDataSet" method through the jquery libraries from jsp.
The error that I get is: the origin matching criterion does not allow reading of the remote resource from: "http: // localhost / .. etc .. CORS" Access-Control-Allow-Origin "header missing.
I think that it is the authentication problem, so I tried to include the credentials in the js file, but it seems not enough.
What I still still have to do?
Please help me, it's important. Thank you!
Environment Knowage 6.1.1, Windows 7, Tomcat 7, Chrome & Firefox
in API and SDK by (120 points)

1 Answer

0 votes
The jsp is on the same server and domain of "http://localhost"? The CORS is a security policy implemented by the browser as you can see here: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
by (11.6k points)
Thanks for the reply. I read about the CORS.

No, the JSP is on a different domain than where is the requested resource.

My application and knowage run on your own Tomcat, so it have two different server port.  

In practice, by clicking a button from my web application, the user can view on another html page, the document take from knowage.

How can I solve my problem? If I read the error that I get.. I should to add the CORS header? Which header and where?

Thanks.

Hi, thanks for the reply, I read the tutorial on the cors that you suggested me.

It was helpful but I did not solve the problem completely.

I modified the request header and made the appropriate changes also in the "web.xml" file of Tomcat on which run knowage, to allow access to the origin that makes the request.

Being a CORS request, it sends two requests. Before a POST request (status 200 ok), once the permissions have been granted (in the response payload there is a Json that contains the credentials), the browser makes the effective GET request.

Unfortunately for the second request I still get: status 500 and header CORS "Access-Control-Allow-Origin" missing.
Please help me again. Thank you!

...