[Catalyst] crud example not working

Marc Gamontini marc.gamontini at gmail.com
Mon Jul 26 15:41:57 GMT 2010


Thanks you for your answer.
But you're right, the module ..is in its directory. I'm going to check the
package declaration.

I wondered if my team (a java one) could use Catalyst in a production env,
but we're not ready. A lot of examples don't work (from the first and the
second books we bought). I discovered the last erratas on the apress site :
is it possible to get a full (+edit) DBAuth example that works ? It would be
nice to remove, for "simple" CRUD examples, the authentication layer and get
working code with *stable* conventions, at least for new comers like us ! It
is *very* difficult to start Catalyst Tutorials from cpan on other distribs
(Debian is ok, but we don't use it here). Catalyst is an elegant one, but
hard to master (?!).

Best regards,
marc
2010/7/26 Steve <steve at matsch.com>

> Something IS missing - the 'Addresses.pm' module!  Actually, I'd be
> surprised if it's actually missing, however Perl can't find it for some
> reason.  I would check the 'package' declaration in your module against t=
he
> error.  It could be an issue with plurality, likely because a change was
> made somewhere along the line in how DBIC handles this.  Whatever the cas=
e,
> perl is looking for that module and can't find it.
>
>
>
> On 7/26/2010 8:57 AM, Marc Gamontini wrote:
>
>> hi,
>> I tried to install an old CRUD Catalyst example (Rockway's AddressBook
>> app, detailed in chapter 3 from his PACKT book) and I got errors.  I've
>> fully fonctional examples (from the Definitive Guide), like SneayCat - t=
hank
>> you, it's an excellent one ! - on the same machine, a CentOS 5.5 config =
with
>> Perl 5.8.8, Catalyst 5.80024 and modules, among them :
>> Catalyst::Devel is up to date (1.28)
>> DBIx::Class is up to date (0.08123).
>> Catalyst::Model::DBIC::Schema is up to date (0.43)
>> Catalyst::Devel is up to date (1.28).
>> Catalyst::Plugin::Authentication is up to date (0.10016).
>> Catalyst::Plugin::Authorization::Roles is up to date (0.08).
>> Catalyst::Plugin::ConfigLoader is up to date (0.28).
>> Catalyst::Plugin::Session is up to date (0.30).
>> Catalyst::Plugin::Session::State::Cookie is up to date (0.17).
>> Catalyst::Plugin::Session::Store::FastMmap is up to date (0.13).
>> Catalyst::Plugin::StackTrace is up to date (0.11).
>> Catalyst::Plugin::Static::Simple is up to date (0.29).
>> Class::MOP is up to date (1.04)
>> I applied changes detailed here
>> (/AddressBook::Schema::AddressDB::Result/):
>> http://wiki.catalystframework.org/wiki/thebookerrata
>> http://lists.scsys.co.uk/pipermail/catalyst/2009-April/021929.html
>> It doesn't work for me and i'm lost : I don't understand why the compone=
nt
>> can't be instantiated. Is something missing ?
>> Thank you in advance for your help !
>> Marc
>> Report :
>> #script/addressbook_server.pl <http://addressbook_server.pl>
>>
>> Couldn't load class (AddressBook) because: Couldn't instantiate component
>> "AddressBook::Model::AddressDB", "Couldn't load class
>> (AddressBook::Schema::AddressDB) because:
>> DBIx::Class::Schema::throw_exception(): DBIx::Class::Row::throw_exceptio=
n():
>> Can't locate AddressBook/Schema/AddressDB/Result/Addresses.pm in @INC (@=
INC
>> contains: /root/AddressBook/script/../lib
>> /root/perl5/lib/perl5/i386-linux-thread-multi /root/perl5/lib/perl5
>> /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi
>> /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl
>> /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi
>> /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl
>> /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at
>> /root/perl5/lib/perl5/Class/C3/Componentised.pm line 135.
>> Compilation failed in require at
>> /root/perl5/lib/perl5/Class/C3/Componentised.pm line 135.
>> Compilation failed in require at
>> /root/perl5/lib/perl5/Class/C3/Componentised.pm line 135.
>> Compilation failed in require at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Class/MOP.pm line 114.
>>  at /root/perl5/lib/perl5/i386-linux-thread-multi/Class/MOP.pm line 120
>>        Class::MOP::__ANON__('DBIx::Class::Schema::throw_exception():
>> DBIx::Class::Row::thr...') called at /root/perl5/lib/perl5/Try/Tiny.pm l=
ine
>> 98
>>        Try::Tiny::try('CODE(0xaefb290)',
>> 'Try::Tiny::Catch=3DREF(0xaeb31b0)') called at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Class/MOP.pm line 125
>>
>>  Class::MOP::load_first_existing_class('AddressBook::Schema::AddressDB')
>> called at /root/perl5/lib/perl5/i386-linux-thread-multi/Class/MOP.pm line
>> 137
>>        Class::MOP::load_class('AddressBook::Schema::AddressDB') called at
>> /root/perl5/lib/perl5/Catalyst/Model/DBIC/Schema/Types.pm line 21
>>
>>  Catalyst::Model::DBIC::Schema::Types::__ANON__('AddressBook::Schema::Ad=
dressDB')
>> called at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Moose/Meta/TypeCoercion.pm
>> line 63
>>
>>  Moose::Meta::TypeCoercion::__ANON__('AddressBook::Schema::AddressDB')
>> called at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Moose/Meta/TypeCoercion.pm
>> line 97
>>
>>  Moose::Meta::TypeCoercion::coerce('Moose::Meta::TypeCoercion=3DHASH(0xa=
e2b0e4)',
>> 'AddressBook::Schema::AddressDB') called at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Moose/Meta/TypeConstraint.=
pm
>> line 90
>>
>>  Moose::Meta::TypeConstraint::coerce('Moose::Meta::TypeConstraint=3DHASH=
(0xae6f4dc)',
>> 'AddressBook::Schema::AddressDB') called at
>> /root/perl5/lib/perl5/MooseX/Types/TypeDecorator.pm line 206
>>        eval {...} called at
>> /root/perl5/lib/perl5/MooseX/Types/TypeDecorator.pm line 205
>>
>>  MooseX::Types::TypeDecorator::AUTOLOAD('MooseX::Types::TypeDecorator=3D=
HASH(0xadcaef0)',
>> 'AddressBook::Schema::AddressDB') called at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Moose/Meta/Attribute.pm li=
ne
>> 742
>>
>>  Moose::Meta::Attribute::_coerce_and_verify('Moose::Meta::Attribute=3DHA=
SH(0xaeab4e0)',
>> 'AddressBook::Schema::AddressDB',
>> 'AddressBook::Model::AddressDB=3DHASH(0xaf55448)') called at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Moose/Meta/Attribute.pm li=
ne
>> 398
>>
>>  Moose::Meta::Attribute::initialize_instance_slot('Moose::Meta::Attribut=
e=3DHASH(0xaeab4e0)',
>> 'Moose::Meta::Instance=3DHASH(0xaefb254)',
>> 'AddressBook::Model::AddressDB=3DHASH(0xaf55448)', 'HASH(0xaf55304)') ca=
lled
>> at /root/perl5/lib/perl5/i386-linux-thread-multi/Class/MOP/Class.pm line=
 567
>>
>>  Class::MOP::Class::_construct_instance('Moose::Meta::Class=3DHASH(0xadd=
3528)',
>> 'HASH(0xaf55304)') called at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Class/MOP/Class.pm line 540
>>        Class::MOP::Class::new_object('Moose::Meta::Class=3DHASH(0xadd352=
8)',
>> 'HASH(0xaf55304)') called at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Moose/Meta/Class.pm line 2=
56
>>
>>  Moose::Meta::Class::new_object('Moose::Meta::Class=3DHASH(0xadd3528)',
>> 'HASH(0xaf55304)') called at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Moose/Object.pm line 25
>>        Moose::Object::new('AddressBook::Model::AddressDB', 'AddressBook',
>> 'HASH(0xae9ed8c)') called at generated method (unknown origin) line 3
>>        Catalyst::Model::DBIC::Schema::new('AddressBook::Model::AddressDB=
',
>> 'AddressBook', 'HASH(0xae9ed8c)') called at
>> /root/perl5/lib/perl5/MooseX/Traits/Pluggable.pm line 131
>>
>>  MooseX::Traits::Pluggable::new_with_traits('AddressBook::Model::Address=
DB',
>> 'AddressBook') called at /root/perl5/lib/perl5/CatalystX/Component/Trait=
s.pm
>> line 145
>>
>>  CatalystX::Component::Traits::COMPONENT('AddressBook::Model::AddressDB',
>> 'AddressBook', 'HASH(0xaf553a0)') called at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Class/MOP/Method/Wrapped.pm
>> line 48
>>
>>  Class::MOP::Method::Wrapped::__ANON__('AddressBook::Model::AddressDB',
>> 'AddressBook', 'HASH(0xaf553a0)') called at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Class/MOP/Method/Wrapped.pm
>> line 89
>>
>>  Catalyst::Model::DBIC::Schema::COMPONENT('AddressBook::Model::AddressDB=
',
>> 'AddressBook', 'HASH(0xaf553a0)') called at
>> /root/perl5/lib/perl5/Catalyst.pm line 2502
>>        eval {...} called at /root/perl5/lib/perl5/Catalyst.pm line 2502
>>        Catalyst::setup_component('AddressBook',
>> 'AddressBook::Model::AddressDB') called at /root/perl5/lib/perl5/Catalys=
t.pm
>> line 2416
>>        Catalyst::setup_components('AddressBook') called at
>> /root/perl5/lib/perl5/Catalyst.pm line 1142
>>        Catalyst::setup('AddressBook') called at
>> /root/AddressBook/script/../lib/AddressBook.pm line 42
>>        require AddressBook.pm called at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Class/MOP.pm line 114
>>        Class::MOP::__ANON__() called at /root/perl5/lib/perl5/Try/Tiny.pm
>> line 71
>>        eval {...} called at /root/perl5/lib/perl5/Try/Tiny.pm line 67
>>        Try::Tiny::try('CODE(0x9f9cd50)',
>> 'Try::Tiny::Catch=3DREF(0xa74b390)') called at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Class/MOP.pm line 125
>>        Class::MOP::load_first_existing_class('AddressBook') called at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Class/MOP.pm line 137
>>        Class::MOP::load_class('AddressBook') called at
>> /root/perl5/lib/perl5/Catalyst/ScriptRole.pm line 61
>>
>>  Catalyst::ScriptRole::_run_application('Catalyst::Script::Server=3DHASH=
(0xa7726f4)')
>> called at /root/perl5/lib/perl5/Catalyst/Script/Server.pm line 181
>>
>>  Catalyst::Script::Server::run('Catalyst::Script::Server=3DHASH(0xa7726f=
4)')
>> called at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Class/MOP/Method/Wrapped.pm
>> line 48
>>
>>  Class::MOP::Method::Wrapped::__ANON__('Catalyst::Script::Server=3DHASH(=
0xa7726f4)')
>> called at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Class/MOP/Method/Wrapped.pm
>> line 89
>>
>>  Catalyst::Script::Server::run('Catalyst::Script::Server=3DHASH(0xa7726f=
4)')
>> called at /root/perl5/lib/perl5/Catalyst/ScriptRunner.pm line 20
>>        Catalyst::ScriptRunner::run('Catalyst::ScriptRunner',
>> 'AddressBook', 'Server') called at script/addressbook_server.pl <
>> http://addressbook_server.pl> line 8
>>
>>  at /root/perl5/lib/perl5/MooseX/Types/TypeDecorator.pm line 208
>>
>>  MooseX::Types::TypeDecorator::AUTOLOAD('MooseX::Types::TypeDecorator=3D=
HASH(0xadcaef0)',
>> 'AddressBook::Schema::AddressDB') called at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Moose/Meta/Attribute.pm li=
ne
>> 742
>>
>>  Moose::Meta::Attribute::_coerce_and_verify('Moose::Meta::Attribute=3DHA=
SH(0xaeab4e0)',
>> 'AddressBook::Schema::AddressDB',
>> 'AddressBook::Model::AddressDB=3DHASH(0xaf55448)') called at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Moose/Meta/Attribute.pm li=
ne
>> 398
>>
>>  Moose::Meta::Attribute::initialize_instance_slot('Moose::Meta::Attribut=
e=3DHASH(0xaeab4e0)',
>> 'Moose::Meta::Instance=3DHASH(0xaefb254)',
>> 'AddressBook::Model::AddressDB=3DHASH(0xaf55448)', 'HASH(0xaf55304)') ca=
lled
>> at /root/perl5/lib/perl5/i386-linux-thread-multi/Class/MOP/Class.pm line=
 567
>>
>>  Class::MOP::Class::_construct_instance('Moose::Meta::Class=3DHASH(0xadd=
3528)',
>> 'HASH(0xaf55304)') called at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Class/MOP/Class.pm line 540
>>        Class::MOP::Class::new_object('Moose::Meta::Class=3DHASH(0xadd352=
8)',
>> 'HASH(0xaf55304)') called at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Moose/Meta/Class.pm line 2=
56
>>
>>  Moose::Meta::Class::new_object('Moose::Meta::Class=3DHASH(0xadd3528)',
>> 'HASH(0xaf55304)') called at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Moose/Object.pm line 25
>>        Moose::Object::new('AddressBook::Model::AddressDB', 'AddressBook',
>> 'HASH(0xae9ed8c)') called at generated method (unknown origin) line 3
>>        Catalyst::Model::DBIC::Schema::new('AddressBook::Model::AddressDB=
',
>> 'AddressBook', 'HASH(0xae9ed8c)') called at
>> /root/perl5/lib/perl5/MooseX/Traits/Pluggable.pm line 131
>>
>>  MooseX::Traits::Pluggable::new_with_traits('AddressBook::Model::Address=
DB',
>> 'AddressBook') called at /root/perl5/lib/perl5/CatalystX/Component/Trait=
s.pm
>> line 145
>>
>>  CatalystX::Component::Traits::COMPONENT('AddressBook::Model::AddressDB',
>> 'AddressBook', 'HASH(0xaf553a0)') called at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Class/MOP/Method/Wrapped.pm
>> line 48
>>
>>  Class::MOP::Method::Wrapped::__ANON__('AddressBook::Model::AddressDB',
>> 'AddressBook', 'HASH(0xaf553a0)') called at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Class/MOP/Method/Wrapped.pm
>> line 89
>>
>>  Catalyst::Model::DBIC::Schema::COMPONENT('AddressBook::Model::AddressDB=
',
>> 'AddressBook', 'HASH(0xaf553a0)') called at
>> /root/perl5/lib/perl5/Catalyst.pm line 2502
>>        eval {...} called at /root/perl5/lib/perl5/Catalyst.pm line 2502
>>        Catalyst::setup_component('AddressBook',
>> 'AddressBook::Model::AddressDB') called at /root/perl5/lib/perl5/Catalys=
t.pm
>> line 2416
>>        Catalyst::setup_components('AddressBook') called at
>> /root/perl5/lib/perl5/Catalyst.pm line 1142
>>        Catalyst::setup('AddressBook') called at
>> /root/AddressBook/script/../lib/AddressBook.pm line 42
>>        require AddressBook.pm called at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Class/MOP.pm line 114
>>        Class::MOP::__ANON__() called at /root/perl5/lib/perl5/Try/Tiny.pm
>> line 71
>>        eval {...} called at /root/perl5/lib/perl5/Try/Tiny.pm line 67
>>        Try::Tiny::try('CODE(0x9f9cd50)',
>> 'Try::Tiny::Catch=3DREF(0xa74b390)') called at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Class/MOP.pm line 125
>>        Class::MOP::load_first_existing_class('AddressBook') called at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Class/MOP.pm line 137
>>        Class::MOP::load_class('AddressBook') called at
>> /root/perl5/lib/perl5/Catalyst/ScriptRole.pm line 61
>>
>>  Catalyst::ScriptRole::_run_application('Catalyst::Script::Server=3DHASH=
(0xa7726f4)')
>> called at /root/perl5/lib/perl5/Catalyst/Script/Server.pm line 181
>>
>>  Catalyst::Script::Server::run('Catalyst::Script::Server=3DHASH(0xa7726f=
4)')
>> called at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Class/MOP/Method/Wrapped.pm
>> line 48
>>
>>  Class::MOP::Method::Wrapped::__ANON__('Catalyst::Script::Server=3DHASH(=
0xa7726f4)')
>> called at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Class/MOP/Method/Wrapped.pm
>> line 89
>>
>>  Catalyst::Script::Server::run('Catalyst::Script::Server=3DHASH(0xa7726f=
4)')
>> called at /root/perl5/lib/perl5/Catalyst/ScriptRunner.pm line 20
>>        Catalyst::ScriptRunner::run('Catalyst::ScriptRunner',
>> 'AddressBook', 'Server') called at script/addressbook_server.pl <
>> http://addressbook_server.pl> line 8"Compilation failed in require at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Class/MOP.pm line 114.
>>
>>  at /root/perl5/lib/perl5/i386-linux-thread-multi/Class/MOP.pm line 120
>>        Class::MOP::__ANON__('Couldn\'t instantiate component
>> "AddressBook::Model::AddressD...') called at
>> /root/perl5/lib/perl5/Try/Tiny.pm line 98
>>        Try::Tiny::try('CODE(0x9f9cd50)',
>> 'Try::Tiny::Catch=3DREF(0xa74b390)') called at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Class/MOP.pm line 125
>>        Class::MOP::load_first_existing_class('AddressBook') called at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Class/MOP.pm line 137
>>        Class::MOP::load_class('AddressBook') called at
>> /root/perl5/lib/perl5/Catalyst/ScriptRole.pm line 61
>>
>>  Catalyst::ScriptRole::_run_application('Catalyst::Script::Server=3DHASH=
(0xa7726f4)')
>> called at /root/perl5/lib/perl5/Catalyst/Script/Server.pm line 181
>>
>>  Catalyst::Script::Server::run('Catalyst::Script::Server=3DHASH(0xa7726f=
4)')
>> called at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Class/MOP/Method/Wrapped.pm
>> line 48
>>
>>  Class::MOP::Method::Wrapped::__ANON__('Catalyst::Script::Server=3DHASH(=
0xa7726f4)')
>> called at
>> /root/perl5/lib/perl5/i386-linux-thread-multi/Class/MOP/Method/Wrapped.pm
>> line 89
>>
>>  Catalyst::Script::Server::run('Catalyst::Script::Server=3DHASH(0xa7726f=
4)')
>> called at /root/perl5/lib/perl5/Catalyst/ScriptRunner.pm line 20
>>        Catalyst::ScriptRunner::run('Catalyst::ScriptRunner',
>> 'AddressBook', 'Server') called at script/addressbook_server.pl <
>> http://addressbook_server.pl> line 8
>>
>>
>> _______________________________________________
>> List: Catalyst at lists.scsys.co.uk
>> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
>> Searchable archive:
>> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
>> Dev site: http://dev.catalyst.perl.org/
>>
>>
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100726/471ee=
0ad/attachment.htm


More information about the Catalyst mailing list