FAQ
What is it about setting MOD_PERL that affects inheritance?



If I set MOD_PERL before running my test script I get the message:



Can't locate object method "new" via package
"Catalyst::Engine::Apache2::MP20" at
/usr/pkg/lib/perl5/site_perl/5.8.0/Catalyst.pm line 1776.



If it is unset the runtime error when I run the catalyst test script is:



[Fri Jan 27 09:37:23 2006] [catalyst] [error] Caught exception in engine
"Can't call method "connection" on an undefined value at
/usr/pkg/lib/perl5/site_perl/5.8.0/Catalyst/Engine/Apache.pm line 22."





Line 1776 of Catalyst.pm is



$class->engine( $engine->new );



I can't see where setting MOD_PERL would have this effect.



Related info and question:



- This is a clean install of Catalyst 5.63. I manually deleted all
references to Catalyst on my system and then used CPAN to install
Task::Catalyst.



- I'm setting MOD_PERL to mod_perl/2.000001 which is the version of mod_perl
on my system.



- My application uses -Engine=Apache2::MP20 in the use Catalyst line.



- How do folks debug the application setup process? I've been peppering
Catalyst.pm and others with various prints, warns, and dies. I'd really
like to be able to step through the code in the debugger.



Any pointers are greatly appreciated!



- Alan



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20060127/8175f7e6/attachment.htm

Search Discussions

  • Alan Humphrey at Jan 27, 2006 at 8:38 pm
    Partial answers:



    CGI::Cookie expects MOD_PERL_API_VERSION to be set to 2 if you're using
    mod_perl2. Otherwise it works with mod_perl, which is wrong.



    Put $DB::Single=1; anywhere in your code where you want the debugger to
    stop and it'll stop there, even at compile time.



    Still trying to figure out why $c->engine->apache is undef.



    - Alan



    -----Original Message-----
    From: catalyst-bounces@lists.rawmode.org
    On Behalf Of Alan Humphrey
    Sent: Friday, January 27, 2006 9:53 AM
    To: catalyst@lists.rawmode.org
    Subject: [Catalyst] MOD_PERL environment variable



    What is it about setting MOD_PERL that affects inheritance?



    If I set MOD_PERL before running my test script I get the message:



    Can't locate object method "new" via package
    "Catalyst::Engine::Apache2::MP20" at
    /usr/pkg/lib/perl5/site_perl/5.8.0/Catalyst.pm line 1776.



    If it is unset the runtime error when I run the catalyst test script is:



    [Fri Jan 27 09:37:23 2006] [catalyst] [error] Caught exception in engine
    "Can't call method "connection" on an undefined value at
    /usr/pkg/lib/perl5/site_perl/5.8.0/Catalyst/Engine/Apache.pm line 22."





    Line 1776 of Catalyst.pm is



    $class->engine( $engine->new );



    I can't see where setting MOD_PERL would have this effect.



    Related info and question:



    - This is a clean install of Catalyst 5.63. I manually deleted all
    references to Catalyst on my system and then used CPAN to install
    Task::Catalyst.



    - I'm setting MOD_PERL to mod_perl/2.000001 which is the version of mod_perl
    on my system.



    - My application uses -Engine=Apache2::MP20 in the use Catalyst line.



    - How do folks debug the application setup process? I've been peppering
    Catalyst.pm and others with various prints, warns, and dies. I'd really
    like to be able to step through the code in the debugger.



    Any pointers are greatly appreciated!



    - Alan



    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20060127/65a5c89b/attachment.htm
  • Andy Grundman at Jan 27, 2006 at 8:53 pm

    Alan Humphrey wrote:
    - I?m setting MOD_PERL to mod_perl/2.000001 which is the version of
    mod_perl on my system.
    This should come from mod_perl itself, you shouldn't be setting this manually.
    - My application uses ?Engine=Apache2::MP20 in the use Catalyst line.
    You do not ever want to specify the engine manually like this. Let Catalyst
    auto-detect.

    I'm not sure what you're trying to do but if you are looking to test an app
    running in mod_perl, the solution is to run your app under Apache and then set
    the environment variable CATALYST_SERVER="http://server/myapp"

    Then any test scripts will run against that remote server using LWP. Even
    though the test scripts specify URLs of http://localhost, it will be rewritten
    internally to use the remote server.

    -Andy
  • Alan Humphrey at Jan 28, 2006 at 12:29 am
    It's all magic. I upgraded to the latest version of mod_perl2 and it all
    started to work. Maybe just recompiling everything was enough.

    Thanks for the advice on letting Catalyst auto-detect the Engine. One less
    thing to worry about.

    - Alan

    -----Original Message-----
    From: catalyst-bounces@lists.rawmode.org
    On Behalf Of Andy Grundman
    Sent: Friday, January 27, 2006 12:00 PM
    To: The elegant MVC web framework
    Subject: Re: [Catalyst] MOD_PERL environment variable

    Alan Humphrey wrote:
    - I'm setting MOD_PERL to mod_perl/2.000001 which is the version of
    mod_perl on my system.
    This should come from mod_perl itself, you shouldn't be setting this
    manually.
    - My application uses -Engine=Apache2::MP20 in the use Catalyst line.
    You do not ever want to specify the engine manually like this. Let Catalyst

    auto-detect.

    I'm not sure what you're trying to do but if you are looking to test an app
    running in mod_perl, the solution is to run your app under Apache and then
    set
    the environment variable CATALYST_SERVER="http://server/myapp"

    Then any test scripts will run against that remote server using LWP. Even
    though the test scripts specify URLs of http://localhost, it will be
    rewritten
    internally to use the remote server.

    -Andy

    _______________________________________________
    Catalyst mailing list
    Catalyst@lists.rawmode.org
    http://lists.rawmode.org/mailman/listinfo/catalyst

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedJan 27, '06 at 6:45p
activeJan 28, '06 at 12:29a
posts4
users2
websitecatalystframework.org
irc#catalyst

2 users in discussion

Alan Humphrey: 3 posts Andy Grundman: 1 post

People

Translate

site design / logo © 2022 Grokbase