[Catalyst] Newbie needs help with tutorial

JT Justman jt at signless.com
Wed Nov 1 20:36:17 GMT 2006


Richard Wolfe wrote:
> Hello all-
> 
> I've been writing (bad) Perl/CGI scripts for years, but am just now
> trying to get my head around Catalyst (and MVC in general). I managed to
> get Catalyst installed on my little Linux box here, and I'm busily
> working my way through Catalyst::Manual::Tutorial.
> 
> In working my way through Part 2 (Catalyst Basics) of the tutorial, I
> create my new Catalyst project and start up the server and can browse to
> it no problem. But after I step through all the other tasks on this
> portion of the tutorial (create a database, MyAppDB.pm, the "result
> source" files, the controller, etc.) the server throws an error when I
> try to start it:
> 
> [rwolfe at coyote MyApp]$ script/myapp_server.pl 
> Couldn't instantiate component "MyApp::Model::MyAppDB", "Cannot load
> schema class 'MyAppDB': Recursive inheritance detected while looking for
> method 'can' in package 'DBIx::Class::Componentised' at
> /usr/lib/perl5/site_perl/5.8.8/DBIx/Class/Componentised.pm line 76.
> Compilation failed in require at
> /usr/lib/perl5/site_perl/5.8.8/Catalyst/Model/DBIC/Schema.pm line 272.
>  at script/myapp_server.pl line 53" at script/myapp_server.pl line 53
> Compilation failed in require at script/myapp_server.pl line 53.
> 

Well, it sort of looks to my untrained eye like some component of your
schema is loading either the main Schema class or something else.

In your MyAppDB.pm file, what do you have in load_classes? If it's
blank, IIRC it will automatically load all the modules in the MyAppDB
directory. Perhaps you have something in there you didn't mean to have,
such as a copy of MyAppDB.pm? Look carefully at each of those classes,
and try disabling them one at a time.

It may help to check out a copy of the finished app from svn to have
something to compare to.

JT



More information about the Catalyst mailing list