You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Georg Grabler <gg...@gmail.com> on 2006/08/02 13:49:22 UTC

Problem with Apache 2.2.2 / modperl 2.0.2 and Apache2::SOAP

I'm experiencing Problems with the setting written above.

Currently, i'm running the configuration as written in the header.

The apache config (by doing make test) outputs the following:


[Wed Aug 02 10:15:10 2006] [notice] Apache/2.2.2 (Unix) mod_perl/2.0.2
Perl/v5.8.2 configured -- resuming normal operations
[Wed Aug 02 10:15:10 2006] [info] Server built: Jul  5 2006 10:11:34
[Wed Aug 02 10:15:10 2006] [debug] prefork.c(991): AcceptMutex: sysvsem
(default: sysvsem)
[Wed Aug 02 10:15:15 2006] [error] [client 127.0.0.1] Can't locate object
method "header_in" via package "Apache2::RequestRec" at
/home/ggrabler/Apache2-SOAP-0.71/blib/lib/SOAP/Transport/HTTP2.pm line 96.\n
[Wed Aug 02 10:15:16 2006] [error] [client 127.0.0.1] Can't locate object
method "header_in" via package "Apache2::RequestRec" at
/home/ggrabler/Apache2-SOAP-0.71/blib/lib/SOAP/Transport/HTTP2.pm line 96.\n
[Wed Aug 02 10:15:16 2006] [info] removed PID file /home/ggrabler/Apache2-
SOAP-0.71/t/logs/httpd.pid (pid=52148)
[Wed Aug 02 10:15:16 2006] [notice] caught SIGTERM, shutting down


Well, if i force the install i also get this error on my main server
configuration ;). To ensure it's not a problem with AIX compiler (vac/cc_r),
i set up the whole configuration as well using ARCH Linux, with the same
result.

Since i wanted to solve the problem myself, i looked up the code of the
HTTP2.pm. It seems as if it's mod_perl which cuases those troubles, though,
as we can see i've got the latest mod_perl installed.

The sub new also did show me that the MOD_PERL_VERSION is manually set, by
determining if Apache2::RequestRec is loading... what doesn't seem to
happen.

Therefore MOD_PERL_VERSION is set to 1, and i get this error as if i was
using mod_perl version 1.

If i manually set the MOD_PERL_VERSION to 2 in the HTTP2.pm, it works .. not
properly though.

I wrote a small testfile, what does the following:

require Apache2::RequestRec;


(eval { require Apache2::RequestRec;} ) and do {
      require Apache2::RequestUtil;
      require Apache2::RequestIO;
      require Apache2::Const;
      require APR::Table;  ## This line seems to fail..
      Apache2::Const->import(-compile => 'OK');
      $MOD_PERL_VERSION = 2;
      print "!!MOD PERL VERSION DEFINED!!";
      last MOD_PERL;
    };
if ($MOD_PERL_VERSION == 2) {
  print "ZWEI";

}

there i get the error message as follows:

Can't load
'/usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi/auto/APR/Table/Table.so'
for module APR::Table: rtld: 0712-001 Symbol modperl_hash_tied_object was
referenced
      from module
/usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi/auto/APR/Table/Table.so(),
but a runtime definition
      of the symbol was not found.
rtld: 0712-001 Symbol modperl_hash_tied_object_rv was referenced
      from module
/usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi/auto/APR/Table/Table.so(),
but a runtime definition
      of the symbol was not found.
rtld: 0712-001 Symbol modperl_hash_tie was referenced
      from module
/usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi/auto/APR/Table/Table.so(),
but a runtime definition
      of the symbol was not found. at
/usr/opt/perl5/lib/5.8.2/aix-thread-multi/XSLoader.pm line 68.
 at /usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi/APR/XSLoader.pm line
30
Compilation failed in require at t/blah.pl line 8.

When i understood the documentation right, APR comes from modperl...

I've compiled mod_perl, the error log shows just harmless errors, RequestRec
is there... though, something goes wrong with Apache2::SOAP or modperl...
and i don't have any idea anymore.

Do you have any suggestion what i could do?

Thanks,
Georg Grabler

Re: Problem with Apache 2.2.2 / modperl 2.0.2 and Apache2::SOAP

Posted by Georg Grabler <gg...@gmail.com>.
A the logfile says, i execute the method using Apache2.

For a better understanding:

  my $cl = ($self->{'MOD_PERL_VERSION'} == 1) ?
    $r->header_in('Content-length') : $r->headers_in->{'Content-length'};

This is the code Apache2::SOAP module uses for determining the version of
modperl.
The $self->{'MOD_PERL_VERSION'} gets set in the new method, where the code
seems to fail at all.. so the version is never set to two.

