cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andre Juffer <ajuf...@sun3.oulu.fi>
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");
   form.createBinding("binding.xml");
   var data = new ...;
   var finished = false;
   while (!finished)
   {
     try
     {
       form.load(data);
       form.showForm(...);
       form.save(data);
       do_something_with(data);
       finished = true;
     }
     catch (exception)
     {
       var w = form.lookupWidget("messages");
       w.addMessage(exception.message);
     }
   }
   cocoon.sendPage(...);
}

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.

Thanks,
Andre


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: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 


-- 
Andre H. Juffer              | Email: Andre.Juffer@oulu.fi
The Biocenter and            | WWW: www.biochem.oulu.fi/Biocomputing/
     the Dep. of Biochemistry | Fax: +358-8-553-1141
University of Oulu, Finland  | Phone: +358-8-553 1161
Triacle Biocomputing         | WWW: www.triacle-bc.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message