RE: [cgiapp] CGI Error [Solved!!]

2002-05-13 Thread Sabherwal, Balvinder (MBS)

Commenting out the following lines in the CGI.PM resolved the error. I don't
know if this is the correct way or not, if anyone has a different way to
solve this, pls. let me know.

Thanks
Bal.

#if ($dtd) {
#if (defined(ref($dtd)) and (ref($dtd) eq 'ARRAY')) {
#$dtd = $DEFAULT_DTD unless $dtd-[0] =~ m|^-//|;
#} else {
#$dtd = $DEFAULT_DTD unless $dtd =~ m|^-//|;
#}
#} else {
#$dtd = $XHTML ? XHTML_DTD : $DEFAULT_DTD;
#}
#
#$xml_dtd++ if ref($dtd) eq 'ARRAY'  $dtd-[0] =~ /\bXHTML\b/i;
#$xml_dtd++ if ref($dtd) eq ''  $dtd =~ /\bXHTML\b/i;
#push @result,q(?xml version=1.0 encoding=utf-8?) if $xml_dtd; 
#
#if (ref($dtd)  ref($dtd) eq 'ARRAY') {
#push(@result,qq(!DOCTYPE html\n\tPUBLIC
$dtd-[0]\n\t$dtd-[1]));
#} else {
#push(@result,qq(!DOCTYPE html\n\tPUBLIC $dtd));
#}
#push(@result,$XHTML ? qq(htmlheadtitle$title/title)
#   : qq(html
lang=$langheadtitle$title/title));
#   push(@result,$XHTML ? qq(html xmlns=http://www.w3.org/1999/xhtml;
lang=$langheadtitle$title/title)
#   : qq(html
lang=$langheadtitle$title/title));
#   if (defined $author) {
#push(@result,$XHTML ? link rev=\made\ href=\mailto:$author\; /
#   : link
rev=\made\ href=\mailto:$author\;);
#   }

-Original Message-
From: Sabherwal, Balvinder (MBS)
[mailto:[EMAIL PROTECTED]]
Sent: Monday, May 13, 2002 10:05 AM
To: [EMAIL PROTECTED]
Subject: [cgiapp] CGI Error
Importance: High


The XML page cannot be displayed 
Cannot view XML input using XSL style sheet. Please correct the error and
then click the Refresh button, or try again later. 




A declaration was not closed. Error processing resource
'http://dbainet/cgi-bin/graphpvt.cgi'. Line 1, Position 1 

Guru's

I am getting error as mentioned above. This is being generated on the
execution of a perl script which had been working fine in the past and
nothing has been changed in this script. 

This script is based on the CGI::Application template.

Any help would be greatly appreciated.

Thanks
Bal.

-
Web Archive:  http://www.mail-archive.com/cgiapp@lists.vm.com/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
Web Archive:  http://www.mail-archive.com/cgiapp@lists.vm.com/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: [cgiapp] CGI Error [Solved!!]

2002-05-13 Thread Jesse Erlbaum

Hi Bal --

 Commenting out the following lines in the CGI.PM resolved the 
 error. I don't
 know if this is the correct way or not, if anyone has a 
 different way to
 solve this, pls. let me know.


I would definitely NOT comment arbitrary lines from another module without
understanding WHY doing so changes the situation.  I am 100% positive that
you have a bug in your code, and that there is no bug in CGI.pm which is
causing this to happen.

Before you go and comment out lines from CGI.pm, take a close look at the
situation and figure out why commenting those lines seem to fix your
problem.  I am certain that you will discover a bug in your own code.

-Jesse-

-
Web Archive:  http://www.mail-archive.com/cgiapp@lists.vm.com/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: [cgiapp] CGI Error [Solved!!]

2002-05-13 Thread Cory Trese

I've seen this error before.  Do you have 'friendly error messages' turned
on in your IE settings?  What is the output with this option off or with
another non-IE browser?

...

 -Original Message-
 From: Sabherwal, Balvinder (MBS)
 [mailto:[EMAIL PROTECTED]]
 Sent: Monday, May 13, 2002 12:43 PM
 To: 'Jesse Erlbaum'; [EMAIL PROTECTED]
 Subject: RE: [cgiapp] CGI Error [Solved!!]


 Hi Jesse,

 I checked my code and couldn't find anything wrong in it. I don't know why
 the browser thinks it's and xml where as I am printing HTML all across the
 script. I am attaching the script herewith as well. If you or
 anyone on this
 list finds the bug, pls. let me know.

 Thanks
 Bal.


 #  SCRIPT  ##

 package perfmonpvt;
 use base 'CGI::Application';
 use strict;
 use Sybase::CTlib;