codepiece cut from Apache2::SOAP:
sub new {
  my $self = shift;
  unless (ref $self) {
    my $class = ref($self) || $self;
    $self = $class->SUPER::new(@_);
    SOAP::Trace::objects('()');
  }
 MOD_PERL: {
    (eval { require Apache;} ) and do {
       require Apache::Constants;
       Apache::Constants->import('OK');
       $self->{'MOD_PERL_VERSION'} = 1;
       last MOD_PERL;
     };

    (eval { require Apache2::RequestRec;} ) and do {
      require Apache2::RequestUtil;
      require Apache2::RequestIO;
      require Apache2::Const;
      require APR::Table;
      Apache2::Const->import(-compile => 'OK');
      $self->{'MOD_PERL_VERSION'} = 2;

      print "!!MOD PERL VERSION DEFINED!!";
      last MOD_PERL;
    };
    die "Unsupported version of mod_perl";
  }
  return $self;
}

I've found some quite interesting postings at
http://www.gossamer-threads.com/lists/modperl/dev/9637
though, dont know what to dow now at all, is it a  bug at modperl or just a
configuration bug?

Hopefully the 2nd one.

Sorry for the 2nd reply tom, missclicked and havn't had the list in CC

Thank you,
Georg


On 8/2/06, Tom Schindl <li...@bestsolution.at> wrote:
>
> Georg Grabler schrieb:
> > I'm experiencing Problems with the setting written above.
> >
> > Currently, i'm running the configuration as written in the header.
> >
> > The apache config (by doing make test) outputs the following:
> >
> >
> > [Wed Aug 02 10:15:10 2006] [notice] Apache/2.2.2 (Unix) mod_perl/2.0.2
> > Perl/v5.8.2 configured -- resuming normal operations
> > [Wed Aug 02 10:15:10 2006] [info] Server built: Jul  5 2006 10:11:34
> > [Wed Aug 02 10:15:10 2006] [debug] prefork.c(991): AcceptMutex: sysvsem
> > (default: sysvsem)
> > [Wed Aug 02 10:15:15 2006] [error] [client 127.0.0.1 <http://127.0.0.1>]
> > Can't locate object method "header_in" via package "Apache2::RequestRec"
> > at /home/ggrabler/Apache2-SOAP-0.71/blib/lib/SOAP/Transport/HTTP2.pm
> > line 96.\n
>
> Well you are true the method is misspelled.
> http://perl.apache.org/docs/2.0/api/Apache2/RequestRec.html#C_headers_in_
>
> > [Wed Aug 02 10:15:16 2006] [error] [client 127.0.0.1 <http://127.0.0.1>]
> > Can't locate object method "header_in" via package "Apache2::RequestRec"
> > at /home/ggrabler/Apache2- SOAP-0.71/blib/lib/SOAP/Transport/HTTP2.pm
> > line 96.\n
> > [Wed Aug 02 10:15:16 2006] [info] removed PID file
> > /home/ggrabler/Apache2- SOAP-0.71/t/logs/httpd.pid (pid=52148)
> > [Wed Aug 02 10:15:16 2006] [notice] caught SIGTERM, shutting down
> >
> >
> > Well, if i force the install i also get this error on my main server
> > configuration ;). To ensure it's not a problem with AIX compiler
> > (vac/cc_r), i set up the whole configuration as well using ARCH Linux,
> > with the same result.
> >
> > Since i wanted to solve the problem myself, i looked up the code of the
> > HTTP2.pm. It seems as if it's mod_perl which cuases those troubles,
> > though, as we can see i've got the latest mod_perl installed.
> >
> > The sub new also did show me that the MOD_PERL_VERSION is manually set,
> > by determining if Apache2::RequestRec is loading... what doesn't seem to
> > happen.
> >
> > Therefore MOD_PERL_VERSION is set to 1, and i get this error as if i was
> > using mod_perl version 1.
> >
> > If i manually set the MOD_PERL_VERSION to 2 in the HTTP2.pm, it works ..
> > not properly though.
> >
> > I wrote a small testfile, what does the following:
> >
> > require Apache2::RequestRec;
> >
> >
> > (eval { require Apache2::RequestRec;} ) and do {
> >       require Apache2::RequestUtil;
> >       require Apache2::RequestIO;
> >       require Apache2::Const;
> >       require APR::Table;  ## This line seems to fail..
> >       Apache2::Const->import(-compile => 'OK');
> >       $MOD_PERL_VERSION = 2;
> >       print "!!MOD PERL VERSION DEFINED!!";
> >       last MOD_PERL;
> >     };
> > if ($MOD_PERL_VERSION == 2) {
> >   print "ZWEI";
> >
> > }
> >
>
> Where do you execute this script? in the shell that's not possible.
>
> Tom
>

Re: Problem with Apache 2.2.2 / modperl 2.0.2 and Apache2::SOAP

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Wed, 2 Aug 2006, Tom Schindl wrote:

> Georg Grabler schrieb:
>> A the logfile says, i execute the method using Apache2.
[ .. ]
> Do you have mp1 and mp2 installed in the same perl-tree.
>
> If yes then it's clear why you always get to
> "$self->{'MOD_PERL_VERSION'} = 1;". To distinguish if running in mp1 or
> mp2 a module should use totally different code.
>
> if (exists $ENV{MOD_PERL_API_VERSION} && $ENV{MOD_PERL_API_VERSION} == 2) {
> require Apache2::Response;
> require Apache2::RequestRec;
> require Apache2::RequestUtil;
> require Apache2::RequestIO;
> // ...
> } else {
> require Apache;
> // ...
> }
>
> I'd advice the Apache2::SOAP maintainer that he will get into trouble
> when mp1 and mp2 are installed in the same tree.

Thanks, Tom! I'll incorporate that change and upload a
new Apache2-SOAP version in the next couple of days.

-- 
best regards,
Randy

Re: Problem with Apache 2.2.2 / modperl 2.0.2 and Apache2::SOAP

Posted by Tom Schindl <li...@bestsolution.at>.
Hi,

Just read your bug report and could swear the test suite fails because
you haven't patched the original module but the one you have already
installed in your /usr/perl5/lib/... when running "make test" the module
in the downloaded distro is used and not the one already installed (and
patched).

Tom


Georg Grabler schrieb:
> Followed your advice, i filed a bug report.
> 
> Georg
> 
> On 8/2/06, *Tom Schindl* <listom@bestsolution.at
> <ma...@bestsolution.at>> wrote:
> 
>     Would you mind filing a bug against Apache2::SOAP. Then Randy may fix
>     his dirty hack to determine MP2-Version ;-)
> 
>     http://rt.cpan.org/Public/Dist/Display.html?Name=Apache2-SOAP
> 
>     Tom
> 
>     Georg Grabler schrieb:
>     > Well, i kicked out the old code which seemed to be buggy of
>     > Apache2::SOAP, and used the codepiece you gave me to determine which
>     > modperl version i'm using.
>     >
>     > What shall i say, except thank you very much, Tom. It works perfectly
>     > now, and all the day searching for a mistake i did in my server
>     > configuration now ended up in a as it seems a bugfix for a bug in
>     a module.
>     >
>     > Thank you for your time, and the help you provided me, and hopefully
>     > others, when they're reading the archives.
>     > Georg
>     >
>     > On 8/2/06, *Tom Schindl* <listom@bestsolution.at
>     <ma...@bestsolution.at>
>     > <mailto:listom@bestsolution.at <ma...@bestsolution.at>>>
>     wrote:
>     >
>     >     Georg Grabler schrieb:
>     >     > A the logfile says, i execute the method using Apache2.
>     >     >
>     >     > For a better understanding:
>     >     >
>     >     >   my $cl = ($self->{'MOD_PERL_VERSION'} == 1) ?
>     >     >     $r->header_in('Content-length') :
>     >     $r->headers_in->{'Content-length'};
>     >     >
>     >     > This is the code Apache2::SOAP module uses for determining
>     the version
>     >     > of modperl.
>     >     > The $self->{'MOD_PERL_VERSION'} gets set in the new method,
>     where the
>     >     > code seems to fail at all.. so the version is never set to two.
>     >     >
>     >     > codepiece cut from Apache2::SOAP:
>     >     > sub new {
>     >     >   my $self = shift;
>     >     >   unless (ref $self) {
>     >     >     my $class = ref($self) || $self;
>     >     >     $self = $class->SUPER::new(@_);
>     >     >     SOAP::Trace::objects('()');
>     >     >   }
>     >     >  MOD_PERL: {
>     >     >     (eval { require Apache;} ) and do {
>     >     >        require Apache::Constants;
>     >     >        Apache::Constants->import('OK');
>     >     >        $self->{'MOD_PERL_VERSION'} = 1;
>     >     >        last MOD_PERL;
>     >     >      };
>     >     >     (eval { require Apache2::RequestRec;} ) and do {
>     >     >       require Apache2::RequestUtil;
>     >     >       require Apache2::RequestIO;
>     >     >       require Apache2::Const;
>     >     >       require APR::Table;
>     >     >       Apache2::Const->import(-compile => 'OK');
>     >     >       $self->{'MOD_PERL_VERSION'} = 2;
>     >     >       print "!!MOD PERL VERSION DEFINED!!";
>     >     >       last MOD_PERL;
>     >     >     };
>     >     >     die "Unsupported version of mod_perl";
>     >     >   }
>     >     >   return $self;
>     >     > }
>     >
>     >     Do you have mp1 and mp2 installed in the same perl-tree.
>     >
>     >     If yes then it's clear why you always get to
>     >     "$self->{'MOD_PERL_VERSION'} = 1;". To distinguish if running
>     in mp1 or
>     >     mp2 a module should use totally different code.
>     >
>     >     if (exists $ENV{MOD_PERL_API_VERSION} &&
>     $ENV{MOD_PERL_API_VERSION}
>     >     == 2) {
>     >     require Apache2::Response;
>     >     require Apache2::RequestRec;
>     >     require Apache2::RequestUtil;
>     >     require Apache2::RequestIO;
>     >     // ...
>     >     } else {
>     >     require Apache;
>     >     // ...
>     >     }
>     >
>     >     I'd advice the Apache2::SOAP maintainer that he will get into
>     trouble
>     >     when mp1 and mp2 are installed in the same tree.
>     >
>     >     Tom
>     >
>     >
> 
> 


