[Catalyst] Error creating CDBI model

Chisel Wright chisel at herlpacker.co.uk
Wed Nov 23 10:44:25 CET 2005


On Wed, Nov 23, 2005 at 01:02:13AM -0500, Andy Grundman wrote:
> 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 seen errors similar to this in the last few days myself, I'm using
Pg.

Known causes:
  - can't connect to database. not sure why it can't just say that
  - using a table called 'session', barfs saying it can't find the PK,
	however renaming the table to 'mysession' and it just goes away.
	[I believe I have a script that demonstrates this]

I honestly can't remember what I've updated recently (well, most of
Catalyst and associated plugins to be fair)

> I've seriously seen this error from at least 4 different people today. 

Makes me wonder what's changed in the modules we're all using ..

> I'm going to release C::M::CDBI 0.11 that throws an exception when there 
> is an error loading tables. :)

That would be bloody useful!

-- 
Chisel Wright
e: chisel at herlpacker.co.uk
w: http://www.herlpacker.co.uk/

No virus was found in this outgoing message as I didn't bother looking.



More information about the Catalyst mailing list