plexiti / camunda-grails-plugin

Integrates Camunda BPM with the Grails framework.
http://grails.org/plugin/camunda
Apache License 2.0
18 stars 8 forks source link

Cross origin request error upon embedded form access #47

Closed tolyo closed 9 years ago

tolyo commented 9 years ago

Following the tutorial, I am getting the following error when trying to access the embedded form:

XMLHttpRequest cannot load app:camunda/test/sampleForm. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource. camunda-bpm-sdk-angular.js:457 Uncaught TypeError: Cannot read property 'body' of undefined angular.js:9778 Error: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'app:camunda/test/sampleForm'. at Error (native) at f.28.f.end (http://localhost:8080/camunda/app/tasklist/scripts/deps.js:10:567) at 5.s.load (http://localhost:8080/camunda/app/tasklist/scripts/deps.js:9:1191) at r.t.factory.n.forEach.r.(anonymous function) [as load] (http://localhost:8080/camunda/app/tasklist/scripts/camunda-tasklist-ui.js:1:16976) at 19.CamundaForm.initialize (http://localhost:8080/camunda/app/tasklist/scripts/deps.js:9:13779) at CamundaForm (http://localhost:8080/camunda/app/tasklist/scripts/deps.js:9:12869) at new 17.r.extend.n (http://localhost:8080/camunda/app/tasklist/scripts/deps.js:9:10921) at l (http://localhost:8080/camunda/app/tasklist/scripts/camunda-tasklist-ui.js:5:12580) at Object.fn (http://localhost:8080/camunda/app/tasklist/scripts/camunda-tasklist-ui.js:5:12700) at l.$get.l.$digest (http://localhost:8080/camunda/app/tasklist/scripts/deps.js:5:30649)

tolyo commented 9 years ago

The problem appears to be related to the null context path returned by the form request: {"key":"embedded:app:camunda/test/sampleForm","contextPath":null}. It appears the grails context path is not being recognized by the Camunda tomcat container.

martinschimak commented 9 years ago

Hi @tolyo - thx for reporting this. As this is not an issue with environments tested so far, can you provide your own environment specifics, please, like os, java version, camunda distribitution. I will then try to reproduce this issue. Many thx.

tolyo commented 9 years ago

Morning Martin,

Thank you for getting back to me on this. I am on Ubuntu 14.04, Java 1.8.0_31, Grails 2.4.4, camunda BPM platform version: 7.2.0, Apache Tomcat Server version: 7.0.50

I have only modified the distribution with necessary log4j dependencies as the vanilla version will throw a log4j:ERROR Error initializing log4j: null java.lang.ExceptionInInitializerError

Appreciate your help.

tolyo commented 9 years ago

Ok. I got this resolved by setting explicit deployment.scenario = "shared" Might have messed up my environments.

martinschimak commented 9 years ago

Great. Many thx for sharing and your interest in the plugin!

tolyo commented 9 years ago

@martinschimak After further tracking down the error I do believe it appears when deploying the application with a "/" context, which is not related to the plugin, but is a general camunda issue of not seeing the ROOT context path. Any advice on how to render embedded forms under ROOT context would be greatly appreciated.