Re: Problem with Apache 2.2.2 / modperl 2.0.2 and Apache2::SOAP

Posted by Georg Grabler <gg...@gmail.com>.
Nope, i always just played around in the original module, installing it over
and over again with make install.
So i've been testing the patched lib.

Strange by the way is that the error throwing means he can't find the
function modperl2 provides, not modperl1 (!)...

Though i'll wait for the release of Randy, and hopefully the testsuite won't
fail anymore then ;).
Maybe it's something else i havn't thought about... it's my 4th week around
in perl (just experienced in c++)... so be patient.

Thank you for your comment Randy, hope you get around fixing this soon.

Best regards,
Georg

On 8/2/06, Tom Schindl <to...@gmx.at> wrote:
>
> Hi,
>
> Just read your bug report and could swear the test suite fails because
> you haven't patched the original module but the one you have already
> installed in your /usr/perl5/lib/... when running "make test" the module
> in the downloaded distro is used and not the one already installed (and
> patched).
>
> Tom
>
>
> Georg Grabler schrieb:
> > Followed your advice, i filed a bug report.
> >
> > Georg
> >
> > On 8/2/06, *Tom Schindl* <listom@bestsolution.at
> > <ma...@bestsolution.at>> wrote:
> >
> >     Would you mind filing a bug against Apache2::SOAP. Then Randy may
> fix
> >     his dirty hack to determine MP2-Version ;-)
> >
> >     http://rt.cpan.org/Public/Dist/Display.html?Name=Apache2-SOAP
> >
> >     Tom
> >
> >     Georg Grabler schrieb:
> >     > Well, i kicked out the old code which seemed to be buggy of
> >     > Apache2::SOAP, and used the codepiece you gave me to determine
> which
> >     > modperl version i'm using.
> >     >
> >     > What shall i say, except thank you very much, Tom. It works
> perfectly
> >     > now, and all the day searching for a mistake i did in my server
> >     > configuration now ended up in a as it seems a bugfix for a bug in
> >     a module.
> >     >
> >     > Thank you for your time, and the help you provided me, and
> hopefully
> >     > others, when they're reading the archives.
> >     > Georg
> >     >
> >     > On 8/2/06, *Tom Schindl* <listom@bestsolution.at
> >     <ma...@bestsolution.at>
> >     > <mailto:listom@bestsolution.at <ma...@bestsolution.at>>>
> >     wrote:
> >     >
> >     >     Georg Grabler schrieb:
> >     >     > A the logfile says, i execute the method using Apache2.
> >     >     >
> >     >     > For a better understanding:
> >     >     >
> >     >     >   my $cl = ($self->{'MOD_PERL_VERSION'} == 1) ?
> >     >     >     $r->header_in('Content-length') :
> >     >     $r->headers_in->{'Content-length'};
> >     >     >
> >     >     > This is the code Apache2::SOAP module uses for determining
> >     the version
> >     >     > of modperl.
> >     >     > The $self->{'MOD_PERL_VERSION'} gets set in the new method,
> >     where the
> >     >     > code seems to fail at all.. so the version is never set to
> two.
> >     >     >
> >     >     > codepiece cut from Apache2::SOAP:
> >     >     > sub new {
> >     >     >   my $self = shift;
> >     >     >   unless (ref $self) {
> >     >     >     my $class = ref($self) || $self;
> >     >     >     $self = $class->SUPER::new(@_);
> >     >     >     SOAP::Trace::objects('()');
> >     >     >   }
> >     >     >  MOD_PERL: {
> >     >     >     (eval { require Apache;} ) and do {
> >     >     >        require Apache::Constants;
> >     >     >        Apache::Constants->import('OK');
> >     >     >        $self->{'MOD_PERL_VERSION'} = 1;
> >     >     >        last MOD_PERL;
> >     >     >      };
> >     >     >     (eval { require Apache2::RequestRec;} ) and do {
> >     >     >       require Apache2::RequestUtil;
> >     >     >       require Apache2::RequestIO;
> >     >     >       require Apache2::Const;
> >     >     >       require APR::Table;
> >     >     >       Apache2::Const->import(-compile => 'OK');
> >     >     >       $self->{'MOD_PERL_VERSION'} = 2;
> >     >     >       print "!!MOD PERL VERSION DEFINED!!";
> >     >     >       last MOD_PERL;
> >     >     >     };
> >     >     >     die "Unsupported version of mod_perl";
> >     >     >   }
> >     >     >   return $self;
> >     >     > }
> >     >
> >     >     Do you have mp1 and mp2 installed in the same perl-tree.
> >     >
> >     >     If yes then it's clear why you always get to
> >     >     "$self->{'MOD_PERL_VERSION'} = 1;". To distinguish if running
> >     in mp1 or
> >     >     mp2 a module should use totally different code.
> >     >
> >     >     if (exists $ENV{MOD_PERL_API_VERSION} &&
> >     $ENV{MOD_PERL_API_VERSION}
> >     >     == 2) {
> >     >     require Apache2::Response;
> >     >     require Apache2::RequestRec;
> >     >     require Apache2::RequestUtil;
> >     >     require Apache2::RequestIO;
> >     >     // ...
> >     >     } else {
> >     >     require Apache;
> >     >     // ...
> >     >     }
> >     >
> >     >     I'd advice the Apache2::SOAP maintainer that he will get into
> >     trouble
> >     >     when mp1 and mp2 are installed in the same tree.
> >     >
> >     >     Tom
> >     >
> >     >
> >
> >
>
>
>
>
>

