Loading ...
Sorry, an error occurred while loading the content.
 

Can't locate object method "request" via package "Apache"

Expand Messages
  • T R Stickland
    [First a quick hello. We (http://edina.ac.uk/) have been using Apache::ASP for a few years, but you haven t heard much from us as it s worked pretty well!]
    Message 1 of 4 , Jul 11, 2007
      [First a quick hello.   We (http://edina.ac.uk/) have been using Apache::ASP for a few years, but you haven't heard much from us as it's worked pretty well!]

      For the first time I've built apache2 (apache 2.2.4, mod_perl 2.0.3) for use with ASP (2.59).   The build and configuration went fine.   The web server started up and was fine until the first time I tried to access an ASP application.
      Can't locate object method "request" via package "Apache" at [...]/perl5/lib/perl5/site_perl/5.8.0//Apache/ASP.pm line 165.
        
      ...and that line is...
      my $rtest = $ModPerl2 ? Apache2::RequestUtil->request() : Apache->request();
        
      It's calling Apache->request when should be calling Apache2::RequestUtil->request (it's mod_perl version 2.0.3).    So it's the $ModPerl2 flag.   Line 66 of ASP.pm initialized it:
      $ModPerl2 = ($mod_perl::VERSION >= 1.99);
      Now it turns out $mod_perl::VERSION is 1.30.   There's an easy workaround using $ENV{MOD_PERL_API_VERSION}
      $ModPerl2 = ($ENV{MOD_PERL_API_VERSION} >= 2);
        
      I see this has occurred before, though the error reported was different, and also in that case  $mod_perl::VERSION was undefined rather than having the wrong value.    See:  http://tech.groups.yahoo.com/group/apache-asp/message/2136

      On one hand the workaround is OK, and I'm not keen to guddle about in the mod_perl code.  On the other hand, I'm not really happy just ignoring the fact that $mod_perl::VERSION is wrong...

      Anyone know the cause and/or better fix?  

      tim

      -- 
      Dr Tim Stickland
      EDINA (http://edina.ac.uk/)

    • Helmut Zeilinger
      Hi Tim, (like i postet Tidal 2 months ago on this list) you might try a patch from Maurice Yarrow: see
      Message 2 of 4 , Jul 11, 2007
        Hi Tim,

        (like i postet Tidal 2 months ago on this list)

        you might try a patch from Maurice Yarrow:

        see

        http://www.gossamer-threads.com/lists/modperl/asp/89060?search_string=yarrow;#89060


        (approx. bottom quarter of the page)


        Helmut


        T R Stickland schrieb:
        > [First a quick hello. We (http://edina.ac.uk/) have been using
        > Apache::ASP for a few years, but you haven't heard much from us as
        > it's worked pretty well!]
        >
        > For the first time I've built apache2 (apache 2.2.4, mod_perl 2.0.3)
        > for use with ASP (2.59). The build and configuration went fine.
        > The web server started up and was fine until the first time I tried to
        > access an ASP application.
        >
        > Can't locate object method "request" via package "Apache" at
        > [...]/perl5/lib/perl5/site_perl/5.8.0//Apache/ASP.pm line 165.
        >
        > ...and that line is...
        >
        > my $rtest = $ModPerl2 ? Apache2::RequestUtil->request() :
        > Apache->request();
        >
        > It's calling Apache->request when should be calling
        > Apache2::RequestUtil->request (it's mod_perl version 2.0.3). So
        > it's the $ModPerl2 flag. Line 66 of ASP.pm initialized it:
        >
        > $ModPerl2 = ($mod_perl::VERSION >= 1.99);
        >
        > Now it turns out $mod_perl::VERSION is 1.30. There's an easy
        > workaround using $ENV{MOD_PERL_API_VERSION}
        >
        > $ModPerl2 = ($ENV{MOD_PERL_API_VERSION} >= 2);
        >
        > I see this has occurred before, though the error reported was
        > different, and also in that case $mod_perl::VERSION was undefined
        > rather than having the wrong value. See:
        > http://tech.groups.yahoo.com/group/apache-asp/message/2136
        >
        > On one hand the workaround is OK, and I'm not keen to guddle about in
        > the mod_perl code. On the other hand, I'm not really happy just
        > ignoring the fact that $mod_perl::VERSION is wrong...
        >
        > Anyone know the cause and/or better fix?
        > tim
        >

        ---------------------------------------------------------------------
        To unsubscribe, e-mail: asp-unsubscribe@...
        For additional commands, e-mail: asp-help@...
      • T R Stickland
        Thanks Helmut. My patch is similar to Maurice s, except that his allows for $mod_perl::VERSION to be an empty string. In my case it has been assigned the
        Message 3 of 4 , Jul 11, 2007
          Thanks Helmut.

          My patch is similar to Maurice's, except that his allows for
          $mod_perl::VERSION to be an empty string. In my case it has been
          assigned the value "1.30". Maurice's patch would just use this
          value. So in my case I ignore $mod_perl::VERSION altogether and use
          $ENV{MOD_PERL_API_VERSION}.

          Maybe worth noting that, I think, $ENV{MOD_PERL_API_VERSION} is the API
          version rather than the mod_perl version? So I'd expect to see a value
          "2" rather than 2.0.3 or whatever. That means it's not strictly
          interchangeable with $mod_perl::VERSION, but the distinction is pretty
          much immaterial to Maurice's and my own patch, at least at the moment.

          tim



          Helmut Zeilinger wrote:
          > Hi Tim,
          >
          > (like i postet Tidal 2 months ago on this list)
          >
          > you might try a patch from Maurice Yarrow:
          >
          > see
          >
          > http://www.gossamer-threads.com/lists/modperl/asp/89060?search_string=yarrow;#89060
          >
          >
          > (approx. bottom quarter of the page)
          >
          >
          > Helmut
          >
          >
          > T R Stickland schrieb:
          >> [First a quick hello. We (http://edina.ac.uk/) have been using
          >> Apache::ASP for a few years, but you haven't heard much from us as
          >> it's worked pretty well!]
          >>
          >> For the first time I've built apache2 (apache 2.2.4, mod_perl 2.0.3)
          >> for use with ASP (2.59). The build and configuration went fine.
          >> The web server started up and was fine until the first time I tried
          >> to access an ASP application.
          >>
          >> Can't locate object method "request" via package "Apache" at
          >> [...]/perl5/lib/perl5/site_perl/5.8.0//Apache/ASP.pm line 165.
          >> ...and that line is...
          >>
          >> my $rtest = $ModPerl2 ? Apache2::RequestUtil->request() :
          >> Apache->request();
          >> It's calling Apache->request when should be calling
          >> Apache2::RequestUtil->request (it's mod_perl version 2.0.3). So
          >> it's the $ModPerl2 flag. Line 66 of ASP.pm initialized it:
          >>
          >> $ModPerl2 = ($mod_perl::VERSION >= 1.99);
          >>
          >> Now it turns out $mod_perl::VERSION is 1.30. There's an easy
          >> workaround using $ENV{MOD_PERL_API_VERSION}
          >>
          >> $ModPerl2 = ($ENV{MOD_PERL_API_VERSION} >= 2);
          >> I see this has occurred before, though the error reported was
          >> different, and also in that case $mod_perl::VERSION was undefined
          >> rather than having the wrong value. See:
          >> http://tech.groups.yahoo.com/group/apache-asp/message/2136
          >>
          >> On one hand the workaround is OK, and I'm not keen to guddle about in
          >> the mod_perl code. On the other hand, I'm not really happy just
          >> ignoring the fact that $mod_perl::VERSION is wrong...
          >>
          >> Anyone know the cause and/or better fix? tim
          >>
          >

          --
          Dr Tim Stickland
          EDINA (http://edina.ac.uk/)


          ---------------------------------------------------------------------
          To unsubscribe, e-mail: asp-unsubscribe@...
          For additional commands, e-mail: asp-help@...
        • Andrew Koebrick
          Howdy, I am attempting to access the session object from another program, not running under Apache::ASP. I recall seeing the syntax to do this on
          Message 4 of 4 , Jul 12, 2007
            Howdy,

            I am attempting to access the session object from another program, not
            running under Apache::ASP. I recall seeing the syntax to do this on
            http://www.apache-asp.org at some point but now can't find it.

            Basically, I was to get the session user name so that I can use it to
            pre-authenticate folks when they move between my applications and a
            forum software package (Mwforum) I am attempting to integrate.

            Any pointers?


            Andrew Koebrick
            Systems Administrator / Librarian
            Minnesota Department of Administration. Office of Geographic and
            Demographic Analysis
            658 Cedar St.
            St. Paul, MN 55101

            651-201-2465

            ---------------------------------------------------------------------
            To unsubscribe, e-mail: asp-unsubscribe@...
            For additional commands, e-mail: asp-help@...
          Your message has been successfully submitted and would be delivered to recipients shortly.