Hi ,
Iam trying to replicate the graph generation i using GD module using apache::ASP.
As iam not sure how to check for complie errors as i cannot see anything error
which i can understand either in apache logs or on the browser trying to seek your
help.
Could some one pls point what might be wrong.
Regards
Raghu
Errors Output
- [Tue Oct 22 01:13:59 2002] lisa_test.asp: BEGIN not safe after errors--compilation aborted at lisa_test.asp line 182. , /Net/stmdvocs/sbcexp/devl/SunOS/sparc-5.6/run/pd/cpan/5.6.1-eval/lib/Apache/ASP.pm line 2135... see compile error for rest
- RUN ASP (v2.31) for /home/nalamara/myapache/htdocs/asp/eg/lisa_test.asp ...
- GlobalASA package Apache::ASP::Demo ...
- global.asa was not cached for _home_nalamara_myapache_htdocs_asp_eg___global_asaxbb9175c238d1c4683f1529d060e92a9b ...
- compiling global.asa Apache::ASP::Demo _home_nalamara_myapache_htdocs_asp_eg___global_asaxbb9175c238d1c4683f1529d060e92a9b exists 1 - asp: Apache::ASP=HASH(0x85cd60); compiled: HASH(0x88b800); exists: 1; id: _home_nalamara_myapache_htdocs_asp_eg___global_asaxbb9175c238d1c4683f1529d060e92a9b; package: Apache::ASP::Demo; - --- - exists: 0; mtime: 0; ...
- global.asa routines - Application_OnEnd: 1; Application_OnStart: 1; Script_OnEnd: 1; Script_OnFlush: 1; Script_OnStart: 1; Session_OnEnd: 1; Session_OnStart: 1; ...
- creating dbm for file /home/nalamara/myapache/htdocs/asp/eg/server/internal, db SDBM_File, serializer: Data::Dumper ...
- creating dbm for file /home/nalamara/myapache/htdocs/asp/eg/server/application, db SDBM_File, serializer: Data::Dumper ...
- session id from cookie: 0bd375841b237fe56b696556cb211faa ...
- refreshing 0bd375841b237fe56b696556cb211faa with timeout 1035249538 ...
- creating dbm for file /home/nalamara/myapache/htdocs/asp/eg/0b/0bd375841b237fe56b696556cb211faa, db SDBM_File, serializer: Data::Dumper ...
- session not expired - time: 1035249238; timeout: 1035249484; ...
- tieing session 0bd375841b237fe56b696556cb211faa ...
- updating LastSessionTimeout from 1035249514 ...
- includes have not changed for script lisa_test.asp ...
- parse file lisa_test.asp ...
- parsing lisa_test.asp ...
- start parse of data - 4050 ...
- undefing sub Apache::ASP::Demo::__ASP__home_nalamara_myapache_htdocs_asp_eg_lisa_test_aspxbb9175c238d1c4683f1529d060e92a9b code CODE(0x8a27d4) ...
- compiling into package Apache::ASP::Demo subid [Apache::ASP::Demo::__ASP__home_nalamara_myapache_htdocs_asp_eg_lisa_test_aspxbb9175c238d1c4683f1529d060e92a9b] ...
- [Tue Oct 22 01:13:59 2002] lisa_test.asp: BEGIN not safe after errors--compilation aborted at lisa_test.asp line 182. , /Net/stmdvocs/sbcexp/devl/SunOS/sparc-5.6/run/pd/cpan/5.6.1-eval/lib/Apache/ASP.pm line 2135 ...
- undefing sub Apache::ASP::Demo::__ASP__home_nalamara_myapache_htdocs_asp_eg_lisa_test_aspxbb9175c238d1c4683f1529d060e92a9b code CODE(0x8a27d4) ...
- ASP Done Processing - asp: Apache::ASP=HASH(0x85cd60); ...
- errors out <li> [Tue Oct 22 01:13:59 2002] lisa_test.asp: BEGIN not safe after errors--compilation aborted at lisa_test.asp line 182. , /Net/stmdvocs/sbcexp/devl/SunOS/sparc-5.6/run/pd/cpan/5.6.1-eval/lib/Apache/ASP.pm line 2135 ...
Compile Error [Tue Oct 22 01:13:59 2002] lisa_test.asp: BEGIN not safe after errors--compilation aborted at lisa_test.asp line 182. ... Compiled Data with Error -: package Apache::ASP::Demo; ;; sub Apache::ASP::Demo::__ASP__home_nalamara_myapache_htdocs_asp_eg_lisa_test_aspxbb9175c238d1c4683f1529d060e92a9b { ;; package Apache::ASP::Demo; ;; use strict;;use vars qw($Application $Session $Response $Server $Request);;use lib qw(/home/nalamara/myapache/htdocs/asp/eg//.);;; -: #line 1 lisa_test.asp 1: ; 2: ; &ASP::WriteRef($main::Response, \('#http://ln4p697cmp:8080/nalamara/lisa_test.pl?Reqsr="LDN"&Reqdb="obs" 3: #http://ln4p697cmp:8080/nalamara/lisa_test.pl?Reqsr=LDN&Reqdb=obs 4: ############################################## 5: #Created by Raghu for Lisa for DB hist Growth# 6: # It expects dataserver and Db name # 7: ############################################## 8: 9: ')); 10: $|++; 11: use DBI ; 12: use CGI ':standard'; 13: use CGI::Carp qw(fatalsToBrowser); 14: use GD::Graph::bars; 15: $| = 1 ; 16: $myyaxis ; 17: 18: 19: $query=new CGI; 20: 21: 22: %dbName = ("LDN" => "LN_PRODOBS1_SQL", 23: "LDN3" => "LN_PRODOBS3_SQL", 24: "LDN4" => "LN_PRODOBS4_SQL", 25: "OPF2" => "OP_PRODOBS2_SQL", 26: "OPF3" => "OP_PRODOBS3_SQL", 27: "HBQ" => "LN_PRODOBS1DR_SQL", 28: "STM" => "SM_PRODOBS1_SQL", 29: "STM2" => "SM_PRODOBS2_SQL", 30: "STM3" => "SM_PRODOBS3_SQL", 31: "SNG" => "SN_PRODOBS1_SQL", 32: "SNG2" => "LN_MEMPHISP1_SQL", 33: "TKY" => "LN_OIP1_SQL" 34: ); 35: 36: 37: $Reqdbserver = $query->param("Reqsr"); 38: $Reqdb = $query->param(Reqdb); 39: chomp($Reqdbserver); 40: chomp($Reqdb); 41: 42: 43: $ReqGraph = "$dbName{$Reqdbserver}"."_"."$Reqdb"; 44: $ReqGraph = "LN_PRODOBS1DR_SQL_obs.txt" ; 45: $file = "/Net/ldn_shared1/home3/obsldn/DBSIZE/$ReqGraph.txt"; 46: 47: open (F1, "< $file") || error("Cannot open $file file ($!)"); 48: 49: # Wish i can avoid this but unless i have a extra line in the file GD is complaining 50: open (INFILE,"> /tmp/test.txt") || error1("File Section could be opened"); 51: 52: 53: while(<F1>){ 54: 55: print INFILE $_; 56: 57: if (eof()) { 58: print INFILE "\n"; 59: 60: } 61: } 62: 63: close F1; 64: close INFILE ; 65: 66: open (INFILE1,"< /tmp/test.txt") || print "File Section could be opened"; 67: while(<INFILE1>){ 68: chomp($_) ; 69: @data = "split('\t'," $_); 70: push(@Date,"$data[0]" ) ; 71: push(@Total,$data[1] ) ; 72: push(@Free,$data[2] ) ; 73: push(@Used,$data[3] ) ; 74: 75: } 76: close INFILE1; 77: 78: # Set up our data array 79: push(@data,\@Date); # push x labels into plot data 80: push(@data,\@Total); 81: push(@data,\@Free); 82: push(@data,\@Used ); 83: 84: #To set the axis 85: if (scalar(@Total) > 0) 86: { 87: my $max ; 88: foreach (@Total) { 89: $max = $_ if $max < $_; 90: } 91: 92: my $myyaxis = scalar($max) + 200 ; 93: #print "myyaxis is $myyaxis \n"; 94: } 95: 96: 97: # setup legend labels 98: my @legend = qw(Total Free Used); 99: 100: # get graph object 101: my $graph = GD::Graph::bars->new(600, 400); 102: 103: # set graph legend 104: $graph->set_legend(@legend); 105: 106: 107: # set graph options 108: $graph->set( 109: 'dclrs' => [ qw(lblue green red) ], 110: 'title' => "$Reqdbserver $Reqdb Growth", 111: 'x_label' => "Date", 112: 'y_label' => "Database Size", 113: 'long_ticks' => 1, 114: 'tick_length' => 0, 115: 'x_ticks' => 0, 116: 'x_label_position' => .5, 117: 'y_label_position' => .5, 118: 'bgclr' => 'white', 119: 'transparent' => 0, 120: 'interlaced' => 1, 121: 'y_tick_number' => 5, 122: 'y_number_format' => '%d', 123: 'y_max_value' => $myyaxis, 124: 'y_min_value' => 0, 125: 'y_plot_values' => 1, 126: 'x_plot_values' => 1, 127: 'x_label_skip' => 7, 128: 'x_labels_vertical'=> 1, 129: 'zero_axis' => 1, 130: ); 131: 132: 133: $graph->plot(\@data); 134: 135: my $chart = $graph; 136: my $name = "$ReqGraph"; 137: #save_chart($graph, "$ReqGraph"); 138: my $ext = $chart->export_format; 139: 140: open(OUT, ">$name.$ext") or die "Cannot open $name.$ext for write: $!"; 141: binmode OUT; 142: print OUT $chart->gd->$ext(); 143: close OUT; 144: 145: #print STDOUT header("image/GIF"); 146: #print STDOUT header("image/PNG"); 147: #binmode STDOUT; 148: #print STDOUT $chart->gd->$ext(); 149: 150: open(FILE, "$name.$ext") || die "can't open $name.$ext"; 151: binmode FILE; 152: #$/ = undef; 153: my $data = "<$name.$ext>;" 154: $Response->{ContentType} = 'image/PNG'; 155: $Response->{ContentLength} = length $data; 156: $Response->Clear; 157: $Response->BinaryWrite($data); 158: $Response->End(); 159: 160: 161: sub error 162: { 163: 164: print $query->header() ; 165: print <<"END1"; 166: <html> 167: <tr> 168: <td width="40" align="center"><p align="center"><strong>\ \ \ \</strong></td> 169: <td width="40" align="center"><p align="center"><strong>\ \ \ \</strong></td> 170: <td width="40" align="center"><p align="center"><strong> @_;</strong></td> 171: </tr> 172: </body> 173: </html> 174: 175: 176: END1 177: 178: print $query->end_html; 179: 180: } 181: 182: ; ;;no lib qw(/home/nalamara/myapache/htdocs/asp/eg//.); ;; }
An error has occured with the Apache::ASP script just run. If you are the developer working on this script, and cannot work through this problem, please try researching it at the Apache::ASP web site, specifically the FAQ section. Failing that, check out your support options, and if necessary include this debug output with any query.
lisa_test.asp
Description: lisa_test.asp
Visit our website at http://www.ubswarburg.com This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