Re: Problem with Apache 2.2.2 / modperl 2.0.2 and Apache2::SOAP

Posted by Georg Grabler <gg...@gmail.com>.
Followed your advice, i filed a bug report.

Georg

On 8/2/06, Tom Schindl <li...@bestsolution.at> wrote:
>
> Would you mind filing a bug against Apache2::SOAP. Then Randy may fix
> his dirty hack to determine MP2-Version ;-)
>
> http://rt.cpan.org/Public/Dist/Display.html?Name=Apache2-SOAP
>
> Tom
>
> Georg Grabler schrieb:
> > Well, i kicked out the old code which seemed to be buggy of
> > Apache2::SOAP, and used the codepiece you gave me to determine which
> > modperl version i'm using.
> >
> > What shall i say, except thank you very much, Tom. It works perfectly
> > now, and all the day searching for a mistake i did in my server
> > configuration now ended up in a as it seems a bugfix for a bug in a
> module.
> >
> > Thank you for your time, and the help you provided me, and hopefully
> > others, when they're reading the archives.
> > Georg
> >
> > On 8/2/06, *Tom Schindl* <listom@bestsolution.at
> > <ma...@bestsolution.at>> wrote:
> >
> >     Georg Grabler schrieb:
> >     > A the logfile says, i execute the method using Apache2.
> >     >
> >     > For a better understanding:
> >     >
> >     >   my $cl = ($self->{'MOD_PERL_VERSION'} == 1) ?
> >     >     $r->header_in('Content-length') :
> >     $r->headers_in->{'Content-length'};
> >     >
> >     > This is the code Apache2::SOAP module uses for determining the
> version
> >     > of modperl.
> >     > The $self->{'MOD_PERL_VERSION'} gets set in the new method, where
> the
> >     > code seems to fail at all.. so the version is never set to two.
> >     >
> >     > codepiece cut from Apache2::SOAP:
> >     > sub new {
> >     >   my $self = shift;
> >     >   unless (ref $self) {
> >     >     my $class = ref($self) || $self;
> >     >     $self = $class->SUPER::new(@_);
> >     >     SOAP::Trace::objects('()');
> >     >   }
> >     >  MOD_PERL: {
> >     >     (eval { require Apache;} ) and do {
> >     >        require Apache::Constants;
> >     >        Apache::Constants->import('OK');
> >     >        $self->{'MOD_PERL_VERSION'} = 1;
> >     >        last MOD_PERL;
> >     >      };
> >     >     (eval { require Apache2::RequestRec;} ) and do {
> >     >       require Apache2::RequestUtil;
> >     >       require Apache2::RequestIO;
> >     >       require Apache2::Const;
> >     >       require APR::Table;
> >     >       Apache2::Const->import(-compile => 'OK');
> >     >       $self->{'MOD_PERL_VERSION'} = 2;
> >     >       print "!!MOD PERL VERSION DEFINED!!";
> >     >       last MOD_PERL;
> >     >     };
> >     >     die "Unsupported version of mod_perl";
> >     >   }
> >     >   return $self;
> >     > }
> >
> >     Do you have mp1 and mp2 installed in the same perl-tree.
> >
> >     If yes then it's clear why you always get to
> >     "$self->{'MOD_PERL_VERSION'} = 1;". To distinguish if running in mp1
> or
> >     mp2 a module should use totally different code.
> >
> >     if (exists $ENV{MOD_PERL_API_VERSION} && $ENV{MOD_PERL_API_VERSION}
> >     == 2) {
> >     require Apache2::Response;
> >     require Apache2::RequestRec;
> >     require Apache2::RequestUtil;
> >     require Apache2::RequestIO;
> >     // ...
> >     } else {
> >     require Apache;
> >     // ...
> >     }
> >
> >     I'd advice the Apache2::SOAP maintainer that he will get into
> trouble
> >     when mp1 and mp2 are installed in the same tree.
> >
> >     Tom
> >
> >
>
>

