[Catalyst] MojoMojo example - errors with database tables

Uwe Voelker uwe.voelker at gmx.de
Sun Mar 20 11:59:41 CET 2005


Hallo David,

> 1. You don't have CDBI::SQLite and/or CDBI::Loader::SQLite installed.

This was one problem. I didn't have CDBI::Loader installed (but I 
installed Bundle::Catalyst::Everything).

> 2. There are problems with the files in your $HOME/.mojomojo directory.
> 
> In your case I suspect 2., and that you probably didn't know about the
> .mojomojo dir. Notice lines 10 and 11 of lib/MojoMojo.pm:

Correct. I changed the config and SQLite2 complained about unknown 
constraint DEFAULT. Either the db is corrupt or I have a wrong version 
of sqlite installed (I have the newest version from CPAN).

So I ported the oracle schema to mysql and sometimes added the primary 
key (because CDBI::Loader::MySQL wants a primary key for each table).

The line 'Loaded tables ""' changed, but the next errors continue...

[Sun Mar 20 11:45:01 2005] [catalyst] [debug] Loaded tables 
"InternalLink Metadata MetadataVersion Node NodeApproval NodeVersion 
Person PersonNodeApproval Role RoleMember RoleNodeApproval RoleNodeRights"
Couldn't instantiate "MojoMojo::M::Core::User", "Can't locate object 
method "new" via package "MojoMojo::M::Core::User" at 
/usr/lib/perl5/site_perl/5.8.5/Module/Pluggable/Fast.pm line 83.
" at /usr/lib/perl5/site_perl/5.8.5/Catalyst/Engine.pm line 709
Couldn't require "MojoMojo::M::Core::Page", "Can't locate object method 
"columns" via package "MojoMojo::M::Core::Page" at 
/home/uwe/trunk/script/../lib/MojoMojo/M/Core/Page.pm line 8.
Compilation failed in require" at 
/usr/lib/perl5/site_perl/5.8.5/Catalyst/Engine.pm line 709
Couldn't instantiate "MojoMojo::M::Core::Page", "Can't locate object 
method "new" via package "MojoMojo::M::Core::Page" at 
/usr/lib/perl5/site_perl/5.8.5/Module/Pluggable/Fast.pm line 83.
" at /usr/lib/perl5/site_perl/5.8.5/Catalyst/Engine.pm line 709
Couldn't require "MojoMojo::M::Core::Tag", "Can't locate object method 
"columns" via package "MojoMojo::M::Core::Tag" at 
/home/uwe/trunk/script/../lib/MojoMojo/M/Core/Tag.pm line 4.
Compilation failed in require" at 
/usr/lib/perl5/site_perl/5.8.5/Catalyst/Engine.pm line 709
Couldn't instantiate "MojoMojo::M::Core::Tag", "Can't locate object 
method "new" via package "MojoMojo::M::Core::Tag" at 
/usr/lib/perl5/site_perl/5.8.5/Module/Pluggable/Fast.pm line 83.
" at /usr/lib/perl5/site_perl/5.8.5/Catalyst/Engine.pm line 709
Couldn't require "MojoMojo::M::Core::Revision", "Can't locate object 
method "has_a" via package "MojoMojo::M::Core::Revision" at 
/home/uwe/trunk/script/../lib/MojoMojo/M/Core/Revision.pm line 13.
Compilation failed in require" at 
/usr/lib/perl5/site_perl/5.8.5/Catalyst/Engine.pm line 709
[Sun Mar 20 11:45:01 2005] [catalyst] [debug] Initialized components " 
MojoMojo::M::Core::InternalLink MojoMojo::V::TT MojoMojo::C::Journal 
MojoMojo::M::CDBI MojoMojo::M::Core::NodeApproval MojoMojo::C::Export 
MojoMojo::M::Core::RoleNodeApproval MojoMojo::M::Core::Node 
MojoMojo::C::Jsrpc MojoMojo::M::Core::PersonNodeApproval 
MojoMojo::C::Page MojoMojo::C::Tag MojoMojo::M::Core::Person 
MojoMojo::M::Core::Metadata MojoMojo::M::Core::RoleNodeRights 
MojoMojo::C::User MojoMojo::M::Core::Revision 
MojoMojo::M::Core::MetadataVersion MojoMojo::M::Core::Role 
MojoMojo::C::Feeds MojoMojo::M::Core::NodeVersion 
MojoMojo::M::Core::RoleMember"

I think CDBI::Loader makes the problems. When I put 'use base 
"MojoMojo::M::CDBI";' in each MojoMojo::M::Core::* module these errors 
disappear (of course there are warnings for subroutine redefinition).

When I load http://localhost:3000/ I get an error about 
MojoMojo::M::Core::Preferences - this module does not exists.

> Sorry about the confusion, but MojoMojo is a rapidly-moving target right
> now.

I have no problem with that. But do you check changes in that are not 
working? If the missing module is the problem, you would have noticed that.


Thank you,
good bye, Uwe



More information about the Catalyst mailing list