My application keeps giving me the following error when I try to load my user model class. I have enabled user logins with an authenticate method and it works just fine. The problem comes when I try to logout. I added a logout method to my User model class, an once I did I started getting the following error. Every FAQ says wrap it in BEGIN{} which I did but it doesn't help at all.

 failed to resolve handler `Raymond': Invalid CODE attribute: Exported at /usr/local/src/Raymond/lib//Raymond/User.pm line 3\nBEGIN failed--compilation aborted at /usr/local/src/Raymond/lib//Raymond/User.pm line 7.\nCompilation failed in require at /usr/local/src/Raymond/lib//Raymond.pm line 7.\nBEGIN failed--compilation aborted at /usr/local/src/Raymond/lib//Raymond.pm line 7.\nCompilation failed in require at (eval 5) line 3.\n

If I comment out my call to my user model Raymond::User which holds the exported logout function below... Then my application will authenticate the user and run normally, but I wont be able to log out. It will just give me an error "file error - user/logout: not found at /usr/local/lib/perl5/site_perl/5.8.8/Maypole.pm line 123"

I can think of no other way to get this working any help will be greatly appreciated.

package Raymond::User;

sub logout :Exported {

my ($class, $r) = @_;

Maypole::Plugin::Authentication::UserSessionCookie::logout($r);

$r->template('login');

}

1;

I do not have Raymond::User in package Raymond I made sure that I seperated them

package Raymond;

use strict;

use warnings;

use Maypole::Application qw(Authentication::UserSessionCookie);

use Maypole::Constants;

use Raymond::User;

BEGIN{Raymond->setup('dbi:mysql:rmg', 'username', 'password');}

Raymond->config->{uri_base} = "http://myurl/raymond/";

Raymond->config->{template_root} = "/usr/local/src/rmg/templates/";

Raymond->config->{application_name} = "Raymond";

Raymond->init;

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Maypole-users mailing list
Maypole-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/maypole-users

Reply via email to