Hello,
We have a Mason application that has been running for 5 years. It was
installed on linux 2.2 kernel, mason 0.87, apache session 1.0x, Apache
1.3.34, modperl 1.25, mysql 3.2x, Perl 5.0.0.5
We are moving forward to a linux 2.6 kernel on a Gentoo box to support
the newer java 1.5. We have our java system up and running the
DBD::JDBC is functioning. We are struggling with moving the Mason
application.
We are trying to stay with Mason 0.87, so we don't rock the boat. We
have the same version of apache and modPerl. We have Mysql 4.1.14 and
Perl 5.8.8.
The problems seem to be with Mason/DBI and Tie . What follows is the
output of apache logs and after that is a subset of the mason handler.
Any insight in to how to solve this would be greatly appreicated.
Lach
[Thu Jun 29 13:41:50 2006] [warn] ENV SESSION_ID is : ""
[Thu Jun 29 13:41:50 2006] [warn] URI is /index_submit.html
[Thu Jun 29 13:41:50 2006] [warn] filename is
/www/BBj/htdocs/index_submit.html : 10.1.1.155
[Thu Jun 29 13:41:50 2006] [warn] calling session::DBI tie now on
06890565b3b5140a
[Thu Jun 29 13:41:50 2006] [warn] after tie call:
[Thu Jun 29 13:41:50 2006] [warn] done calling session::DBI tie now
[Thu Jun 29 13:41:50 2006] [warn] good session, now I should verify that
there isn't a url-session
[Thu Jun 29 13:41:50 2006] [warn] CATCH ALL: no session defined!
retrying...
[Thu Jun 29 13:41:50 2006] [warn] calling session::DBI tie now on
[Thu Jun 29 13:41:51 2006] [warn] after tie call:
[Thu Jun 29 13:41:51 2006] [warn] done calling session::DBI tie now
[Thu Jun 29 13:41:51 2006] [warn] Attempting to set cookie: 907a890ea5072d0d
[Thu Jun 29 13:41:51 2006] [warn] Attemptimg JDBC connection...
jdbc:basis:localhost?database=LINDS&user=admin&pwd=admin123
[Thu Jun 29 13:41:51 2006] [warn] Successful JDBC connection...
[Thu Jun 29 13:41:51 2006] [warn] Sending off to the requested object:
/www/BBj/htdocs/index_submit.html
[Thu Jun 29 13:41:51 2006] [warn] - AUTOHANDLER START -
[Thu Jun 29 13:41:51 2006] [warn] batch is set to in autohandler
[Thu Jun 29 13:41:51 2006] [warn] AH: not logged in
[Thu Jun 29 13:41:51 2006] [warn] USER -not_logged_in- requesting
/index_submit.html
[Thu Jun 29 13:41:51 2006] [warn] - AUTOHANDLER END -
[Thu Jun 29 13:41:51 2006] [warn] This user is using the browser:
"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.4) Gecko/20060508
Firefox/1.5.0.4"
[Thu Jun 29 13:41:51 2006] [warn] BENCH: request took 0 wallclock secs
( 0.02 usr + 0.01 sys = 0.03 CPU)
[Thu Jun 29 13:41:51 2006] [warn] Back in mason.handler after handling
request
[Thu Jun 29 13:42:09 2006] [warn] --------------------------------
[Thu Jun 29 13:42:09 2006] [warn] ENV SESSION_ID is : ""
[Thu Jun 29 13:42:09 2006] [warn] URI is /login_popup.html
[Thu Jun 29 13:42:09 2006] [warn] filename is
/www/BBj/htdocs/login_popup.html : 10.1.1.155
[Thu Jun 29 13:42:09 2006] [warn] calling session::DBI tie now on
907a890ea5072d0d
[Thu Jun 29 13:42:09 2006] [warn] after tie call:
[Thu Jun 29 13:42:09 2006] [warn] done calling session::DBI tie now
[Thu Jun 29 13:42:09 2006] [warn] good session, now I should verify that
there isn't a url-session
[Thu Jun 29 13:42:09 2006] [warn] CATCH ALL: no session defined!
retrying...
[Thu Jun 29 13:42:09 2006] [warn] calling session::DBI tie now on
[Thu Jun 29 13:42:09 2006] [warn] after tie call:
[Thu Jun 29 13:42:09 2006] [warn] done calling session::DBI tie now
[Thu Jun 29 13:42:09 2006] [warn] Attempting to set cookie: e8d390425359095b
[Thu Jun 29 13:42:09 2006] [warn] Attemptimg JDBC connection...
jdbc:basis:localhost?database=LINDS&user=admin&pwd=admin123
[Thu Jun 29 13:42:09 2006] [warn] Successful JDBC connection...
[Thu Jun 29 13:42:09 2006] [warn] Sending off to the requested object:
/www/BBj/htdocs/login_popup.html
[Thu Jun 29 13:42:09 2006] [warn] - AUTOHANDLER START -
[Thu Jun 29 13:42:09 2006] [warn] batch is set to in autohandler
[Thu Jun 29 13:42:09 2006] [warn] login popup called
[Thu Jun 29 13:42:09 2006] [warn] USER -not_logged_in- requesting
/login_popup.html
[Thu Jun 29 13:42:09 2006] [warn] - AUTOHANDLER END -
[Thu Jun 29 13:42:09 2006] [warn] This user is using the browser:
"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.4) Gecko/20060508
Firefox/1.5.0.4"
[Thu Jun 29 13:42:09 2006] [warn] BENCH: request took 0 wallclock secs
( 0.00 usr + 0.02 sys = 0.02 CPU)
[Thu Jun 29 13:42:09 2006] [warn] Back in mason.handler after handling
request
Subset of Mason Handler Code:
my $cookie;
my %c = Apache::Cookie->fetch;
if ($c{session_id}) {
if (($ENV{SESSION_ID}) && ($c{session_id}->value ne
$ENV{SESSION_ID})) {
$r->warn("swapping cookie ".$c{session_id}->value." with
ENV: ".$ENV{SESSION_ID}) if ($debug);
# change this around if you want to prefer cookie over url
when they differ
$c{session_id}->value($ENV{SESSION_ID});
}
if (! ($cookie = check_session($r, $c{session_id}->value))) {
$r->warn("error in the session id with cookies") if ($debug);
if (check_session($r, undef)) {
$r->warn("Attempting to set cookie:
$HTML::Mason::Commands::session{_session_id}") if ($debug);
set_cookie($r,
$HTML::Mason::Commands::session{_session_id});
my $uri = "/S="
.$HTML::Mason::Commands::session{_session_id}. $r->uri;
$r->header_out(Location => $uri);
$r->warn(" 1 REDIRECT to $uri") if ($debug);
untie %HTML::Mason::Commands::session;
return REDIRECT;
} else {
$r->log_error("Big error trying to get session with
undef with cookie");
}
} else {
$r->warn("good session, now I should verify that there isn't
a url-session") if ($debug);
if (length($ENV{SESSION_ID})) {
$r->warn("yup, session in the url") if ($debug);
(my $uri = $r->uri)=~s/^\/?S=($ENV{SESSION_ID})\//\//;
$r->warn(" 2 REDIRECT to $uri") if ($debug);
$r->header_out(Location => $uri);
untie %HTML::Mason::Commands::session;
return REDIRECT;
}
}
} else {
$r->warn("looking for session in ENV") if ($debug);
if (! ($cookie = check_session($r, $ENV{SESSION_ID}))) {
$r->warn("error in the session id with url-session") if
($debug);
} else {
if ($ENV{SESSION_ID}) {
$r->warn("good session from url") if ($debug);
} else {
$r->warn("no session existing, created one:
$HTML::Mason::Commands::session{_session_id}") if ($debug);
set_cookie($r,
$HTML::Mason::Commands::session{_session_id});
if ($r->uri =~ /\/$/) {
$r->header_out(Location =>
"/S=".$HTML::Mason::Commands::session{_session_id}.$r->uri."index.html");
} else {
$r->header_out(Location =>
"/S=".$HTML::Mason::Commands::session{_session_id}.$r->uri);
}
$r->warn(" 3 REDIRECT to ".$r->header_out('Location'))
if ($debug);
untie %HTML::Mason::Commands::session;
return REDIRECT;
}
}
}
if (! defined $HTML::Mason::Commands::session{_session_id}) {
$r->warn("CATCH ALL: no session defined! retrying...") if ($debug);
if (! check_session($r, undef)) {
return SERVER_ERROR;
}
}
if ($HTML::Mason::Commands::session{RECREATE}) {
$r->warn("RECREATE is defined in session... I dunno, recreating I
guess.") if ($debug);
untie %HTML::Mason::Commands::session;
if (! check_session($r, undef)) {
return SERVER_ERROR;
}
}
$r->warn("Attempting to set cookie:
$HTML::Mason::Commands::session{_session_id}") if ($debug);
set_cookie($r, $HTML::Mason::Commands::session{_session_id});
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users