Re: Problem with Apache 2.2.2 / modperl 2.0.2 and Apache2::SOAP

Posted by Tom Schindl <li...@bestsolution.at>.
Would you mind filing a bug against Apache2::SOAP. Then Randy may fix
his dirty hack to determine MP2-Version ;-)

http://rt.cpan.org/Public/Dist/Display.html?Name=Apache2-SOAP

Tom

Georg Grabler schrieb:
> Well, i kicked out the old code which seemed to be buggy of
> Apache2::SOAP, and used the codepiece you gave me to determine which
> modperl version i'm using.
> 
> What shall i say, except thank you very much, Tom. It works perfectly
> now, and all the day searching for a mistake i did in my server
> configuration now ended up in a as it seems a bugfix for a bug in a module.
> 
> Thank you for your time, and the help you provided me, and hopefully
> others, when they're reading the archives.
> Georg
> 
> On 8/2/06, *Tom Schindl* <listom@bestsolution.at
> <ma...@bestsolution.at>> wrote:
> 
>     Georg Grabler schrieb:
>     > A the logfile says, i execute the method using Apache2.
>     >
>     > For a better understanding:
>     >
>     >   my $cl = ($self->{'MOD_PERL_VERSION'} == 1) ?
>     >     $r->header_in('Content-length') :
>     $r->headers_in->{'Content-length'};
>     >
>     > This is the code Apache2::SOAP module uses for determining the version
>     > of modperl.
>     > The $self->{'MOD_PERL_VERSION'} gets set in the new method, where the
>     > code seems to fail at all.. so the version is never set to two.
>     >
>     > codepiece cut from Apache2::SOAP:
>     > sub new {
>     >   my $self = shift;
>     >   unless (ref $self) {
>     >     my $class = ref($self) || $self;
>     >     $self = $class->SUPER::new(@_);
>     >     SOAP::Trace::objects('()');
>     >   }
>     >  MOD_PERL: {
>     >     (eval { require Apache;} ) and do {
>     >        require Apache::Constants;
>     >        Apache::Constants->import('OK');
>     >        $self->{'MOD_PERL_VERSION'} = 1;
>     >        last MOD_PERL;
>     >      };
>     >     (eval { require Apache2::RequestRec;} ) and do {
>     >       require Apache2::RequestUtil;
>     >       require Apache2::RequestIO;
>     >       require Apache2::Const;
>     >       require APR::Table;
>     >       Apache2::Const->import(-compile => 'OK');
>     >       $self->{'MOD_PERL_VERSION'} = 2;
>     >       print "!!MOD PERL VERSION DEFINED!!";
>     >       last MOD_PERL;
>     >     };
>     >     die "Unsupported version of mod_perl";
>     >   }
>     >   return $self;
>     > }
> 
>     Do you have mp1 and mp2 installed in the same perl-tree.
> 
>     If yes then it's clear why you always get to
>     "$self->{'MOD_PERL_VERSION'} = 1;". To distinguish if running in mp1 or
>     mp2 a module should use totally different code.
> 
>     if (exists $ENV{MOD_PERL_API_VERSION} && $ENV{MOD_PERL_API_VERSION}
>     == 2) {
>     require Apache2::Response;
>     require Apache2::RequestRec;
>     require Apache2::RequestUtil;
>     require Apache2::RequestIO;
>     // ...
>     } else {
>     require Apache;
>     // ...
>     }
> 
>     I'd advice the Apache2::SOAP maintainer that he will get into trouble
>     when mp1 and mp2 are installed in the same tree.
> 
>     Tom
> 
> 


