[Catalyst] Problem with 'login' method in tutorial

Matt S Trout dbix-class at trout.me.uk
Fri Jun 23 00:37:34 CEST 2006


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

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.

-- 
      Matt S Trout       Offering custom development, consultancy and support
   Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Catalyst mailing list