Can't locate object method "session" via package "myapp"
I went back and reviewed the code several times and could not figure out what was wrong. After hours of struggle, changing configurations, switching to different plugin modules, I finally got the reason. In my code, I used following statement to import several Catalyst plugins:use Catalyst qw/Static::Simple Session Session::State::Cookie Session::Store::File/;
use Catalyst qw/Authentication Authentication::Store::Minimal Authentication::Credential::Password/;
It seems that the later import (authentication related) overrode the previous import(session related). Thus the session method is missing because the module Session is not imported.
To fix this, just change the code to:
use Catalyst qw/-Debug Static::Simple Session
Session::State::Cookie Session::Store::File
Authentication Authentication::Store::Minimal
Authentication::Credential::Password
/;
No comments:
Post a Comment