[Catalyst] Problem with 'login' method in tutorial

Peter Traub ptraub at gmail.com
Fri Jun 23 01:27:53 CEST 2006


On 6/22/06, Matt S Trout <dbix-class at trout.me.uk> wrote:
>
> Peter Traub wrote:
> > Hello,
> >
> > I'm a Catalyst newbie stuck on the tutorial with following problem. In
> > the Users.pm <http://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.
>
> cain$ perl -MCatalyst::Plugin::Authentication::Credential::Password -e
> 'print
> "Yay" if
> Catalyst::Plugin::Authentication::Credential::Password->can("login");'
> Yay


Strange. It doesn't print Yay. However, perl -e 'use
Catalyst::Plugin::Authentication::Credential::Password' also doesn't
complain, so it is there.

After
>
> __PACKAGE__->setup
>
> try dumping @ISA out and see what you've got - if that's on your @ISA,
> check
> tutorial->can("login"), should return true.


This is also strange. Including the following line after __PACKAGE__->setup:

tutorial->log->debug(Dumper(@ISA));

causes the test server not to start with the following error:

Variable "@ISA" is not imported at
/home/peter/public_html/tutorial/script/../lib/tutorial.pm line 42.
Global symbol "@ISA" requires explicit package name at
/home/peter/public_html/tutorial/script/../lib/tutorial.pm line 42.

At this point, tutorial->can("login") also fails of course. Thanks.

Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20060622/afb803c1/attachment.htm 


More information about the Catalyst mailing list