You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-dev@perl.apache.org by "Christopher H. Laco" <cl...@chrislaco.com> on 2005/10/11 02:13:36 UTC

cannont find module errors

Now that I have Apache::Test 1.26, Apache1/MP 1.29/Apache2/MP 2.0.2
running on my laptop, I've run into a strange problem with need().

Up until now, this test has worked on my win32 install:

http://handelframework.com/source/trunk/t/xsp_cart.t


More specifically, this line:

> Apache::Test::plan(tests => ((scalar @tests * 2) + 3),
>     need('AxKit', 'mod_perl', need_apache(1), need_lwp())
> );


This now fails under my Apache1/MP1 install with:

> t/xsp_cart................................skipped
>         all skipped: cannot find module 'AxKit'


Now, for the strange part. I have AxKit installed:

> claco@np5660:~/CPAN/Handel$ perl -MAxKit -e 'print AxKit->VERSION;'
> 1.62

And I've confirmaed, that when the test suite is running under
APACHE_TEST_HTTPD=/usr/sbin/apache, mod_perl and AxKit is loaded using
my extra.conf.in
(http://handelframework.com/source/trunk/t/conf/extra.conf.in):


> Server Version: Apache/1.3.33 (Debian GNU/Linux) AxKit/1.62 mod_perl/1.29
> Server Built: Sep 6 2005 13:17:01
> API Version: 19990320:16
> Run Mode: standalone
> User/Group: claco(1000)/1000
> Hostname/port: localhost.localdomain:8529

So, the real question is, why isn't need seeing that the
module is indeed available?

I'm still digging on it... any ideas?

-=Chris


Re: cannont find module errors

Posted by "Christopher H. Laco" <cl...@chrislaco.com>.
Christopher H. Laco wrote:
> Christopher H. Laco wrote:
> [snip]
> 
> I wonder, and this is only a wonder at this point, if there is something
> somewhere in A-T that is loading mod_perl2 along the way, befure it
> knows it's using Apache (APACHE_TEST_HTTPD=/usr/sbin/apache)...then whtn
> it tries to load AxKit, which loads Apache::Constants, that it goes boom
> due to the conflict...

I forgot to add that that theory is base don the fact that my
/usr/sbin/apache2;/usr/bin/apxs2 is the default used in Apache-Test.

-=Chris

Re: cannont find module errors

Posted by "Christopher H. Laco" <cl...@chrislaco.com>.
Christopher H. Laco wrote:
[snip]

I wonder, and this is only a wonder at this point, if there is something
somewhere in A-T that is loading mod_perl2 along the way, befure it
knows it's using Apache (APACHE_TEST_HTTPD=/usr/sbin/apache)...then whtn
it tries to load AxKit, which loads Apache::Constants, that it goes boom
due to the conflict...

Re: cannont find module errors

Posted by "Christopher H. Laco" <cl...@chrislaco.com>.
Geoffrey Young wrote:
>>>>t/xsp_cart................................AxKit at /usr/local/lib/perl/5.8.4/Apache/Test.pm line 297.
>>>>Can't locate object method "boot" via package "mod_perl" at /usr/lib/perl5/Apache/Constants.pm line 8.
>>>>Compilation failed in require at /usr/lib/perl5/Apache.pm line 6.
>>>>BEGIN failed--compilation aborted at /usr/lib/perl5/Apache.pm line 6.
>>>>Compilation failed in require at /usr/lib/perl5/AxKit.pm line 9.
>>>>BEGIN failed--compilation aborted at /usr/lib/perl5/AxKit.pm line 9.
>>>>Compilation failed in require at (eval 19) line 3.
>>>
>>>
>>>-=Chris
>>>
>>>
>>
>>This doesn't make much sense to me. I know that the missing 'boot'
>>method error is caused by Apache::Constants not finding boot in the new
>>mod_perl2...but I can't understand how MP2 is getting involved in an the
>> t/ test files run of Apache::Test::need...
> 
> 
> ok, I understand what's going on here but I can't reproduce it like I ought
> to be able to...
> 
> basically the "boot" error is a very common one from people who try to run
> mod_perl outside of an apache environment, like when command-line testing a
> handler.  so, that you're seeing this error makes some bit of sense to me -
> you're loading AxKit outside of apache and it can't handle it.

But it that's the case, I wouldn't expect this to work...and it does:

$ perl -MAxKit -e 'printAxKit->VERSION;'
$ 1.62

or even:

$ perl -e 'use AxKit;'
$ perl -e 'require AxKit;'

This also happens outside of the confines of Apache, and are quite happy.

> 
> except that it used to work for you.  I'm assuming that you're talking about
> the same versions of everything, right?


Correct. need('AxKit') and the tests it's in work just fine on FreeBSD
and XP and the tests run. Both of those also have
Apache1/MP1/Apacher2/MP2 installed.

I could swear that I even saw it run once on my Ubuntu install.
I may start uninstalling anything Apache/Apache2/MP1/MP2 related and
start from scratch and see if there's a collision somewhere.

> 
> anyway, I don't know what to tell you here.  you might try looking for an
> AxKit package other than the main one that comes with AxKit by default,
> something that will successfully load.  Apache::AxKit::Provider maybe?  I
> dunno, I'm not an AxKit user...
> 
> also, on an unrelated note, note that
> 
>   need_module('mod_perl')
> 
> looks for mod_perl.pm in @INC due to the implementation of need_module.
> what you probably want is
> 
>   need_module('mod_perl.c')

Good point. Time for more tinkering!

> 
> which looks for mod_perl activated in httpd - just having mod_perl.pm on the
> server doesn't necessarily mean you've pointed to an apache install where
> mod_perl is active.  on the other hand, TestRunPerl will croak if there's no
> mod_perl.pm on the server, as will mod_perl.c...
> 
> HTH
> 
> --Geoff
> 
> 


On an unrelated note, I haven't heard anyting about my post on 2.0.2
test failures yet.

http://aspn.activestate.com/ASPN/Mail/Message/modperl/2849479

-=Chris

Re: cannont find module errors

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
>>>t/xsp_cart................................AxKit at /usr/local/lib/perl/5.8.4/Apache/Test.pm line 297.
>>>Can't locate object method "boot" via package "mod_perl" at /usr/lib/perl5/Apache/Constants.pm line 8.
>>>Compilation failed in require at /usr/lib/perl5/Apache.pm line 6.
>>>BEGIN failed--compilation aborted at /usr/lib/perl5/Apache.pm line 6.
>>>Compilation failed in require at /usr/lib/perl5/AxKit.pm line 9.
>>>BEGIN failed--compilation aborted at /usr/lib/perl5/AxKit.pm line 9.
>>>Compilation failed in require at (eval 19) line 3.
>>
>>
>>-=Chris
>>
>>
> 
> This doesn't make much sense to me. I know that the missing 'boot'
> method error is caused by Apache::Constants not finding boot in the new
> mod_perl2...but I can't understand how MP2 is getting involved in an the
>  t/ test files run of Apache::Test::need...

ok, I understand what's going on here but I can't reproduce it like I ought
to be able to...

basically the "boot" error is a very common one from people who try to run
mod_perl outside of an apache environment, like when command-line testing a
handler.  so, that you're seeing this error makes some bit of sense to me -
you're loading AxKit outside of apache and it can't handle it.

except that it used to work for you.  I'm assuming that you're talking about
the same versions of everything, right?

anyway, I don't know what to tell you here.  you might try looking for an
AxKit package other than the main one that comes with AxKit by default,
something that will successfully load.  Apache::AxKit::Provider maybe?  I
dunno, I'm not an AxKit user...

also, on an unrelated note, note that

  need_module('mod_perl')

looks for mod_perl.pm in @INC due to the implementation of need_module.
what you probably want is

  need_module('mod_perl.c')

which looks for mod_perl activated in httpd - just having mod_perl.pm on the
server doesn't necessarily mean you've pointed to an apache install where
mod_perl is active.  on the other hand, TestRunPerl will croak if there's no
mod_perl.pm on the server, as will mod_perl.c...

HTH

--Geoff

Re: cannont find module errors

Posted by "Christopher H. Laco" <cl...@chrislaco.com>.
Christopher H. Laco wrote:
> Geoffrey Young wrote:
> 
>>>I'm still digging on it... any ideas?
>>
>>
>>no ideas, but look for the
>>
>>  #print $@ if $@;
>>
>>around line 300 of lib/Apache/Test.pm.  you can uncomment it and run in
>>verbose mode to get an idea what the eval error is...
>>
>>--Geoff
>>
>>
> 
> 
> This can't be good...
> 
> 
>>t/xsp_cart................................AxKit at /usr/local/lib/perl/5.8.4/Apache/Test.pm line 297.
>>Can't locate object method "boot" via package "mod_perl" at /usr/lib/perl5/Apache/Constants.pm line 8.
>>Compilation failed in require at /usr/lib/perl5/Apache.pm line 6.
>>BEGIN failed--compilation aborted at /usr/lib/perl5/Apache.pm line 6.
>>Compilation failed in require at /usr/lib/perl5/AxKit.pm line 9.
>>BEGIN failed--compilation aborted at /usr/lib/perl5/AxKit.pm line 9.
>>Compilation failed in require at (eval 19) line 3.
> 
> 
> -=Chris
> 
> 
This doesn't make much sense to me. I know that the missing 'boot'
method error is caused by Apache::Constants not finding boot in the new
mod_perl2...but I can't understand how MP2 is getting involved in an the
 t/ test files run of Apache::Test::need...

Re: cannont find module errors

Posted by "Christopher H. Laco" <cl...@chrislaco.com>.
Geoffrey Young wrote:
>>I'm still digging on it... any ideas?
> 
> 
> no ideas, but look for the
> 
>   #print $@ if $@;
> 
> around line 300 of lib/Apache/Test.pm.  you can uncomment it and run in
> verbose mode to get an idea what the eval error is...
> 
> --Geoff
> 
> 

This can't be good...

> t/xsp_cart................................AxKit at /usr/local/lib/perl/5.8.4/Apache/Test.pm line 297.
> Can't locate object method "boot" via package "mod_perl" at /usr/lib/perl5/Apache/Constants.pm line 8.
> Compilation failed in require at /usr/lib/perl5/Apache.pm line 6.
> BEGIN failed--compilation aborted at /usr/lib/perl5/Apache.pm line 6.
> Compilation failed in require at /usr/lib/perl5/AxKit.pm line 9.
> BEGIN failed--compilation aborted at /usr/lib/perl5/AxKit.pm line 9.
> Compilation failed in require at (eval 19) line 3.

-=Chris

Re: cannont find module errors

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> I'm still digging on it... any ideas?

no ideas, but look for the

  #print $@ if $@;

around line 300 of lib/Apache/Test.pm.  you can uncomment it and run in
verbose mode to get an idea what the eval error is...

--Geoff