[Catalyst] Problem with 'login' method in tutorial

Ash Berlin ash at cpan.org
Thu Jun 22 22:36:10 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.
>
> Peter
In MyApp.pm

use Catalyst qw/-Debug Authentication/;

That tells Catalyst to enable debug, and load 
Catalyst::Plugin::Authentication - you will also need to load the 
backend authentication stores in a similar manner.

HTH
Ash




More information about the Catalyst mailing list