[Catalyst] Error creating CDBI model

Andy Grundman andy at hybridized.org
Wed Nov 23 07:02:13 CET 2005


Maxim Nechaev wrote:
> I create CDBI model class:
> xeim at slack:~/MyApp/script$ myapp_create.pl model User CDBI dbi:mysql:database=test root
>  exists "/home/xeim/MyApp/script/../lib/MyApp/Model"
>  exists "/home/xeim/MyApp/script/../t"
> created "/home/xeim/MyApp/script/../lib/MyApp/Model/User.pm"
> created "/home/xeim/MyApp/script/../lib/MyApp/Model/User"
> 
> All looks ok but when i try run server i get error message:
> xeim at slack:~/MyApp/script$ ./myapp_server.pl
> Use of uninitialized value in hash element at /usr/lib/perl5/site_perl/5.8.7/Class/DBI/Loader/Generic.pm line 119.
> Couldn't instantiate component "MyApp::Model::User", "Can't call method "classes" on an undefined value at /usr/lib/perl5/site_perl/5.8.7/Catalyst/Model/CDBI.pm line 68." at /usr/lib/perl5/site_perl/5.8.7/Module/Pluggable/Fast.pm line 86
> Compilation failed in require at ./myapp_server.pl line 47.

Make sure you have Class::DBI::mysql installed.

I've seriously seen this error from at least 4 different people today. 
I'm going to release C::M::CDBI 0.11 that throws an exception when there 
is an error loading tables. :)

-Andy



More information about the Catalyst mailing list