(Before I begin, I should clarify I did not write this code, I'm just trying to maintain it)
The following error is the first thing spat out by make test for the Padre sync server, located at http://svn.perlide.org/padre/trunk/Madre-Sync.
Wasn't the move of Catalyst to Moose going to make things easier?
Can someone explain how you debug this?
I get the basics, I can see the "Can't locate Madre/Sync/Schema.pm". But that file should be, I think, automatically generated. And I don't really get how to dig down the 75 caller levels from the start to the end to work out where the actual functionality is failing...
not ok 1 - use Catalyst::Test;
# Failed test 'use Catalyst::Test;' # at t\01app.t line 7. # Tried to use 'Catalyst::Test'. # Error: Couldn't load class (Madre::Sync) because: Couldn't instantiate component "Madre::Sync::Model::padreDB", "Can't locate Madre/Sync/Schema.pm i n @INC (@INC contains: blib\lib blib\arch C:/strawberry/perl/lib C:/strawberry/perl/site/lib C:\strawberry\perl\vendor\lib .). at C:\strawberry\perl\vendor \lib/Class/MOP.pm line 132 # Class::MOP::load_first_existing_class('Madre::Sync::Schema') called at C:\strawberry\perl\vendor\lib/Class/MOP.pm line 137 # Class::MOP::load_class('Madre::Sync::Schema') called at C:\strawberry\perl\vendor\lib/Catalyst/Model/DBIC/Schema/Types.pm line 21 # Catalyst::Model::DBIC::Schema::Types::__ANON__[C:\strawberry\perl\vendor\lib/Catalyst/Model/DBIC/Schema/Types.pm:21]('Madre::Sync::Schema') called at C:\strawberry\perl\vendor\lib/Moose/Meta/TypeCoercion.pm line 63 # Moose::Meta::TypeCoercion::__ANON__[C:\strawberry\perl\vendor\lib/Moose/Meta/TypeCoercion.pm:67]('Madre::Sync::Schema') called at C:\strawberry\per l\vendor\lib/Moose/Meta/TypeCoercion.pm line 97 # Moose::Meta::TypeCoercion::coerce('Moose::Meta::TypeCoercion=HASH(0x4a2b444)', 'Madre::Sync::Schema') called at C:\strawberry\perl\vendor\lib/Moose /Meta/TypeConstraint.pm line 90 # Moose::Meta::TypeConstraint::coerce('Moose::Meta::TypeConstraint=HASH(0x4a29854)', 'Madre::Sync::Schema') called at C:\strawberry\perl\vendor\lib/M ooseX/Types/TypeDecorator.pm line 206 # eval {...} called at C:\strawberry\perl\vendor\lib/MooseX/Types/TypeDecorator.pm line 205 # MooseX::Types::TypeDecorator::AUTOLOAD('MooseX::Types::TypeDecorator=HASH(0x4a31424)', 'Madre::Sync::Schema') called at C:\strawberry\perl\vendor\l ib/Moose/Meta/Attribute.pm line 743 # Moose::Meta::Attribute::_coerce_and_verify('Moose::Meta::Attribute=HASH(0x4b467fc)', 'Madre::Sync::Schema', 'Madre::Sync::Model::padreDB=HASH(0x4db 7c64)') called at C:\strawberry\perl\vendor\lib/Moose/Meta/Attribute.pm line 398 # Moose::Meta::Attribute::initialize_instance_slot('Moose::Meta::Attribute=HASH(0x4b467fc)', 'Moose::Meta::Instance=HASH(0x4db7ed4)', 'Madre::Sync::M odel::padreDB=HASH(0x4db7c64)', 'HASH(0x4db53ac)') called at C:\strawberry\perl\vendor\lib/Class/MOP/Class.pm line 567 # Class::MOP::Class::_construct_instance('Moose::Meta::Class=HASH(0x4942ffc)', 'HASH(0x4db53ac)') called at C:\strawberry\perl\vendor\lib/Class/MOP/C lass.pm line 540 # Class::MOP::Class::new_object('Moose::Meta::Class=HASH(0x4942ffc)', 'HASH(0x4db53ac)') called at C:\strawberry\perl\vendor\lib/Moose/Meta/Class.pm line 256 # Moose::Meta::Class::new_object('Moose::Meta::Class=HASH(0x4942ffc)', 'HASH(0x4db53ac)') called at C:\strawberry\perl\vendor\lib/Moose/Object.pm lin e 25 # Moose::Object::new('Madre::Sync::Model::padreDB', 'Madre::Sync', 'HASH(0x4b404ec)') called at generated method (unknown origin) line 4 # Catalyst::Model::DBIC::Schema::new('Madre::Sync::Model::padreDB', 'Madre::Sync', 'HASH(0x4b404ec)') called at C:\strawberry\perl\vendor\lib/MooseX/ Traits/Pluggable.pm line 131 # MooseX::Traits::Pluggable::new_with_traits('Madre::Sync::Model::padreDB', 'Madre::Sync') called at C:\strawberry\perl\vendor\lib/CatalystX/Componen t/Traits.pm line 146 # CatalystX::Component::Traits::COMPONENT('Madre::Sync::Model::padreDB', 'Madre::Sync', 'HASH(0x4c6b93c)') called at C:\strawberry\perl\vendor\lib/Cl ass/MOP/Method/Wrapped.pm line 48 # Class::MOP::Method::Wrapped::__ANON__[C:\strawberry\perl\vendor\lib/Class/MOP/Method/Wrapped.pm:49]('Madre::Sync::Model::padreDB', 'Madre::Sync', ' HASH(0x4c6b93c)') called at C:\strawberry\perl\vendor\lib/Class/MOP/Method/Wrapped.pm line 89 # Catalyst::Model::DBIC::Schema::COMPONENT('Madre::Sync::Model::padreDB', 'Madre::Sync', 'HASH(0x4c6b93c)') called at C:\strawberry\perl\vendor\lib/C atalyst.pm line 2502 # eval {...} called at C:\strawberry\perl\vendor\lib/Catalyst.pm line 2502 # Catalyst::setup_component('Madre::Sync', 'Madre::Sync::Model::padreDB') called at C:\strawberry\perl\vendor\lib/Catalyst.pm line 2416 # Catalyst::setup_components('Madre::Sync') called at C:\strawberry\perl\vendor\lib/Class/MOP/Method/Wrapped.pm line 54 # Class::MOP::Method::Wrapped::__ANON__[C:\strawberry\perl\vendor\lib/Class/MOP/Method/Wrapped.pm:64]('Madre::Sync') called at C:\strawberry\perl\ven dor\lib/Class/MOP/Method/Wrapped.pm line 89 # Madre::Sync::setup_components('Madre::Sync') called at C:\strawberry\perl\vendor\lib/Catalyst.pm line 1142 # Catalyst::setup('Madre::Sync') called at blib\lib/Madre/Sync.pm line 62 # require Madre/Sync.pm called at C:\strawberry\perl\vendor\lib/Class/MOP.pm line 114 # Class::MOP::__ANON__[C:\strawberry\perl\vendor\lib/Class/MOP.pm:118]() called at C:\strawberry\perl\vendor\lib/Try/Tiny.pm line 74 # eval {...} called at C:\strawberry\perl\vendor\lib/Try/Tiny.pm line 67 # Try::Tiny::try('CODE(0x36d759c)', 'Try::Tiny::Catch=REF(0x33a9584)') called at C:\strawberry\perl\vendor\lib/Class/MOP.pm line 125 # Class::MOP::load_first_existing_class('Madre::Sync') called at C:\strawberry\perl\vendor\lib/Class/MOP.pm line 137 # Class::MOP::load_class('Madre::Sync') called at C:\strawberry\perl\vendor\lib/Catalyst/Test.pm line 24 # Catalyst::Test::__ANON__[C:\strawberry\perl\vendor\lib/Catalyst/Test.pm:93]('Catalyst::Test', 'all', 'HASH(0x36d768c)', 'HASH(0x25de3a4)') called a t C:\strawberry\perl\vendor\lib/Sub/Exporter.pm line 493 # Sub::Exporter::_expand_group('Catalyst::Test', 'HASH(0x36d4ce4)', 'ARRAY(0x36d4994)', 'HASH(0x25de3a4)', 'HASH(0x36d755c)', 'HASH(0x25de334)') call ed at C:\strawberry\perl\vendor\lib/Sub/Exporter.pm line 424 # Sub::Exporter::_expand_groups('Catalyst::Test', 'HASH(0x36d4ce4)', 'ARRAY(0x36d723c)', 'HASH(0x25de3a4)') called at C:\strawberry\perl\vendor\lib/S ub/Exporter.pm line 742 # Sub::Exporter::__ANON__[C:\strawberry\perl\vendor\lib/Sub/Exporter.pm:756]('Catalyst::Test', '-all', 'HASH(0x36cc8d4)') called at C:\strawberry\per l\vendor\lib/Catalyst/Test.pm line 112 # Catalyst::Test::import('Catalyst::Test', 'Madre::Sync') called at (eval 11)[C:/strawberry/perl/lib/Test/More.pm:858] line 2 # main::BEGIN() called at blib\lib/Madre/Sync.pm line 0 # eval {...} called at blib\lib/Madre/Sync.pm line 0 # eval 'package main; # use Catalyst::Test @{$args[0]}; # 1; # # ;' called at C:/strawberry/perl/lib/Test/More.pm line 858 # Test::More::_eval('package main;\x{a}use Catalyst::Test @{$args[0]};\x{a}1;\x{a}', 'ARRAY(0x2308474)') called at C:/strawberry/perl/lib/Test/More.p m line 833 # Test::More::use_ok('Catalyst::Test', 'Madre::Sync') called at t\01app.t line 7 # at C:\strawberry\perl\vendor\lib/MooseX/Types/TypeDecorator.pm line 208 # MooseX::Types::TypeDecorator::AUTOLOAD('MooseX::Types::TypeDecorator=HASH(0x4a31424)', 'Madre::Sync::Schema') called at C:\strawberry\perl\vendor\l ib/Moose/Meta/Attribute.pm line 743 # Moose::Meta::Attribute::_coerce_and_verify('Moose::Meta::Attribute=HASH(0x4b467fc)', 'Madre::Sync::Schema', 'Madre::Sync::Model::padreDB=HASH(0x4db 7c64)') called at C:\strawberry\perl\vendor\lib/Moose/Meta/Attribute.pm line 398 # Moose::Meta::Attribute::initialize_instance_slot('Moose::Meta::Attribute=HASH(0x4b467fc)', 'Moose::Meta::Instance=HASH(0x4db7ed4)', 'Madre::Sync::M odel::padreDB=HASH(0x4db7c64)', 'HASH(0x4db53ac)') called at C:\strawberry\perl\vendor\lib/Class/MOP/Class.pm line 567 # Class::MOP::Class::_construct_instance('Moose::Meta::Class=HASH(0x4942ffc)', 'HASH(0x4db53ac)') called at C:\strawberry\perl\vendor\lib/Class/MOP/C lass.pm line 540 # Class::MOP::Class::new_object('Moose::Meta::Class=HASH(0x4942ffc)', 'HASH(0x4db53ac)') called at C:\strawberry\perl\vendor\lib/Moose/Meta/Class.pm line 256 # Moose::Meta::Class::new_object('Moose::Meta::Class=HASH(0x4942ffc)', 'HASH(0x4db53ac)') called at C:\strawberry\perl\vendor\lib/Moose/Object.pm lin e 25 # Moose::Object::new('Madre::Sync::Model::padreDB', 'Madre::Sync', 'HASH(0x4b404ec)') called at generated method (unknown origin) line 4 # Catalyst::Model::DBIC::Schema::new('Madre::Sync::Model::padreDB', 'Madre::Sync', 'HASH(0x4b404ec)') called at C:\strawberry\perl\vendor\lib/MooseX/ Traits/Pluggable.pm line 131 # MooseX::Traits::Pluggable::new_with_traits('Madre::Sync::Model::padreDB', 'Madre::Sync') called at C:\strawberry\perl\vendor\lib/CatalystX/Componen t/Traits.pm line 146 # CatalystX::Component::Traits::COMPONENT('Madre::Sync::Model::padreDB', 'Madre::Sync', 'HASH(0x4c6b93c)') called at C:\strawberry\perl\vendor\lib/Cl ass/MOP/Method/Wrapped.pm line 48 # Class::MOP::Method::Wrapped::__ANON__[C:\strawberry\perl\vendor\lib/Class/MOP/Method/Wrapped.pm:49]('Madre::Sync::Model::padreDB', 'Madre::Sync', ' HASH(0x4c6b93c)') called at C:\strawberry\perl\vendor\lib/Class/MOP/Method/Wrapped.pm line 89 # Catalyst::Model::DBIC::Schema::COMPONENT('Madre::Sync::Model::padreDB', 'Madre::Sync', 'HASH(0x4c6b93c)') called at C:\strawberry\perl\vendor\lib/C atalyst.pm line 2502 # eval {...} called at C:\strawberry\perl\vendor\lib/Catalyst.pm line 2502 # Catalyst::setup_component('Madre::Sync', 'Madre::Sync::Model::padreDB') called at C:\strawberry\perl\vendor\lib/Catalyst.pm line 2416 # Catalyst::setup_components('Madre::Sync') called at C:\strawberry\perl\vendor\lib/Class/MOP/Method/Wrapped.pm line 54 # Class::MOP::Method::Wrapped::__ANON__[C:\strawberry\perl\vendor\lib/Class/MOP/Method/Wrapped.pm:64]('Madre::Sync') called at C:\strawberry\perl\ven dor\lib/Class/MOP/Method/Wrapped.pm line 89 # Madre::Sync::setup_components('Madre::Sync') called at C:\strawberry\perl\vendor\lib/Catalyst.pm line 1142 # Catalyst::setup('Madre::Sync') called at blib\lib/Madre/Sync.pm line 62 # require Madre/Sync.pm called at C:\strawberry\perl\vendor\lib/Class/MOP.pm line 114 # Class::MOP::__ANON__[C:\strawberry\perl\vendor\lib/Class/MOP.pm:118]() called at C:\strawberry\perl\vendor\lib/Try/Tiny.pm line 74 # eval {...} called at C:\strawberry\perl\vendor\lib/Try/Tiny.pm line 67 # Try::Tiny::try('CODE(0x36d759c)', 'Try::Tiny::Catch=REF(0x33a9584)') called at C:\strawberry\perl\vendor\lib/Class/MOP.pm line 125 # Class::MOP::load_first_existing_class('Madre::Sync') called at C:\strawberry\perl\vendor\lib/Class/MOP.pm line 137 # Class::MOP::load_class('Madre::Sync') called at C:\strawberry\perl\vendor\lib/Catalyst/Test.pm line 24 # Catalyst::Test::__ANON__[C:\strawberry\perl\vendor\lib/Catalyst/Test.pm:93]('Catalyst::Test', 'all', 'HASH(0x36d768c)', 'HASH(0x25de3a4)') called a t C:\strawberry\perl\vendor\lib/Sub/Exporter.pm line 493 # Sub::Exporter::_expand_group('Catalyst::Test', 'HASH(0x36d4ce4)', 'ARRAY(0x36d4994)', 'HASH(0x25de3a4)', 'HASH(0x36d755c)', 'HASH(0x25de334)') call ed at C:\strawberry\perl\vendor\lib/Sub/Exporter.pm line 424 # Sub::Exporter::_expand_groups('Catalyst::Test', 'HASH(0x36d4ce4)', 'ARRAY(0x36d723c)', 'HASH(0x25de3a4)') called at C:\strawberry\perl\vendor\lib/S ub/Exporter.pm line 742 # Sub::Exporter::__ANON__[C:\strawberry\perl\vendor\lib/Sub/Exporter.pm:756]('Catalyst::Test', '-all', 'HASH(0x36cc8d4)') called at C:\strawberry\per l\vendor\lib/Catalyst/Test.pm line 112 # Catalyst::Test::import('Catalyst::Test', 'Madre::Sync') called at (eval 11)[C:/strawberry/perl/lib/Test/More.pm:858] line 2 # main::BEGIN() called at blib\lib/Madre/Sync.pm line 0 # eval {...} called at blib\lib/Madre/Sync.pm line 0 # eval 'package main; # use Catalyst::Test @{$args[0]}; # 1; # # ;' called at C:/strawberry/perl/lib/Test/More.pm line 858 # Test::More::_eval('package main;\x{a}use Catalyst::Test @{$args[0]};\x{a}1;\x{a}', 'ARRAY(0x2308474)') called at C:/strawberry/perl/lib/Test/More.p m line 833 # Test::More::use_ok('Catalyst::Test', 'Madre::Sync') called at t\01app.t line 7"Compilation failed in require at C:\strawberry\perl\vendor\lib/Class /MOP.pm line 114. # at C:\strawberry\perl\vendor\lib/Class/MOP.pm line 121 # Class::MOP::__ANON__[C:\strawberry\perl\vendor\lib/Class/MOP.pm:125]('Couldn\'t instantiate component "Madre::Sync::Model::padreDB"...') called at C:\strawberry\perl\vendor\lib/Try/Tiny.pm line 98 # Try::Tiny::try('CODE(0x36d759c)', 'Try::Tiny::Catch=REF(0x33a9584)') called at C:\strawberry\perl\vendor\lib/Class/MOP.pm line 125 # Class::MOP::load_first_existing_class('Madre::Sync') called at C:\strawberry\perl\vendor\lib/Class/MOP.pm line 137 # Class::MOP::load_class('Madre::Sync') called at C:\strawberry\perl\vendor\lib/Catalyst/Test.pm line 24 # Catalyst::Test::__ANON__[C:\strawberry\perl\vendor\lib/Catalyst/Test.pm:93]('Catalyst::Test', 'all', 'HASH(0x36d768c)', 'HASH(0x25de3a4)') called a t C:\strawberry\perl\vendor\lib/Sub/Exporter.pm line 493 # Sub::Exporter::_expand_group('Catalyst::Test', 'HASH(0x36d4ce4)', 'ARRAY(0x36d4994)', 'HASH(0x25de3a4)', 'HASH(0x36d755c)', 'HASH(0x25de334)') call ed at C:\strawberry\perl\vendor\lib/Sub/Exporter.pm line 424 # Sub::Exporter::_expand_groups('Catalyst::Test', 'HASH(0x36d4ce4)', 'ARRAY(0x36d723c)', 'HASH(0x25de3a4)') called at C:\strawberry\perl\vendor\lib/S ub/Exporter.pm line 742 # Sub::Exporter::__ANON__[C:\strawberry\perl\vendor\lib/Sub/Exporter.pm:756]('Catalyst::Test', '-all', 'HASH(0x36cc8d4)') called at C:\strawberry\per l\vendor\lib/Catalyst/Test.pm line 112 # Catalyst::Test::import('Catalyst::Test', 'Madre::Sync') called at (eval 11)[C:/strawberry/perl/lib/Test/More.pm:858] line 2 # main::BEGIN() called at C:\strawberry\perl\vendor\lib/Catalyst/Test.pm line 2 # eval {...} called at C:\strawberry\perl\vendor\lib/Catalyst/Test.pm line 2 # eval 'package main; # use Catalyst::Test @{$args[0]}; # 1; # # ;' called at C:/strawberry/perl/lib/Test/More.pm line 858 # Test::More::_eval('package main;\x{a}use Catalyst::Test @{$args[0]};\x{a}1;\x{a}', 'ARRAY(0x2308474)') called at C:/strawberry/perl/lib/Test/More.p m line 833 # Test::More::use_ok('Catalyst::Test', 'Madre::Sync') called at t\01app.t line 7 # BEGIN failed--compilation aborted at (eval 11)[C:/strawberry/perl/lib/Test/More.pm:858] line 2.
Re:Schema.pm is not automatically generated
Alias on 2010-07-29T23:33:31
Someone added it as a fix after I wrote this post.
I agree with zby. The file should be available. It *is* based on Loader, so it will load the table definitions etc. automatically as I understand. Your Madre::Sync::Model::padreDB has a schema_class of Madre::Sync::Schema. Catalyst::Model::DBIC::Schema coerces that to basically a ClassName type (the name of a loaded class) by attempting to load it via Class::MOP. The coercion is declared in Catalyst::Model::DBIC::Schema::Types.
The basic issue seems to be that it can't locate that file, as zby suggests.