You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Aare Vesi <aa...@myrien.com> on 2004/01/04 09:47:37 UTC
RE: Can't locate object method "init" via package"Embperl::__2
Hi,
I'm still getting this error at random times.
In Embperl code at /usr/local/lib/perl/5.8.2/Embperl/Object.pm
it shows that it's used in EMBPERL_OBJECT_APP initalization.
How can I debug what is failing?
I added use strict; to EMBPERL_OBJECT_APP (application.pl) and
everything seems fine, but this error still occures.
application.pl
---
use strict;
sub init
{
my $self = shift ;
my $req = shift ;
$req->{apache} = $Embperl::req -> apache_req ;
# Hidden parameters in URI
my $uri = $req -> param -> uri ;
while ($uri =~ s/\.-(.*?)-(.*?)-\././g) { $fdat{$1} = $2 ; }
while ($uri =~ s/\.,(.*?),(.*?),\././g) { $fdat{$1} = $2 ; }
while ($uri =~ s/\._(.*?)_(.*?)_\././g) { $fdat{$1} = $2 ; }
# Remove hidden parameters from URI
$req -> param -> uri ($uri);
# removed any return [01.01.2004]
}
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: Can't locate object method "init" via package"Embperl::__2
Posted by Gerald Richter <ri...@ecos.de>.
>
> Now I have tracked down the problem to:
> Error in Perl code: Can't call method "apache_req" on an undefined
> value.
>
> This error appeares sometimes and is always gone after Apache
> restart. I don't have any code to reproduce it.
>
> Code line that error refs is:
> $req->{apache} = $req -> apache_req ;
I guess that is code inside your init function?
Is it possible, that the init function is called from somewhere else without
the parameters?
Maybe you try for debugging
use Carp ;
confess "init no req" if (!defined ($req)) ;
and maybe print out more context information, like the other parameters that
should be passed
Gerald
--------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
IT-Securitylösungen * dynamische Webapplikationen * Consulting
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 939-122
WWW: http://www.ecos.de/ Fax: +49 6133 939-333
--------------------------------------------------------------
|
| ECOS BB-5000 Firewall- und IT-Security Appliance: www.bb-5000.info
|
+-------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: Can't locate object method "init" via package"Embperl::__2
Posted by Aare Vesi <aa...@myrien.com>.
On Mon, 2004-01-05 at 11:01, Gerald Richter wrote:
> The first thing I would try is to set dbgObjectSearch in EMBPERL_DEBUG, this
> gives some information about what Embperl::Object is doing in the
> embperl.log file.
>
> Also it would be interesting if the error only occurs after a certain page
> is request or if there is some other thing that always happens before
Thanks for your help.
Now I have tracked down the problem to:
Error in Perl code: Can't call method "apache_req" on an undefined
value.
This error appeares sometimes and is always gone after Apache restart. I
don't have any code to reproduce it.
Code line that error refs is:
$req->{apache} = $req -> apache_req ;
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: Can't locate object method "init" via package"Embperl::__2
Posted by Gerald Richter <ri...@ecos.de>.
Aare Vesi wrote:
> Hi,
>
> I'm still getting this error at random times.
> In Embperl code at /usr/local/lib/perl/5.8.2/Embperl/Object.pm
> it shows that it's used in EMBPERL_OBJECT_APP initalization.
>
> How can I debug what is failing?
The first thing I would try is to set dbgObjectSearch in EMBPERL_DEBUG, this
gives some information about what Embperl::Object is doing in the
embperl.log file.
Also it would be interesting if the error only occurs after a certain page
is request or if there is some other thing that always happens before
Gerald
> I added use strict; to EMBPERL_OBJECT_APP (application.pl) and
> everything seems fine, but this error still occures.
>
> application.pl
> ---
> use strict;
>
> sub init
> {
>
> my $self = shift ;
> my $req = shift ;
>
> $req->{apache} = $Embperl::req -> apache_req ;
>
> # Hidden parameters in URI
> my $uri = $req -> param -> uri ;
> while ($uri =~ s/\.-(.*?)-(.*?)-\././g) { $fdat{$1} = $2 ; }
> while ($uri =~ s/\.,(.*?),(.*?),\././g) { $fdat{$1} = $2 ; }
> while ($uri =~ s/\._(.*?)_(.*?)_\././g) { $fdat{$1} = $2 ; }
>
> # Remove hidden parameters from URI
> $req -> param -> uri ($uri);
>
> # removed any return [01.01.2004]
>
> }
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
--------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
IT-Securitylösungen * dynamische Webapplikationen * Consulting
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 939-122
WWW: http://www.ecos.de/ Fax: +49 6133 939-333
--------------------------------------------------------------
|
| ECOS BB-5000 Firewall- und IT-Security Appliance: www.bb-5000.info
|
+-------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org