sub setup {
   my $self = shift;
   $self-start_mode('mode1');
   $self-run_modes(
   'mode1' = 'showsrvrs',
   'mode2' = 'showdetails'
   );
}

sub teardown {
   my $self = shift;
}

sub showsrvrs {
   my $self = shift;
   # Get CGI query object
   my $q = $self-query();
   my $dbh = Sybase::CTlib-ct_connect('perfmon', 'perfmon_ps',
 'SYB_NJ6'); ## Connect to the server.
   $dbh-ct_sql('use perfmondb');

   my $output = '';

if($dbh eq undef)
{
  $output .= $q-start_html();
  $output .= $q-blockquote(h1Connection to server failed. /h1);
  $output .= $q-blockquote(This could be due to an invalid Login
 Name,Password,Server Name.);
  $output .= $q-blockquote(If you feel all of these are correct, then
 pls check of the server is running and your login is not locked.);
  $output .= $q-blockquote(Still if you can't connect, Pls check you
 interfaces of sql.ini files.);
  $output .= $q-end_html();
  return $output;
  exit 0;
}
   my @srvrs;
   my $app= $dbh-ct_sql('select Name from Servers');

 foreach my $row (@$app) {
  foreach my $col (@$row) {
  push(@srvrs,$col);
  }
 }


   $output .= $q-start_html(-title = 'Sysmon Details');
   $output .= $q-blockquote($q-strong(h1Check Sysmon
 Details/h1));
   $output .= $q-start_form();
   {
 local($) = '';
   $output .= $q-blockquote(Select Server  : ,
 $q-popup_menu(-name= 'srv', -values =\@srvrs));
   }
   {
 local($) = '';
   $output .= $q-blockquote(Select Item(s) : ,
 $q-checkbox_group(-name= 'opt', -values =['CPU
 Busy','TPS','Deadlocks','IUD','Switches','Locks','Spinlock'],

 -default = 'CPU Busy'

 ));
   }
   {
 local($) = '';
   $output .= $q-blockquote(Start Date : ,
 $q-textfield(-name= 'sdt'),   Format: mmm dd  or mm/dd/);
   }
   {
 local($) = '';
   $output .= $q-blockquote(End Date   : ,
 $q-textfield(-name= 'edt'),   Format: mmm dd  or mm/dd/);
   }
   {
 local($) = '';
   $output .= $q-blockquote(Show Data Values   : ,
 $q-radio_group(-name= 'gv', -values =['Yes','No'],

 -default = 'Yes'

 ));
   }
   {
 local($) = '';
   $output .= $q-hidden(-name = 'rm', -value = 'mode2', -override=1
 );
   }
   {
 local($) = '';
   $output .= $q-submit(View Report);
   }
   $output .= $q-end_form();
   $output .= $q-end_html();
   return $output;
}


 sub showdetails {
   my $self = shift;
   #Get CGI query object
   my $q = $self-query();
   my $srv = $q-param(srv);
   my @opt = $q-param(opt);
   my $sdt = $q-param(sdt);
   my $edt = $q-param(edt);
   my $gv = $q-param(gv);
   my $block = ;

   my $output = '';

 foreach my $o (@opt)
 {
   $block = $block. '$o',;
 }
   $block = substr($block, 0, length($block) - 1);

   my $cmde = exec perfmondb..proc_sysmon_crosstab
 '$srv','$sdt','$edt', $block  ;

   my $dbh = Sybase::CTlib-ct_connect('perfmon', 'perfmon_ps',
 'SYB_NJ6'); ## Connect to the server.

   $output .= $q-start_html(-title = 'Sysmon Details');

   if($dbh eq undef)
   {
   $output .= $q-blockquote(h1Connection to server failed. /h1);
   $output .= $q-blockquote(This could be due to an invalid Login
 Name,Password,Server Name.);
   $output .= $q-blockquote(If you feel all of these are correct,
 then pls check of the server is running and your login is not locked.);
   $output .= $q-blockquote(Still if you can't connect, Pls check you
 interfaces of sql.ini files.);
   $output .= $q-end_html();
   return $output;
   exit 0;
   }
   $dbh-ct_sql(use perfmondb);

   my (@dr,$ret);

   $dbh-ct_execute($cmde);

   $output .= $q-blockquote(h1Check Sysmon Details/h1);
   $output .= $q-blockquote(Selected Server   : $srv);
   $output .= $q-blockquote(Selected Report   : $block);
   $output .= $q-start_form();
   $output .= $q-hidden(-name = 'rm', -value

RE: [cgiapp] CGI Error [Solved!!]

2002-05-13 Thread Jesse Erlbaum

Bal --

 I checked my code and couldn't find anything wrong in it. I 
 don't know why
 the browser thinks it's and xml where as I am printing HTML 
 all across the
 script. I am attaching the script herewith as well. If you or 
 anyone on this
 list finds the bug, pls. let me know.


My initial instict is that you've got an extra or missing } somewhere.
First off, fix your indenting -- it's unworkable.  If you make your
intending consistant that will probably help you identify your problem right
there.

E.g.:

sub some_mode {
my $self = shift;

if ($self-is_something()) {
return $self-do_something_else();
}

my $count = 0;
while ($self-stuff_is_true()) {
$count++;
if ($count%10) {
$self-count_mod_ten();
}
}

return Weouttahere...;
}


 ...Note that you can visually trace any closing brace to its source by
going straight up.  No guesswork required.


Basic stuff aside, I see one scary exit(0) in there.  That's a big no-no.
In this case it will never execute (you return() first), but in general you
should either exit (or die), or return output -- not both.


-Jesse-

-
Web Archive:  http://www.mail-archive.com/cgiapp@lists.vm.com/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: [cgiapp] CGI Error [Solved!!]

2002-05-13 Thread Brian Parker

You should run your script from the command line to see what the output is (or
telnet to the server).  When  you find out what the output is, you might be able
to find out what about that output your browser does not like.  When you find
out exactly what the browser does not like, you might be able to figure out how
to fix it.

regards,

Brian

Sabherwal, Balvinder (MBS) wrote:

 Hi Cory,

 Yes, the option is turned on and the error msg I get was in the first mail.
 The browser thinks its an xml file and complaints that it can't parse the
 xml style sheet. This is the case with the non IE browsers as well.

 #
 ERROR MSG In the browser :
 #

 The XML page cannot be displayed
 Cannot view XML input using XSL style sheet. Please correct the error and
 then click the Refresh button, or try again later.

 
 

 A declaration was not closed. Error processing resource
 'http://dbainet/cgi-bin/graphpvt.cgi'. Line 1, Position 1

 Thanks
 Bal.

 -Original Message-
 From: Cory Trese [mailto:[EMAIL PROTECTED]]
 Sent: Monday, May 13, 2002 12:54 PM
 To: [EMAIL PROTECTED]
 Subject: RE: [cgiapp] CGI Error [Solved!!]

 I've seen this error before.  Do you have 'friendly error messages' turned
 on in your IE settings?  What is the output with this option off or with
 another non-IE browser?

 ...

  -Original Message-
  From: Sabherwal, Balvinder (MBS)
  [mailto:[EMAIL PROTECTED]]
  Sent: Monday, May 13, 2002 12:43 PM
  To: 'Jesse Erlbaum'; [EMAIL PROTECTED]
  Subject: RE: [cgiapp] CGI Error [Solved!!]
 
 
  Hi Jesse,
 
  I checked my code and couldn't find anything wrong in it. I don't know why
  the browser thinks it's and xml where as I am printing HTML all across the
  script. I am attaching the script herewith as well. If you or
  anyone on this
  list finds the bug, pls. let me know.
 
  Thanks
  Bal.
 
 
  #  SCRIPT  ##
 
  package perfmonpvt;
  use base 'CGI::Application';
  use strict;
  use Sybase::CTlib;
 
 sub setup {
my $self = shift;
$self-start_mode('mode1');
$self-run_modes(
'mode1' = 'showsrvrs',
'mode2' = 'showdetails'
);
 }
 
 sub teardown {
my $self = shift;
 }
 
 sub showsrvrs {
my $self = shift;
# Get CGI query object
my $q = $self-query();
my $dbh = Sybase::CTlib-ct_connect('perfmon', 'perfmon_ps',
  'SYB_NJ6'); ## Connect to the server.
$dbh-ct_sql('use perfmondb');
 
my $output = '';
 
 if($dbh eq undef)
 {
   $output .= $q-start_html();
   $output .= $q-blockquote(h1Connection to server failed. /h1);
   $output .= $q-blockquote(This could be due to an invalid Login
  Name,Password,Server Name.);
   $output .= $q-blockquote(If you feel all of these are correct, then
  pls check of the server is running and your login is not locked.);
   $output .= $q-blockquote(Still if you can't connect, Pls check you
  interfaces of sql.ini files.);
   $output .= $q-end_html();
   return $output;
   exit 0;
 }
my @srvrs;
my $app= $dbh-ct_sql('select Name from Servers');
 
  foreach my $row (@$app) {
   foreach my $col (@$row) {
   push(@srvrs,$col);
   }
  }
 
 
$output .= $q-start_html(-title = 'Sysmon Details');
$output .= $q-blockquote($q-strong(h1Check Sysmon
  Details/h1));
$output .= $q-start_form();
{
  local($) = '';
$output .= $q-blockquote(Select Server  : ,
  $q-popup_menu(-name= 'srv', -values =\@srvrs));
}
{
  local($) = '';
$output .= $q-blockquote(Select Item(s) : ,
  $q-checkbox_group(-name= 'opt', -values =['CPU
  Busy','TPS','Deadlocks','IUD','Switches','Locks','Spinlock'],
 
  -default = 'CPU Busy'
 
  ));
}
{
  local($) = '';
$output .= $q-blockquote(Start Date : ,
  $q-textfield(-name= 'sdt'),   Format: mmm dd  or mm/dd/);
}
{
  local($) = '';
$output .= $q-blockquote(End Date   : ,
  $q-textfield(-name= 'edt'),   Format: mmm dd  or mm/dd/);
}
{
  local($) = '';
$output .= $q-blockquote(Show Data Values   : ,
  $q-radio_group(-name= 'gv', -values =['Yes','No'],
 
  -default = 'Yes'
 
  ));
}
{
  local($) = '';
$output .= $q-hidden(-name = 'rm', -value = 'mode2', -override=1
  );
}
{
  local($) = '';
$output .= $q-submit(View Report);
}
$output .= $q-end_form();
$output .= $q-end_html();
return $output;
 }
 
 
  sub showdetails {
my $self = shift;
#Get CGI query object
my $q = $self-query();
my $srv = $q-param(srv);
my @opt = $q-param(opt

RE: [cgiapp] CGI Error [Solved!!]

2002-05-13 Thread Cory Trese

My thought was that with Lynx or IE (perhaps without the friendly setting)
would yield the section of the document that looked like XML.

-- Cory

 -Original Message-
 From: Brian Parker [mailto:[EMAIL PROTECTED]]
 Sent: Monday, May 13, 2002 1:46 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [cgiapp] CGI Error [Solved!!]


 You should run your script from the command line to see what the
 output is (or
 telnet to the server).  When  you find out what the output is,
 you might be able
 to find out what about that output your browser does not like.
 When you find
 out exactly what the browser does not like, you might be able to
 figure out how
 to fix it.

 regards,

 Brian

 Sabherwal, Balvinder (MBS) wrote:

  Hi Cory,
 
  Yes, the option is turned on and the error msg I get was in the
 first mail.
  The browser thinks its an xml file and complaints that it can't
 parse the
  xml style sheet. This is the case with the non IE browsers as well.
 
  #
  ERROR MSG In the browser :
  #
 
  The XML page cannot be displayed
  Cannot view XML input using XSL style sheet. Please correct the
 error and
  then click the Refresh button, or try again later.
 
 
 --
 --
  
 
  A declaration was not closed. Error processing resource
  'http://dbainet/cgi-bin/graphpvt.cgi'. Line 1, Position 1
 
  Thanks
  Bal.
 
  -Original Message-
  From: Cory Trese [mailto:[EMAIL PROTECTED]]
  Sent: Monday, May 13, 2002 12:54 PM
  To: [EMAIL PROTECTED]
  Subject: RE: [cgiapp] CGI Error [Solved!!]
 
  I've seen this error before.  Do you have 'friendly error
 messages' turned
  on in your IE settings?  What is the output with this option off or with
  another non-IE browser?
 
  ...
 
   -Original Message-
   From: Sabherwal, Balvinder (MBS)
   [mailto:[EMAIL PROTECTED]]
   Sent: Monday, May 13, 2002 12:43 PM
   To: 'Jesse Erlbaum'; [EMAIL PROTECTED]
   Subject: RE: [cgiapp] CGI Error [Solved!!]
  
  
   Hi Jesse,
  
   I checked my code and couldn't find anything wrong in it. I
 don't know why
   the browser thinks it's and xml where as I am printing HTML
 all across the
   script. I am attaching the script herewith as well. If you or
   anyone on this
   list finds the bug, pls. let me know.
  
   Thanks
   Bal.
  
  
   #  SCRIPT  ##
  
   package perfmonpvt;
   use base 'CGI::Application';
   use strict;
   use Sybase::CTlib;
  
  sub setup {
 my $self = shift;
 $self-start_mode('mode1');
 $self-run_modes(
 'mode1' = 'showsrvrs',
 'mode2' = 'showdetails'
 );
  }
  
  sub teardown {
 my $self = shift;
  }
  
  sub showsrvrs {
 my $self = shift;
 # Get CGI query object
 my $q = $self-query();
 my $dbh = Sybase::CTlib-ct_connect('perfmon', 'perfmon_ps',
   'SYB_NJ6'); ## Connect to the server.
 $dbh-ct_sql('use perfmondb');
  
 my $output = '';
  
  if($dbh eq undef)
  {
$output .= $q-start_html();
$output .= $q-blockquote(h1Connection to server
 failed. /h1);
$output .= $q-blockquote(This could be due to an invalid Login
   Name,Password,Server Name.);
$output .= $q-blockquote(If you feel all of these are
 correct, then
   pls check of the server is running and your login is not locked.);
$output .= $q-blockquote(Still if you can't connect,
 Pls check you
   interfaces of sql.ini files.);
$output .= $q-end_html();
return $output;
exit 0;
  }
 my @srvrs;
 my $app= $dbh-ct_sql('select Name from Servers');
  
   foreach my $row (@$app) {
foreach my $col (@$row) {
push(@srvrs,$col);
}
   }
  
  
 $output .= $q-start_html(-title = 'Sysmon Details');
 $output .= $q-blockquote($q-strong(h1Check Sysmon
   Details/h1));
 $output .= $q-start_form();
 {
   local($) = '';
 $output .= $q-blockquote(Select Server  : ,
   $q-popup_menu(-name= 'srv', -values =\@srvrs));
 }
 {
   local($) = '';
 $output .= $q-blockquote(Select Item(s) : ,
   $q-checkbox_group(-name= 'opt', -values =['CPU
   Busy','TPS','Deadlocks','IUD','Switches','Locks','Spinlock'],
  
   -default = 'CPU Busy'
  
   ));
 }
 {
   local($) = '';
 $output .= $q-blockquote(Start Date : ,
   $q-textfield(-name= 'sdt'),   Format: mmm dd  or mm/dd/);
 }
 {
   local($) = '';
 $output .= $q-blockquote(End Date   : ,
   $q-textfield(-name= 'edt'),   Format: mmm dd  or mm/dd/);
 }
 {
   local($) = '';
 $output .= $q-blockquote(Show Data Values   : ,
   $q-radio_group(-name= 'gv', -values =['Yes','No'],
  
   -default = 'Yes

RE: [cgiapp] CGI Error [Solved!!]

2002-05-13 Thread Brian . T . Wightman

Sorry about the attribution (*%@#*^$ Notes)




 $output .= $q-header_props(-type =image/$format);
 $output .= $q-blockquote();
 $output .= $q-blockquote(Centerh2Graph/h2/Center);
 my ($usr, $stim, $cusr, $cstim) = times;
 $output .= CenterIMG
   SRC=\http://dbainet/pvtgraph.png?$stim?$usr?cusr?cstim\;/Center;


Is this snippet of code correct?  Why would center, h2, and img tags
be present in any document whose header identified itself as an
image/FOO?  OTOH, it has been a while since I looked at doing stuff like
this.

Brian



-
Web Archive:  http://www.mail-archive.com/cgiapp@lists.vm.com/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]