I found what was causing it:
I was reading data from a stream using the following code:
char[] chars = new char[200];
while(bufferedReader.read(chars) != -1) {
// add chars to response
}
When I changed the code to:
int read = -1;
while ((read = reader.read()) != -1) {
buffer.append((char) read);
}
it works.
The problems lies in the fact that in my first solution I did not
account for the actual number of chars read and just appended the
complete char array to the response. That caused some strange
characters being added to the response object that the javascript
DomParser can not handle.
Do you still want me to create a jira issue for this? I don;t think it
is a bug right?
Lars
On Mon, Sep 22, 2008 at 2:16 PM, Matej Knopp <[EMAIL PROTECTED]> wrote:
> looks like there is an ecoding problem. which is quite weird. Please open
> jira issue for this. A quickstart project would be welcome.
>
> -Matej
>
> On Mon, Sep 22, 2008 at 1:16 PM, lars vonk <[EMAIL PROTECTED]> wrote:
>
>> I did some more debugging and found this more detailed error message:
>>
>> XML Parsing Error: unclosed CDATA section
>> Location: http://localhost:8090/appl
>> Line Number 8, Column 230:</head>]]></header-contribution><component
>> id="feedback1" ><![CDATA[<div id="feedback1">START RELEASING maven-web
>> ...<br/>checkout revision 126<br/><br/>e:\tmp\checkout\maven-web>set
>> MAVEN_OPTS=-Xmx512m -XX:MaxPermSize=512m <br/>
>>
>> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^
>>
>> It fails on the - sign of -XX:MaxPermSize=512m (the 230th char).
>>
>> Any thoughts?
>>
>> On Mon, Sep 22, 2008 at 11:41 AM, lars vonk <[EMAIL PROTECTED]> wrote:
>> > Hi,
>> >
>> > I receive the following error message when I try to update a component
>> > using ajax:
>> >
>> > ERROR: Error while parsing response: Could not find root
>> > <ajax-response> element.
>> >
>> > This is the xml that was send back from the server.
>> >
>> > <?xml version="1.0"
>> > encoding="UTF-8"?><ajax-response><header-contribution
>> > encoding="wicket1" ><![CDATA[<head
>> > xmlns:wicket="http://wicket.apache.org"><script type="text/javascript"
>> >
>> src="resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js"></script>
>> > <script type="text/javascript"
>> >
>> src="resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js"></script>
>> > <script type="text/javascript"
>> >
>> src="resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax-debug.js"></script>
>> > <script type="text/javascript"
>> > id="wicket-ajax-debug-enable"><!--/*--><![CDATA[/*><!--*/
>> > wicketAjaxDebugEnable=true;
>> > /*-->]^]^>*/</script>
>> >
>> > </head>]]></header-contribution><component id="feedback1"
>> > encoding="wicket1" ><![CDATA[<div id="feedback1">[INFO]^ Total time:
>> > 12 secondsTotal time: 8 seconds [INFO]^ Finished at: Mon Sep 22
>> > 11:17:35 CEST 2008 [INFO]^ Final Memory: 5M/9M[INFO]^
>> >
>> ------------------------------------------------------------------------FO]^
>> >
>> ------------------------------------------------------------------------[INFO]^
>> > Total time: 12 secondsTotal time: 8 seconds [INFO]^ Finished
>> > at: Mon Sep 22 11:17:35 CEST 2008
>> > </div>]]></component></ajax-response>
>> >
>> > Are there any characters that are not allowed in an ajax-response? If
>> > I just return a hardcoded text it works fine....
>> >
>> > Lars
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]