[Catalyst] Problem with 'login' method in tutorial

Peter Traub ptraub at gmail.com
Thu Jun 22 22:30:38 CEST 2006


Hello,

I'm a Catalyst newbie stuck on the tutorial with following problem. In the
Users.pm file, the login function fails, as the call to $c->login() gets the
following error:

[Thu Jun 22 15:57:00 2006] [catalyst] [error] Caught exception "Can't locate
object method "login" via package "tutorial" at
/home/peter/public_html/tutorial/script/../lib/tutorial/Controller/Users.pm
line 82."

This would normally imply that I'm missing modules, however, I have
installed all the necessary plugins through CPAN (as far as I can tell). One
possible cause, but I don't think it is normally an issue, is that the
Catalyst plugins on my machine (running Ubuntu 'dapper drake'), are in two
directories. One directory (/usr/share/perl5/Catalyst/) has a few plugins
provided by Ubuntu's apt repository. The other directory
(/usr/local/share/perl/5.8.7/Catalyst/) has the new plugins installed with
CPAN. Both directories are in @INC when printed from the tutorial app. I
tried copying the CPAN installed plugins
(Authentication::Credential::Password, Authentication::Simple, etc.) to the
Ubuntu perl dir, but it made no difference. I did restart the test server on
each change.

At this point, I'm not quite sure what else to do to get the app to see
Authentication::Credential::Password which apparently provides the 'login'
method. A search of Google and the list archives hasn't turned up anyone
with the same problem. Any suggestions/help would be greatly appreciated.
Also, at the end of this email I've included a dump of my $c object from
right before the login call fails. Many thanks.

Peter

_______________________

[Thu Jun 22 16:27:18 2006] [catalyst] [debug]
**********************************
[Thu Jun 22 16:27:18 2006] [catalyst] [debug] * Request 1 (0.250/s) [16278]
[Thu Jun 22 16:27:18 2006] [catalyst] [debug]
**********************************
[Thu Jun 22 16:27:18 2006] [catalyst] [debug] "GET" request for
"users/login" from "192.168.1.11"
[Thu Jun 22 16:27:18 2006] [catalyst] [debug] Path is "users/login"
[Thu Jun 22 16:27:18 2006] [catalyst] [debug] $VAR1 = bless( {
                 'request' => bless( {
                                       'protocol' => 'HTTP/1.0',
                                       'headers' => bless( {

'accept-charset' => 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
                                                             'user-agent' =>
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.0.4)
Gecko/20060508 Firefox/1.5.0.4',
                                                             'connection' =>
'keep-alive',
                                                             'keep-alive' =>
'300',
                                                             'accept' =>
'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9
,text/plain;q=0.8,image/png,*/*;q=0.5',

'accept-language' => 'en-us,en;q=0.5',

'accept-encoding' => 'gzip,deflate',
                                                             'host' => '
192.168.1.10:3000'
                                                           },
'HTTP::Headers' ),
                                       '_context' => $VAR1,
                                       'snippets' => [],
                                       'body_parameters' => {},
                                       'secure' => 0,
                                       'hostname' => 'localhost',
                                       'uploads' => {},
                                       'user' => undef,
                                       '_body' => bless( {
                                                           'content_length'
=> 0,
                                                           'body' => undef,
                                                           'length' => 0,
                                                           'content_type' =>
undef,
                                                           'upload' => {},
                                                           'buffer' => '',
                                                           'param' =>
$VAR1->{'request'}{'body_parameters'},
                                                           'state' =>
'buffering'
                                                         },
'HTTP::Body::OctetStream' ),
                                       'method' => 'GET',
                                       'address' => '192.168.1.11',
                                       'base' => bless( do{\(my $o = '
http://192.168.1.10:3000/')}, 'URI::http' ),
                                       'cookies' => {},
                                       'match' => 'users/login',
                                       'path' => 'users/login',
                                       'uri' => bless( do{\(my $o = '
http://192.168.1.10:3000/users/login')}, 'URI::http' ),
                                       'query_parameters' => {},
                                       'parameters' => {},
                                       'action' => 'users/login',
                                       'arguments' => []
                                     }, 'Catalyst::Request' ),
                 'stash' => {
                              'template' => 'userlogin.tt'
                            },
                 'namespace' => 'users',
                 'stack' => [
                              bless( {
                                       'namespace' => 'users',
                                       'name' => '_DISPATCH',
                                       'class' =>
'tutorial::Controller::Users',
                                       'attributes' => {
                                                         'Regex' => undef,
                                                         'LocalRegex' =>
undef,
                                                         'Regexp' => undef,
                                                         'Private' => [

undef
                                                                      ],
                                                         'LocalRegexp' =>
undef
                                                       },
                                       'code' => sub { "DUMMY" },
                                       'reverse' => 'users/_DISPATCH'
                                     }, 'Catalyst::Action' ),
                              bless( {
                                       'namespace' => 'users',
                                       'name' => '_ACTION',
                                       'class' =>
'tutorial::Controller::Users',
                                       'attributes' => {
                                                         'Regex' => undef,
                                                         'LocalRegex' =>
undef,
                                                         'Regexp' => undef,
                                                         'Private' => [

undef
                                                                      ],
                                                         'LocalRegexp' =>
undef
                                                       },
                                       'code' => sub { "DUMMY" },
                                       'reverse' => 'users/_ACTION'
                                     }, 'Catalyst::Action' ),
                              bless( {
                                       'namespace' => 'users',
                                       'name' => 'login',
                                       'class' =>
'tutorial::Controller::Users',
                                       'attributes' => {
                                                         'Regex' => undef,
                                                         'LocalRegex' =>
undef,
                                                         'Regexp' => undef,
                                                         'Local' => [
                                                                      undef
                                                                    ],
                                                         'LocalRegexp' =>
undef
                                                       },
                                       'code' => sub { "DUMMY" },
                                       'reverse' => 'users/login'
                                     }, 'Catalyst::Action' )
                            ],
                 'response' => bless( {
                                        'body' => '',
                                        'cookies' => {},
                                        'headers' => bless( {
                                                              'x-catalyst'
=> '5.61'
                                                            },
'HTTP::Headers' ),
                                        '_context' => $VAR1,
                                        'status' => 200
                                      }, 'Catalyst::Response' ),
                 'stats' => [],
                 'state' => 0,
                 'action' => $VAR1->{'stack'}[2],
                 'counter' => {
                                'users/login' => 1,
                                'users/_AUTO' => 1,
                                'users/_DISPATCH' => 1,
                                'users/_ACTION' => 1,
                                'users/_BEGIN' => 1
                              }
               }, 'tutorial' );

[Thu Jun 22 16:27:18 2006] [catalyst] [debug] Rendering template "
userlogin.tt"
[Thu Jun 22 16:27:19 2006] [catalyst] [error] Caught exception "Can't locate
object method "login" via package "tutorial" at
/home/peter/public_html/tutorial/script/../lib/tutorial/Controller/Users.pm
line 82."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20060622/d57d1c5d/attachment-0001.htm 


More information about the Catalyst mailing list