[Thread Prev][Thread Next][Index]
LAS: initialize_check.sh
Hi,
Until now I hadn't tried to implement las_ui_check.sh in cron, but
recently users have been throwing Java exceptions while using Safari
with the two-click map (at least that appears to be what's happening)
and I'm having to reboot the tomcat server often, so I decided to give
the cron script a try.
When I run initialize_check.sh I get the following:
Not a SCALAR reference at /usr/local/(las_root)/bin/get_las_page.pl
line 38
I get the same error for two different LAS's - both are basically the
default installation.
I'm running las 6.5.0.4 on Solaris 9 with Apache 1.3 and the Tomcat
server that came in the las tarball
Any ideas?
Thanks. Lynn
On Jun 22, 2005, at 7:06 AM, Roland Schweitzer wrote:
Joerg,
As you may have gathered from the message, when the opening page is
delivered for the first time, the servlet attempts to set a cookie by
sending a redirect to the browser. After the cookie has been set and
the servlet can retrieve the cookie, the actual content is delivered
to the browser.
If you want load the opening page via PHP, you'll probably need to
manage the interaction with the servlet in PHP to obtain the session
cookie and use PHP to deliver the cookie to the browser. Here is a
Perl example that does something similar. Of course, you can't just
throw the cookie away in you PHP program, you'll have to send it on to
the browser.
Roland
---------
#! /usr/bin/perl -w
# get_las_page.pl
# program to get LAS servlets/dataset response and print to file.
use strict;
use warnings;
use LWP::UserAgent;
use HTTP::Cookies;
# Question: is this a good name and path? presumably $lasroot/bin/
my $cookie_file = 'read_las_cookies.txt';
#
# Read the URL from the command line.
# Note: the configure script sets this up to access the tomcat URL
directly.
# If you use a connector or a proxy config to pass the request from
Apache
# to tomcat you may want to use the apache URL instead
if ($#ARGV < 1) {
print STDERR "usage: get_las_page.pl LAS_URL output_file\n";
}
my $url = shift @ARGV;
my $output_file = shift @ARGV;
my $ua = new LWP::UserAgent;
$ua->cookie_jar(HTTP::Cookies->new(file => "$cookie_file", autosave =>
1));
# first request
my $request = HTTP::Request->new(GET => $url);
my $response = $ua->request($request);
# deal with LAS cookie check response (sends back '302 - Temporarily
Moved'
# message and cookie check URL
while ($response->{_rc} eq '302'){
$url=${$response->{_request}->{_uri}};
$request = HTTP::Request->new(GET => $url);
$response = $ua->request($request);
}
if ($response->is_success) {
unlink $cookie_file;
open (OUT,">$output_file");
my $stuff = $response->content;
print OUT "\n$stuff\n";
close OUT;
}else{
my $status_line = $response->status_line;
die "get_las_page.pl failed, server response was: $status_line\n";
}
Joerg Franke wrote:
Hi,
I built a website with a dynamical structure using tables and php
instead of frames and html. When I try to include the LAS-Server in
my "mainframe" table cell:
<?php
include 'http://<servername>:8080/las/servlets/dataset';
?>
this error message appears:
"Cookies required
The Live Access Server provides access to geophysical and
environmental scientific data. If you wish to access this data,
however, your browser must support cookies. "
although Cookies are enabled of cause.
If it is not possible that way, is there another easy way to embed
the LAS-Server into my php webpage?
Cheers
Jörg
Lynn deWitt
Pacific Fisheries Environmental Lab
1352 Lighthouse Ave
Pacific Grove, CA 93907
(831)648-9036
[Thread Prev][Thread Next][Index]
Dept of Commerce /
NOAA /
OAR /
PMEL /
TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement