On 1/14/07, Robert James Kaes <[EMAIL PROTECTED]> wrote:
> On Sat, 13 Jan 2007, Jonathan Vanasco wrote:
>> you should tail the error log to see what the exact error is
>>
>> __PACKAGE__->meta->initialize( replace_existing=> 1 );
>>
>> in each of your rdbo classes, after everything has been described,
>> *might* help.  without an actual error message, its a wild stab.
>
> Thank you for the suggestion.  I already have the above line in my
> Model::Artist file after the __PACKAGE__->meta->setup(...) routine.

The setup() method is indeed the recommended way to configure your
classes.  You should not call initialize() after your call to setup(),
since setup() itself will call initialize() internally:

http://search.cpan.org/dist/Rose-DB-Object/lib/Rose/DB/Object/Metadata.pm#setup

"If 'initialize' is not one of the method names, then it will be
called automatically (with no arguments) at the end. If you do not
want to pass any arguments to the initialize method, standard practice
is to omit it."

If you *do* want to pass arguments to the call to initialize, use the
standard technique described in the setup() docs:

    __PACKAGE__->meta->setup
    (
      ...
      initialize => [ replace_existing => 1 ],
    );

> After doing a "touch" on the Model/Artist.pm file, I get the following
> error when I reload the page in the Apache error log:
>
>     [error] [client 127.0.0.1] Cannot create method
>     Model::Artist::add_nationalities - method already exists
>     at /usr/lib/perl5/site_perl/5.8.8/Rose/DB/Object/Metadata/MethodMaker.pm
>     line 420\nCompilation failed in require at
>     /usr/lib/perl5/site_perl/5.8.8/i686-linux-l d/Apache2/Reload.pm line
>     160.\n

It does look like it's trying to re-initialize() this class.  If
that's the case, I recommend using replace_existing => 1 as shown
above.  (You could also use preserve_existing => 1 to silence the
error, but then your class may not reflect chances made in the .pm
file that's being reloaded.)

-John

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to