[Catalyst] Missing Apache::Request Sanity Check

Andy Grundman andy at hybridized.org
Mon Sep 19 20:31:23 CEST 2005


Juan Camacho wrote:
> I was installing a catalyst application on a new machine and I
> couldn't figure out why catalyst was complaining about `Can't locate
> object method "components"` under Apache::Registry until I figured out
> that Apache::Request wasn't installed on that machine.
> 
> Not sure why it's is not caught earlier in
> Catalyst::Engine::Apache::Base::prepare_request for example.
> 
>   sub prepare_request {
>     my ( $c, $r ) = @_;
>     carp "Apache::Request object not defined" unless $r;  ## <---
> maybe this should be added
>     $c->apache($r);
>   }
> 
> ... or even earlier in Catalyst::Setup::setup_engine
> 
>   if ( Apache::Request->require ) {
>     $engine = 'Catalyst::Engine::Apache::MP13::Apreq';
>   } else {
>     carp "Apache::Request module not found";
>   }
> 
> After finding this, I made sure that I put Apache::Request in my
> application pre-reqs check, but it *might be* a good idea as a general
> philosophy that Catalyst bail out as early as possible with things
> like this.

Catalyst is designed to run on mod_perl even without Apache::Request. 
It falls back to using CGI.pm if it's not available (Engine::Apache::MP13).

-Andy



More information about the Catalyst mailing list