Re: Problem with Apache 2.2.2 / modperl 2.0.2 and Apache2::SOAP

Posted by Georg Grabler <gg...@gmail.com>.
Well, i kicked out the old code which seemed to be buggy of Apache2::SOAP,
and used the codepiece you gave me to determine which modperl version i'm
using.

What shall i say, except thank you very much, Tom. It works perfectly now,
and all the day searching for a mistake i did in my server configuration now
ended up in a as it seems a bugfix for a bug in a module.

Thank you for your time, and the help you provided me, and hopefully others,
when they're reading the archives.
Georg

On 8/2/06, Tom Schindl <li...@bestsolution.at> wrote:
>
> Georg Grabler schrieb:
> > A the logfile says, i execute the method using Apache2.
> >
> > For a better understanding:
> >
> >   my $cl = ($self->{'MOD_PERL_VERSION'} == 1) ?
> >     $r->header_in('Content-length') :
> $r->headers_in->{'Content-length'};
> >
> > This is the code Apache2::SOAP module uses for determining the version
> > of modperl.
> > The $self->{'MOD_PERL_VERSION'} gets set in the new method, where the
> > code seems to fail at all.. so the version is never set to two.
> >
> > codepiece cut from Apache2::SOAP:
> > sub new {
> >   my $self = shift;
> >   unless (ref $self) {
> >     my $class = ref($self) || $self;
> >     $self = $class->SUPER::new(@_);
> >     SOAP::Trace::objects('()');
> >   }
> >  MOD_PERL: {
> >     (eval { require Apache;} ) and do {
> >        require Apache::Constants;
> >        Apache::Constants->import('OK');
> >        $self->{'MOD_PERL_VERSION'} = 1;
> >        last MOD_PERL;
> >      };
> >     (eval { require Apache2::RequestRec;} ) and do {
> >       require Apache2::RequestUtil;
> >       require Apache2::RequestIO;
> >       require Apache2::Const;
> >       require APR::Table;
> >       Apache2::Const->import(-compile => 'OK');
> >       $self->{'MOD_PERL_VERSION'} = 2;
> >       print "!!MOD PERL VERSION DEFINED!!";
> >       last MOD_PERL;
> >     };
> >     die "Unsupported version of mod_perl";
> >   }
> >   return $self;
> > }
>
> Do you have mp1 and mp2 installed in the same perl-tree.
>
> If yes then it's clear why you always get to
> "$self->{'MOD_PERL_VERSION'} = 1;". To distinguish if running in mp1 or
> mp2 a module should use totally different code.
>
> if (exists $ENV{MOD_PERL_API_VERSION} && $ENV{MOD_PERL_API_VERSION} == 2)
> {
> require Apache2::Response;
> require Apache2::RequestRec;
> require Apache2::RequestUtil;
> require Apache2::RequestIO;
> // ...
> } else {
> require Apache;
> // ...
> }
>
> I'd advice the Apache2::SOAP maintainer that he will get into trouble
> when mp1 and mp2 are installed in the same tree.
>
> Tom
>

