On Sun, May 23, 2010 at 6:38 AM, Dan <[email protected]> wrote:

> __PACKAGE__->config(
>    schema_class => 'EasySaver',
>
>    connect_info => {
>        dsn => 'dbi:mysql:dbname=EasySaver;host=archeopteryx',
>        user => 'username',
>        password => 'password',
>        AutoCommit => q{1},
>    }
> );
>
> [snip...]

> Couldn't load class (EasySaver) because: Couldn't instantiate component
> "EasySaver::Model::ESDB", "Attribute (schema_class) does not pass the
> type constraint because: Validation failed for
> 'Catalyst::Model::DBIC::Schema::Types::SchemaClass' failed with value
> EasySaver
> at
> /usr/lib/perl5/site_perl/5.10.1/i686-linux-thread-multi/Moose/Meta/Attribute.pm
> line 746
>

You may want to try a different "schema_class". When you generated the
model, it should also have created a "Schema.pm" file. Put that package name
(not file name, the package name) in "schema_class". At least, this is what
worked in my setup.

I say that because of the error message. The first paragraph of output
contains the actual error message. The rest of that is a stack trace that
you don't need for this issue.

Catalyst uses something called
"Moose<http://search.cpan.org/dist/Moose/lib/Moose/Manual.pod>".
Moose adds shortcuts for quickly building object oriented packages. It's
very cool stuff. Moose offers limited type checking. Moose reported a
mis-match in the type it expected versus the type it received.

"schema_class" eventually becomes an object attribute. Moose thinks that
"schema_class" should be set to an instance of type
"Catalyst::Model::DBIC::Schema::Types::SchemaClass". The "EasySchema" from
the configuration file is not from the Catalyst::Model::DBIC hierarchy.

-- 
Robert Wohlfarth
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to