<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:Courier New,courier,monaco,monospace,sans-serif;font-size:12pt"><div>Hi,<br><br>I am new to the Catalyst framework and am running Catalyst on Kubuntu Linux using the built-in server with the TT view and DBIC database backend.<br><br>My problem is that sometimes the "end" sub in Root.pm hangs. All it has is the RenderView action (as generated by Catalyst), so I assume that is the culprit.<br><br>If I return the same template as was previously displayed on the page, then it hangs. There appears to be other occasions as well, but I haven't found any pattern yet.<br><br>Here is an example output from the terminal:<br><br>[info] *** Request 11 (0.000/s) [5758] [Sun Jun 28 08:11:16 2009] ***<br>[debug] Body Parameters are:<br>.-------------------------------------+--------------------------------------.<br>|
Parameter | Value |<br>+-------------------------------------+--------------------------------------+<br>| Create | Create user |<br>|
password | x |<br>| username | kalle |<br>| verify_password |
y |<br>'-------------------------------------+--------------------------------------'<br>[debug] "POST" request for "users/create" from "127.0.0.1"<br>[debug] Path is "users/create"<br>[debug] Found sessionid "29eee4bdb13bf24aa256c7dfebd87a5816ee5bc9" in cookie<br>[debug] Restored session "29eee4bdb13bf24aa256c7dfebd87a5816ee5bc9"<br>[debug] Rendering template "users/create_form.tt2"<br>[info] Request took 795.658106s (0.001/s)<br>.------------------------------------------------------------+-----------.<br>|
Action | Time |<br>+------------------------------------------------------------+-----------+<br>| /users/create | 0.005603s |<br>|
/end | 795.6377s |<br>| -> Cupper::View::TT->process | 795.6356s |<br>'------------------------------------------------------------+-----------'<br><br>As you can see, "end" has hanged in 795 seconds, and this output was not printed until AFTER I hit "Stop" in Firefox. Below is the code in users/create:<br><br>sub create : Local : ActionClass('Restricted') {<br> my ( $self, $c ) = @_;<br><br> # Retrieve the values from the form<br> my
$username = $c->request->params->{username};<br> my $password = $c->request->params->{password};<br> my $verify_password = $c->request->params->{verify_password};<br><br> if ( ! $username || 4 < length $username ) {<br> $c->stash->{error_msg} = $c->localize('User name must be at least 5 characters long.');<br> $c->stash->{template} = 'users/create_form.tt2';<br> return; <br> }<br><br> if ( $password ne $verify_password ) {<br> $c->stash->{error_msg} = $c->localize('Passwords does not match.');<br> $c->stash->{template} = 'users/create_form.tt2';<br> return; <br> }<br><br> # Create the user<br> my $user =
$c->model('DB::Users')->create(<br> {<br> user_id => 1,<br> username =>
$username,<br> password => $password,<br> }<br> );<br><br> # Store new model object in stash<br> $c->stash->{template} = 'users/list.tt2';<br>}<br><br><br>This particular
request should take the "$password ne $verify_password" path and return the user to the "users/create_form" function.<br><br>Here is the content of the "Restricted" action:<br><br>sub execute {<br> my $self = shift;<br> my ( $controller, $c, $test ) = @_;<br><br> unless ( $c->user_exists() ) {<br> warn "BEFORE redirect";<br> $c->forward('/users/login_form');<br> warn "AFTER redirect";<br> return;<br> }<br> $self->NEXT::execute(@_);<br>}<br><br><br>I am unable to run a debugger on the catalyst server (I get a segmantation fault), so it is difficult to find exactly where <br>problem is.<br><br>Any help is appreciated.<br><br>KR,<br>Gunnar<br></div></div><br>
</body></html>