Re: Problem with Apache 2.2.2 / modperl 2.0.2 and Apache2::SOAP

Posted by Tom Schindl <li...@bestsolution.at>.
Georg Grabler schrieb:
> A the logfile says, i execute the method using Apache2.
> 
> For a better understanding:
> 
>   my $cl = ($self->{'MOD_PERL_VERSION'} == 1) ?
>     $r->header_in('Content-length') : $r->headers_in->{'Content-length'};
> 
> This is the code Apache2::SOAP module uses for determining the version
> of modperl.
> The $self->{'MOD_PERL_VERSION'} gets set in the new method, where the
> code seems to fail at all.. so the version is never set to two.
> 
> codepiece cut from Apache2::SOAP:
> sub new {
>   my $self = shift;
>   unless (ref $self) {
>     my $class = ref($self) || $self;
>     $self = $class->SUPER::new(@_);
>     SOAP::Trace::objects('()');
>   }
>  MOD_PERL: {
>     (eval { require Apache;} ) and do {
>        require Apache::Constants;
>        Apache::Constants->import('OK');
>        $self->{'MOD_PERL_VERSION'} = 1;
>        last MOD_PERL;
>      };
>     (eval { require Apache2::RequestRec;} ) and do {
>       require Apache2::RequestUtil;
>       require Apache2::RequestIO;
>       require Apache2::Const;
>       require APR::Table;
>       Apache2::Const->import(-compile => 'OK');
>       $self->{'MOD_PERL_VERSION'} = 2;
>       print "!!MOD PERL VERSION DEFINED!!";
>       last MOD_PERL;
>     };
>     die "Unsupported version of mod_perl";
>   }
>   return $self;
> }

