Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy am I getting this error with the perl module Catalyst::Model::Adaptor?
    primarykey
    data
    text
    <p>I'm trying to get an old project I was handed to run and I'm running into a problem with the model we have for TheSchwartz. The code looks exactly the same as a bunch of other examples to do similar things I've found online. The code is also pretty simple;</p> <pre><code>package MyApp::Model::TheSchwartz; use Moose; use namespace::autoclean; extends 'Catalyst::Model::Adaptor'; __PACKAGE__-&gt;config( class =&gt; "TheSchwartz" ); sub mangle_arguments { my ($self, $args) = @_; if($args-&gt;{databases}) { if(ref($args-&gt;{databases}) eq 'HASH') { my %db = %{ $args-&gt;{databases} }; $args-&gt;{databases} = [ \%db ]; } } return %{ $args } } 1; </code></pre> <p>The error I get is</p> <pre><code>Couldn't instantiate component "MyApp::Model::TheSchwartz", "unknown options args, catalyst_component_name, class at /usr/local/share/perl/5.14.2/Catalyst/Model/Adaptor/Base.pm line 27."Compilation failed in require at /usr/local/share/perl/5.14.2/Module/Runtime.pm line 317. at /usr/local/share/perl/5.14.2/Catalyst/Script/Server.pm line 242. </code></pre> <p>I've tried removing the mangle_arguments function, I've tried removing the Moose usage and using "use base" instead. I always end up with the same error, and I'm really having a hard time even grokking the error message. I don't see catalyst_component_name defined anywhere in my code so it must be passed down from Catalyst::Model::Adaptor, but.. why doesnt it work?</p> <p>EDIT:</p> <p>here's the relevant config section:</p> <pre><code>&lt;Model::TheSchwartz&gt; &lt;args&gt; verbose 1 &lt;databases&gt; dsn dbi:mysql:host=db.vpn;dbname=theschwartz user user pass password &lt;/databases&gt; &lt;/args&gt; &lt;/Model::TheSchwartz&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload