cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andre Juffer <>
Subject Re: jetty
Date Wed, 27 Feb 2008 09:34:49 GMT
Hi Florian,

thanks for the reply. This is the (somewhat adapted) portion of flow 
that works fine with all cocoon 2* version and tomcat:

function something()
   var form = new Form("definition.xml");
   var data = new ...;
   var finished = false;
   while (!finished)
       finished = true;
     catch (exception)
       var w = form.lookupWidget("messages");

The idea is to display (domain) errors (other than caused by improper 
data entered into the form fields) to the user so that he can correct 
the data that he has entered previously into that form. This all works 
very fine when the application is deployed to tomcat. When I test this 
with jetty ('mvn jetty:run'), however, as soon as there is an exception 
in do_something_with, the script enters an seemingly infinite loop. If 
you just wait long enough, you get an

Exception in thread "Thread-4" java.lang.OutOfMemoryError: Java heap space

My assumption was that the catch() is not working as it should. If I 
leave out the while loop completely,  the catch() part is not working at 
all: any exceptions thrown in 'do_something_with(data)' are NOT caught 
and the script simply continues with 'cocoon.sendPage(...)'.

The point is now that all these problems completely disappear as soon as 
I deploy the application to tomcat (6.0.16) and use the flowscript 
portion as above. I run this all with Cocoon 2.2, Java 1.6.0_03 on an 
AMD64 Linux box.


Dev at weitling wrote:
> Hi Andre,
> I assume it doesn't help with the core problem (didn't catch the whole 
> thread), but why don't you make a do-while-loop?
> var finished = false;
> do {
>    ...
>    finished = true;
> }
> while (!finished);
> Or just break?
> while (true) {
>    ...
>    break;
> }
> Setting finished=true to enter at leats once the loop and setting it to 
> false inside looks error-prone.
> Bye,
> Florian
> Andre Juffer wrote:
>>> True, but you can set finished to true as the first statement in the 
>>> while loop.
>> More testing. With finished to true as the first statement in the 
>> while loop, if there is NO exception thrown, the script behaves as one 
>> would expect. It continue after the form with the cocoon.sendPage(...) 
>> statement.
>> However, if there is an exception thrown, the infinite loop reappears. 
>> Jetty (or something else) falters on the catch(ex) {...}.
>> Thanks,
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Andre H. Juffer              | Email:
The Biocenter and            | WWW:
     the Dep. of Biochemistry | Fax: +358-8-553-1141
University of Oulu, Finland  | Phone: +358-8-553 1161
Triacle Biocomputing         | WWW:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message