Error 404 with CORS enabled [message #1770461] |
Fri, 11 August 2017 21:24 |
Alan Frye Messages: 41 Registered: January 2017 |
Member |
|
|
I am running xtext web using the code mirror ide and when the editor is served from one domain and the xtext server is running inside Jetty from on a different domain I am getting the following error:
jquery.js:9203 GET http://10.39.83.243:8084/xtext-service/occurrences?resource=47c9d7fc.stext&caretOffset=0 404 (The requested resource was not found.)
I am seeing this error after enabling the Jetty Cors Filter and using the following parameters.
<filter>
<filter-name>cross-origin</filter-name>
<filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class>
<init-param>
<param-name>allowedOrigins</param-name>
<param-value>*</param-value>
</init-param>
<init-param>
<param-name>allowedMethods</param-name>
<param-value>GET,POST,HEAD,PUT,OPTIONS</param-value>
</init-param>
<init-param>
<param-name>allowedHeaders</param-name>
<param-value>X-Requested-With,Content-Type,Accept,Origin,Access-Control-Allow-Origin</param-value>
</init-param>
<init-param>
<param-name>exposedHeaders</param-name>
<param-value>X-Requested-With,Content-Type,Accept,Origin,Access-Control-Allow-Origin</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>cross-origin</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
Before I enabled CORS I was see this message in the browsers console
XMLHttpRequest cannot load http://10.39.83.243:8084/xtext-service/update?resource=61e94e99.stext. Method PUT is not allowed by Access-Control-Allow-Methods in preflight response.
|
|
|
|
|
|
|
|
Re: Error 404 with CORS enabled [message #1770586 is a reply to message #1770580] |
Mon, 14 August 2017 16:18 |
|
here is some logging of what happens by default
0 [qtp109961541-13] TRACE org.eclipse.xtext.web.server.XtextServiceDispatcher - xtext-service/update: fullText=, resource=34b64416.mydsl, serviceType=update
88 [qtp109961541-16] TRACE org.eclipse.xtext.web.server.XtextServiceDispatcher - xtext-service/validate: requiredStateId=-80000000, resource=34b64416.mydsl, serviceType=validate
20523 [qtp109961541-15] TRACE org.eclipse.xtext.web.server.XtextServiceDispatcher - xtext-service/update: deltaOffset=0, deltaReplaceLength=0, deltaText=He, requiredStateId=-80000000, resource=34b64416.mydsl, serviceType=update
20559 [qtp109961541-13] TRACE org.eclipse.xtext.web.server.XtextServiceDispatcher - xtext-service/validate: requiredStateId=-7fffffff, resource=34b64416.mydsl, serviceType=validate
20580 [qtp109961541-16] TRACE org.eclipse.xtext.web.server.XtextServiceDispatcher - xtext-service/occurrences: caretOffset=2, requiredStateId=-7fffffff, resource=34b64416.mydsl, serviceType=occurrences
20852 [qtp109961541-20] TRACE org.eclipse.xtext.web.server.XtextServiceDispatcher - xtext-service/assist: caretOffset=2, requiredStateId=-7fffffff, resource=34b64416.mydsl, serviceType=assist
21807 [qtp109961541-12] TRACE org.eclipse.xtext.web.server.XtextServiceDispatcher - xtext-service/assist: caretOffset=6, deltaOffset=2, deltaReplaceLength=0, deltaText='llo ', requiredStateId=-7fffffff, resource=34b64416.mydsl, serviceType=assist
21861 [qtp109961541-10] TRACE org.eclipse.xtext.web.server.XtextServiceDispatcher - xtext-service/validate: requiredStateId=-7ffffffe, resource=34b64416.mydsl, serviceType=validate
22175 [qtp109961541-10] TRACE org.eclipse.xtext.web.server.XtextServiceDispatcher - xtext-service/occurrences: caretOffset=6, requiredStateId=-7ffffffe, resource=34b64416.mydsl, serviceType=occurrences
22724 [qtp109961541-14] TRACE org.eclipse.xtext.web.server.XtextServiceDispatcher - xtext-service/assist: caretOffset=11, deltaOffset=6, deltaReplaceLength=0, deltaText='name ', requiredStateId=-7ffffffe, resource=34b64416.mydsl, serviceType=assist
22770 [qtp109961541-21] TRACE org.eclipse.xtext.web.server.XtextServiceDispatcher - xtext-service/validate: requiredStateId=-7ffffffd, resource=34b64416.mydsl, serviceType=validate
23081 [qtp109961541-24] TRACE org.eclipse.xtext.web.server.XtextServiceDispatcher - xtext-service/occurrences: caretOffset=11, requiredStateId=-7ffffffd, resource=34b64416.mydsl, serviceType=occurrences
23981 [qtp109961541-15] TRACE org.eclipse.xtext.web.server.XtextServiceDispatcher - xtext-service/update: deltaOffset=11, deltaReplaceLength=0, deltaText=!, requiredStateId=-7ffffffd, resource=34b64416.mydsl, serviceType=update
24002 [qtp109961541-13] TRACE org.eclipse.xtext.web.server.XtextServiceDispatcher - xtext-service/validate: requiredStateId=-7ffffffc, resource=34b64416.mydsl, serviceType=validate
24024 [qtp109961541-16] TRACE org.eclipse.xtext.web.server.XtextServiceDispatcher - xtext-service/occurrences: caretOffset=12, requiredStateId=-7ffffffc, resource=34b64416.mydsl, serviceType=occurrences
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05135 seconds