Do you have mp1 and mp2 installed in the same perl-tree.

If yes then it's clear why you always get to
"$self->{'MOD_PERL_VERSION'} = 1;". To distinguish if running in mp1 or
mp2 a module should use totally different code.

if (exists $ENV{MOD_PERL_API_VERSION} && $ENV{MOD_PERL_API_VERSION} == 2) {
require Apache2::Response;
require Apache2::RequestRec;
require Apache2::RequestUtil;
require Apache2::RequestIO;
// ...
} else {
require Apache;
// ...
}

I'd advice the Apache2::SOAP maintainer that he will get into trouble
when mp1 and mp2 are installed in the same tree.

Tom

Re: Problem with Apache 2.2.2 / modperl 2.0.2 and Apache2::SOAP

Posted by Tom Schindl <li...@bestsolution.at>.
Georg Grabler schrieb:
> I'm experiencing Problems with the setting written above.
> 
> Currently, i'm running the configuration as written in the header.
> 
> The apache config (by doing make test) outputs the following:
> 
> 
> [Wed Aug 02 10:15:10 2006] [notice] Apache/2.2.2 (Unix) mod_perl/2.0.2
> Perl/v5.8.2 configured -- resuming normal operations
> [Wed Aug 02 10:15:10 2006] [info] Server built: Jul  5 2006 10:11:34
> [Wed Aug 02 10:15:10 2006] [debug] prefork.c(991): AcceptMutex: sysvsem
> (default: sysvsem)
> [Wed Aug 02 10:15:15 2006] [error] [client 127.0.0.1 <http://127.0.0.1>]
> Can't locate object method "header_in" via package "Apache2::RequestRec"
> at /home/ggrabler/Apache2-SOAP-0.71/blib/lib/SOAP/Transport/HTTP2.pm
> line 96.\n

Well you are true the method is misspelled.
http://perl.apache.org/docs/2.0/api/Apache2/RequestRec.html#C_headers_in_

> [Wed Aug 02 10:15:16 2006] [error] [client 127.0.0.1 <http://127.0.0.1>]
> Can't locate object method "header_in" via package "Apache2::RequestRec"
> at /home/ggrabler/Apache2- SOAP-0.71/blib/lib/SOAP/Transport/HTTP2.pm
> line 96.\n
> [Wed Aug 02 10:15:16 2006] [info] removed PID file
> /home/ggrabler/Apache2- SOAP-0.71/t/logs/httpd.pid (pid=52148)
> [Wed Aug 02 10:15:16 2006] [notice] caught SIGTERM, shutting down
> 
> 
> Well, if i force the install i also get this error on my main server
> configuration ;). To ensure it's not a problem with AIX compiler
> (vac/cc_r), i set up the whole configuration as well using ARCH Linux,
> with the same result.
> 
> Since i wanted to solve the problem myself, i looked up the code of the
> HTTP2.pm. It seems as if it's mod_perl which cuases those troubles,
> though, as we can see i've got the latest mod_perl installed.
> 
> The sub new also did show me that the MOD_PERL_VERSION is manually set,
> by determining if Apache2::RequestRec is loading... what doesn't seem to
> happen.
> 
> Therefore MOD_PERL_VERSION is set to 1, and i get this error as if i was
> using mod_perl version 1.
> 
> If i manually set the MOD_PERL_VERSION to 2 in the HTTP2.pm, it works ..
> not properly though.
> 
> I wrote a small testfile, what does the following:
> 
> require Apache2::RequestRec;
> 
> 
> (eval { require Apache2::RequestRec;} ) and do {
>       require Apache2::RequestUtil;
>       require Apache2::RequestIO;
>       require Apache2::Const;
>       require APR::Table;  ## This line seems to fail..
>       Apache2::Const->import(-compile => 'OK');
>       $MOD_PERL_VERSION = 2;
>       print "!!MOD PERL VERSION DEFINED!!";
>       last MOD_PERL;
>     };
> if ($MOD_PERL_VERSION == 2) {
>   print "ZWEI";
> 
> }
> 

Where do you execute this script? in the shell that's not possible.

Tom