Wicket.Ajax.Call.failure: Error while parsing response: Object required
Asked Answered
O

2

3

I just spent several hours of my life debugging this problem. I'm documenting it here for others.

Question:

I'm getting the following error when I try to click on an AjaxLink in Internet Explorer:

Wicket: ERROR: Wicket.Ajax.Call.failure: Error while parsing response: Object required

It works fine in all other browsers; just IE is busted.

Orelia answered 1/6, 2011 at 20:35 Comment(1)
I faced some other kind of that: Wicket.Ajax.Call.failure: Error while parsing response: Method Not AllowedGloat
O
6

Check to make sure that your HTML is 100% syntactically correct. Ajax responses are returned to the browser inside a CDATA section, and if the payload is not well-formed, IE will sometimes choke.

In my case I neglected to close a <link> tag in the <head> section. Simply closing that link tag made all the difference.

Aside: if you ever come across a tough-to-solve problem in Wicket, it's a good idea to create a quickstart project that reproduces your issue. It can be a lot of work to boil things down, but in doing so you often find the source of the problem.

Orelia answered 1/6, 2011 at 20:37 Comment(0)
G
0

I want to note one more potential reason for the issue with Wicket's AJAX in IE. It might help someone, who encounters similar problem.

In my case I had the following error message in IE:

Wicket: ERROR: Wicket.Ajax.Call.failure: Error while parsing response: could not find root <ajax-response> element

The reason was an incorrect Content-Type of AJAX response. I used AbstractTransformerBehavior and there was a bug in Wicket 1.4.x so this behavior was rewriting response Content-Type with text/html. IE does not parse such response as XML.

Gimel answered 24/4, 2013 at 8:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.