Loading ...
Sorry, an error occurred while loading the content.

Re: Application Variable not getting created

Expand Messages
  • Helmut Zeilinger
    Hi, that s is what one was expecting.. good .. The next things i would do: - is global.asa really been executed? Test it with a print or die in it - if
    Message 1 of 4 , May 23, 2005
    • 0 Attachment
      Hi,

      that's is what one was expecting.. good ..

      The next things i would do:

      - is global.asa really been executed? Test it with a "print" or "die" in it

      - if ok, try to add a "Script_OnStart" Handler, that calls
      Session_OnStart() to enshure,
      that it is called at each page reload..

      Question: In your httpd.conf you set several Perl Variables twice - e.g.
      Global -
      Is there a special reason for you to do this outside of the "<Files ~
      (\.asp)>" - scope ?

      If not, "unify" theese entries an place it inside the <Files > scope.

      Helmut

      >When I try this I get the value 'Checklist::Users'. Following is the script
      >I ran.
      >
      ><%
      >use Checklist::Users;
      >
      >my $users = new Checklist::Users();
      >$Application->{'ChecklistWeb::UsersObj'} = $users;
      >print ref ($Application->{'ChecklistWeb::UsersObj'});
      >$Application->{'ChecklistWeb::UsersObj'} = undef;
      >%>
      >
      >
      >Thanks,
      >Sangeeth
      >
      >
      >
      >----- Original Message -----
      >From: "Helmut Zeilinger" <hz@...>
      >To: "sangeethvs" <sangeeth.vs@...>
      >Cc: <asp@...>
      >Sent: Monday, May 23, 2005 11:49 AM
      >Subject: Re: Application Variable not getting created
      >
      >
      >
      >
      >>Hi sangeethvs,
      >>
      >>just to make things less complicated - does it work when
      >>you call
      >>
      >>...
      >>
      >>$Application->{'ChecklistWeb::UsersObj'} = $users;
      >>print ref ($Application->{'ChecklistWeb::UsersObj'});
      >>$Application->{'ChecklistWeb::UsersObj'} = undef;
      >>...
      >>
      >>in ONE test (asp) script?
      >>
      >>Helmut
      >>
      >>
      >>
      >>
      >>
      >>
      >>>I'm trying to move an existing application in Perl and Postgres
      >>>to a
      >>>new server with Oracle as database. I have installed the necessary
      >>>modules (I think so) but I'm getting errors while running the
      >>>application. The programming is done in object oriented Perl and
      >>>unfortunately I have no experience in object oriented Perl.
      >>>
      >>>But what I have come to understand is that, when the application
      >>>starts an application variable is created and further actions in the
      >>>applications are based on the value in this variable. It looks like
      >>>that this application variable is not getting created and this is
      >>>causing the errors I'm facing. I also verified it by printing
      >>>the
      >>>contents of the application variable. Nothing gets printed.
      >>>
      >>>The contents of global.asa file are given below.
      >>>
      >>>==================================================
      >>>use lib ".";
      >>>use lib "/usr/local/lib/perl5/site_perl/5.8.6";
      >>>
      >>>use Checklist::Users;
      >>>
      >>>sub Script_OnStart {
      >>> use lib "./lib";
      >>>}
      >>>
      >>>sub Session_OnStart {
      >>> # THIS IS FOR THE GRAPH STUFF
      >>> my $ID = $Session->{SessionID};
      >>> my $DIR = "/usr/local/apache/htdocs/images/graphs";
      >>> system("mkdir $DIR/$ID");
      >>> $Session->{WriteGraphDir} = "$DIR";
      >>> $Session->{SRCGraphDir} = "/images/graphs";
      >>> &Application_OnStart();
      >>>}
      >>>
      >>>sub Session_OnEnd {
      >>> # THIS IS FOR THE GRAPH STUFF
      >>> my $ID = $Session->{SessionID};
      >>> system ("rm -rf /usr/local/apache/htdocs/images/graphs/$ID") if
      >>>($ID);
      >>>}
      >>>
      >>>sub Application_OnStart {
      >>> # Load up the users
      >>> my $users = new Checklist::Users();
      >>> $Application->{'ChecklistWeb::UsersObj'} = $users;
      >>>}
      >>>
      >>>sub Application_OnEnd {
      >>> $Application->{'ChecklistWeb::UsersObj'} = undef;
      >>>}
      >>>
      >>>==================================================
      >>>
      >>>The configuration section of httpd.conf is given below
      >>>
      >>>=============================================================
      >>><Files ~ (\.asp)>
      >>> AllowOverride All
      >>> Allow from all
      >>> SetHandler perl-script
      >>> PerlModule Apache::DBI
      >>> PerlHandler Apache::ASP
      >>> PerlSetVar SessionTimeout 120
      >>> PerlSetVar StateManager 60
      >>> PerlSetVar StateDB DB_File
      >>> PerlSetVar Global /usr/local/apache/htdocs
      >>> PerlSetVar StateDir /tmp/WebData
      >>> PerlSetVar Debug 2
      >>></Files>
      >>>
      >>>PerlSetVar Global .
      >>>PerlSetVar GlobalPackage Apache::ASP::Demo
      >>>PerlSetVar StateDir /tmp/asp
      >>>PerlSetVar StatINC 0
      >>>PerlSetVar StatINCMatch 0
      >>>PerlSetVar Clean 0
      >>>PerlSetVar DynamicIncludes 1
      >>>PerlSetVar FileUploadMax 500000
      >>>PerlSetVar FileUploadTemp 1
      >>>PerlSetVar SessionQueryParse 0
      >>>PerlSetVar SessionQuery 1
      >>>PerlSetVar Debug -3
      >>>PerlSetVar StateCache 0
      >>>PerlSetVar SessionCount 1
      >>>PerlSetVar TimeHiRes 1
      >>>PerlSetVar CompressGzip 0
      >>>PerlSetVar UseStrict 1
      >>>=============================================================
      >>>
      >>>Following are the Perl modules that I have installed
      >>>· CGI
      >>>· DBI
      >>>· DBD::Oracle
      >>>· Bundle::Apache::ASP
      >>>· Apache::DBI
      >>>· DB_File
      >>>· GD (2.23)
      >>>· GD::Text
      >>>· GD::Graph
      >>>· FreezeThaw
      >>>
      >>>The output of perl –V is
      >>>=================================================================
      >>>Summary of my perl5 (revision 5 version 8 subversion 6) configuration:
      >>> Platform:
      >>> osname=solaris, osvers=2.8, archname=sun4-solaris
      >>> uname='sunos parker 5.8 generic_117350-07 sun4u sparc sunw,ultra-
      >>>4 '
      >>> config_args='-de'
      >>> hint=recommended, useposix=true, d_sigaction=define
      >>> usethreads=undef use5005threads=undef useithreads=undef
      >>>usemultiplicity=undef
      >>> useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
      >>> use64bitint=undef use64bitall=undef uselongdouble=undef
      >>> usemymalloc=n, bincompat5005=undef
      >>> Compiler:
      >>> cc='gcc', ccflags ='-fno-strict-aliasing -pipe -
      >>>I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
      >>> optimize='-O',
      >>> cppflags='-fno-strict-aliasing -pipe -I/usr/local/include'
      >>> ccversion='', gccversion='3.3.2', gccosandvers='solaris2.8'
      >>> intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
      >>> d_longlong=define, longlongsize=8, d_longdbl=define,
      >>>longdblsize=16
      >>> ivtype='long', ivsize=4, nvtype='double', nvsize=8,
      >>>Off_t='off_t', lseeksize=8
      >>> alignbytes=8, prototype=define
      >>> Linker and Libraries:
      >>> ld='gcc', ldflags =' -L/usr/local/lib '
      >>> libpth=/usr/local/lib /usr/lib /usr/ccs/lib
      >>> libs=-lsocket -lnsl -ldl -lm -lc
      >>> perllibs=-lsocket -lnsl -ldl -lm -lc
      >>> libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
      >>> gnulibc_version=''
      >>> Dynamic Linking:
      >>> dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
      >>> cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'
      >>>
      >>>
      >>>Characteristics of this binary (from libperl):
      >>> Compile-time options: USE_LARGE_FILES
      >>> Built under solaris
      >>> Compiled at Mar 21 2005 23:54:20
      >>> @INC:
      >>> /usr/local/lib/perl5/5.8.6/sun4-solaris
      >>> /usr/local/lib/perl5/5.8.6
      >>> /usr/local/lib/perl5/site_perl/5.8.6/sun4-solaris
      >>> /usr/local/lib/perl5/site_perl/5.8.6
      >>> /usr/local/lib/perl5/site_perl
      >>> .
      >>>==================================================================
      >>>
      >>>Could anyone please let me know what could be the problem? Please
      >>>let me know if you need any further information from me.
      >>>
      >>>I also notice another problem with .asp files. When I run an .asp
      >>>file for the first time in a new browser, I get the following error.
      >>>
      >>>=================================================
      >>>Errors Output
      >>>, /usr/local/lib/perl5/site_perl/5.8.6/Apache/ASP.pm line 1518
      >>>
      >>>Debug Output
      >>>, /usr/local/lib/perl5/site_perl/5.8.6/Apache/ASP.pm line 1518
      >>>=====================================================
      >>>
      >>>But when I reload the application, I don't receive this error.
      >>>Any
      >>>thoughts on this?
      >>>
      >>>Thanks in advance,
      >>>Sangeeth
      >>>
      >>>
      >>>
      >>>
      >>>---------------------------------------------------------------------
      >>>To unsubscribe, e-mail: asp-unsubscribe@...
      >>>For additional commands, e-mail: asp-help@...
      >>>
      >>>
      >>>
      >>>
      >>>

      ---------------------------------------------------------------------
      To unsubscribe, e-mail: asp-unsubscribe@...
      For additional commands, e-mail: asp-help@...
    • Sangeeth V S
      Hi, Thanks very much for trying to help me out! I really appreciate it. ... it ... I think global.asa is being executed. Few session variables are being
      Message 2 of 4 , May 23, 2005
      • 0 Attachment
        Hi,

        Thanks very much for trying to help me out! I really appreciate it.

        > - is global.asa really been executed? Test it with a "print" or "die" in
        it
        >
        > - if ok, try to add a "Script_OnStart" Handler, that calls
        > Session_OnStart() to enshure,
        > that it is called at each page reload..

        I think global.asa is being executed. Few session variables are being
        created in Session_OnStart. I printed the session variables and these are
        being created. Isn't that enough to confirm that global.asa is getting
        executed?

        > Question: In your httpd.conf you set several Perl Variables twice - e.g.
        > Global -
        > Is there a special reason for you to do this outside of the "<Files ~
        > (\.asp)>" - scope ?
        >
        > If not, "unify" theese entries an place it inside the <Files > scope.

        I really didn't know why it was set like that. I am migrating this
        application to a new server. So I just copied the exact settings in the
        current server to the new server. I was also very confused in seeing these
        settings. But there's no documentation for this application and no one to
        ask regarding this.

        Thanks,
        Sangeeth



        ----- Original Message -----
        From: "Helmut Zeilinger" <hz@...>
        To: "Sangeeth V S" <Sangeeth.VS@...>
        Cc: <asp@...>
        Sent: Monday, May 23, 2005 1:57 PM
        Subject: Re: Application Variable not getting created


        > Hi,
        >
        > that's is what one was expecting.. good ..
        >
        > The next things i would do:
        >
        > - is global.asa really been executed? Test it with a "print" or "die" in
        it
        >
        > - if ok, try to add a "Script_OnStart" Handler, that calls
        > Session_OnStart() to enshure,
        > that it is called at each page reload..
        >
        > Question: In your httpd.conf you set several Perl Variables twice - e.g.
        > Global -
        > Is there a special reason for you to do this outside of the "<Files ~
        > (\.asp)>" - scope ?
        >
        > If not, "unify" theese entries an place it inside the <Files > scope.
        >
        > Helmut
        >
        > >When I try this I get the value 'Checklist::Users'. Following is the
        script
        > >I ran.
        > >
        > ><%
        > >use Checklist::Users;
        > >
        > >my $users = new Checklist::Users();
        > >$Application->{'ChecklistWeb::UsersObj'} = $users;
        > >print ref ($Application->{'ChecklistWeb::UsersObj'});
        > >$Application->{'ChecklistWeb::UsersObj'} = undef;
        > >%>
        > >
        > >
        > >Thanks,
        > >Sangeeth
        > >
        > >
        > >
        > >----- Original Message -----
        > >From: "Helmut Zeilinger" <hz@...>
        > >To: "sangeethvs" <sangeeth.vs@...>
        > >Cc: <asp@...>
        > >Sent: Monday, May 23, 2005 11:49 AM
        > >Subject: Re: Application Variable not getting created
        > >
        > >
        > >
        > >
        > >>Hi sangeethvs,
        > >>
        > >>just to make things less complicated - does it work when
        > >>you call
        > >>
        > >>...
        > >>
        > >>$Application->{'ChecklistWeb::UsersObj'} = $users;
        > >>print ref ($Application->{'ChecklistWeb::UsersObj'});
        > >>$Application->{'ChecklistWeb::UsersObj'} = undef;
        > >>...
        > >>
        > >>in ONE test (asp) script?
        > >>
        > >>Helmut
        > >>
        > >>
        > >>
        > >>
        > >>
        > >>
        > >>>I'm trying to move an existing application in Perl and Postgres
        > >>>to a
        > >>>new server with Oracle as database. I have installed the necessary
        > >>>modules (I think so) but I'm getting errors while running the
        > >>>application. The programming is done in object oriented Perl and
        > >>>unfortunately I have no experience in object oriented Perl.
        > >>>
        > >>>But what I have come to understand is that, when the application
        > >>>starts an application variable is created and further actions in the
        > >>>applications are based on the value in this variable. It looks like
        > >>>that this application variable is not getting created and this is
        > >>>causing the errors I'm facing. I also verified it by printing
        > >>>the
        > >>>contents of the application variable. Nothing gets printed.
        > >>>
        > >>>The contents of global.asa file are given below.
        > >>>
        > >>>==================================================
        > >>>use lib ".";
        > >>>use lib "/usr/local/lib/perl5/site_perl/5.8.6";
        > >>>
        > >>>use Checklist::Users;
        > >>>
        > >>>sub Script_OnStart {
        > >>> use lib "./lib";
        > >>>}
        > >>>
        > >>>sub Session_OnStart {
        > >>> # THIS IS FOR THE GRAPH STUFF
        > >>> my $ID = $Session->{SessionID};
        > >>> my $DIR = "/usr/local/apache/htdocs/images/graphs";
        > >>> system("mkdir $DIR/$ID");
        > >>> $Session->{WriteGraphDir} = "$DIR";
        > >>> $Session->{SRCGraphDir} = "/images/graphs";
        > >>> &Application_OnStart();
        > >>>}
        > >>>
        > >>>sub Session_OnEnd {
        > >>> # THIS IS FOR THE GRAPH STUFF
        > >>> my $ID = $Session->{SessionID};
        > >>> system ("rm -rf /usr/local/apache/htdocs/images/graphs/$ID") if
        > >>>($ID);
        > >>>}
        > >>>
        > >>>sub Application_OnStart {
        > >>> # Load up the users
        > >>> my $users = new Checklist::Users();
        > >>> $Application->{'ChecklistWeb::UsersObj'} = $users;
        > >>>}
        > >>>
        > >>>sub Application_OnEnd {
        > >>> $Application->{'ChecklistWeb::UsersObj'} = undef;
        > >>>}
        > >>>
        > >>>==================================================
        > >>>
        > >>>The configuration section of httpd.conf is given below
        > >>>
        > >>>=============================================================
        > >>><Files ~ (\.asp)>
        > >>> AllowOverride All
        > >>> Allow from all
        > >>> SetHandler perl-script
        > >>> PerlModule Apache::DBI
        > >>> PerlHandler Apache::ASP
        > >>> PerlSetVar SessionTimeout 120
        > >>> PerlSetVar StateManager 60
        > >>> PerlSetVar StateDB DB_File
        > >>> PerlSetVar Global /usr/local/apache/htdocs
        > >>> PerlSetVar StateDir /tmp/WebData
        > >>> PerlSetVar Debug 2
        > >>></Files>
        > >>>
        > >>>PerlSetVar Global .
        > >>>PerlSetVar GlobalPackage Apache::ASP::Demo
        > >>>PerlSetVar StateDir /tmp/asp
        > >>>PerlSetVar StatINC 0
        > >>>PerlSetVar StatINCMatch 0
        > >>>PerlSetVar Clean 0
        > >>>PerlSetVar DynamicIncludes 1
        > >>>PerlSetVar FileUploadMax 500000
        > >>>PerlSetVar FileUploadTemp 1
        > >>>PerlSetVar SessionQueryParse 0
        > >>>PerlSetVar SessionQuery 1
        > >>>PerlSetVar Debug -3
        > >>>PerlSetVar StateCache 0
        > >>>PerlSetVar SessionCount 1
        > >>>PerlSetVar TimeHiRes 1
        > >>>PerlSetVar CompressGzip 0
        > >>>PerlSetVar UseStrict 1
        > >>>=============================================================
        > >>>
        > >>>Following are the Perl modules that I have installed
        > >>>· CGI
        > >>>· DBI
        > >>>· DBD::Oracle
        > >>>· Bundle::Apache::ASP
        > >>>· Apache::DBI
        > >>>· DB_File
        > >>>· GD (2.23)
        > >>>· GD::Text
        > >>>· GD::Graph
        > >>>· FreezeThaw
        > >>>
        > >>>The output of perl –V is
        > >>>=================================================================
        > >>>Summary of my perl5 (revision 5 version 8 subversion 6) configuration:
        > >>> Platform:
        > >>> osname=solaris, osvers=2.8, archname=sun4-solaris
        > >>> uname='sunos parker 5.8 generic_117350-07 sun4u sparc sunw,ultra-
        > >>>4 '
        > >>> config_args='-de'
        > >>> hint=recommended, useposix=true, d_sigaction=define
        > >>> usethreads=undef use5005threads=undef useithreads=undef
        > >>>usemultiplicity=undef
        > >>> useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
        > >>> use64bitint=undef use64bitall=undef uselongdouble=undef
        > >>> usemymalloc=n, bincompat5005=undef
        > >>> Compiler:
        > >>> cc='gcc', ccflags ='-fno-strict-aliasing -pipe -
        > >>>I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
        > >>> optimize='-O',
        > >>> cppflags='-fno-strict-aliasing -pipe -I/usr/local/include'
        > >>> ccversion='', gccversion='3.3.2', gccosandvers='solaris2.8'
        > >>> intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
        > >>> d_longlong=define, longlongsize=8, d_longdbl=define,
        > >>>longdblsize=16
        > >>> ivtype='long', ivsize=4, nvtype='double', nvsize=8,
        > >>>Off_t='off_t', lseeksize=8
        > >>> alignbytes=8, prototype=define
        > >>> Linker and Libraries:
        > >>> ld='gcc', ldflags =' -L/usr/local/lib '
        > >>> libpth=/usr/local/lib /usr/lib /usr/ccs/lib
        > >>> libs=-lsocket -lnsl -ldl -lm -lc
        > >>> perllibs=-lsocket -lnsl -ldl -lm -lc
        > >>> libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
        > >>> gnulibc_version=''
        > >>> Dynamic Linking:
        > >>> dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
        > >>> cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'
        > >>>
        > >>>
        > >>>Characteristics of this binary (from libperl):
        > >>> Compile-time options: USE_LARGE_FILES
        > >>> Built under solaris
        > >>> Compiled at Mar 21 2005 23:54:20
        > >>> @INC:
        > >>> /usr/local/lib/perl5/5.8.6/sun4-solaris
        > >>> /usr/local/lib/perl5/5.8.6
        > >>> /usr/local/lib/perl5/site_perl/5.8.6/sun4-solaris
        > >>> /usr/local/lib/perl5/site_perl/5.8.6
        > >>> /usr/local/lib/perl5/site_perl
        > >>> .
        > >>>==================================================================
        > >>>
        > >>>Could anyone please let me know what could be the problem? Please
        > >>>let me know if you need any further information from me.
        > >>>
        > >>>I also notice another problem with .asp files. When I run an .asp
        > >>>file for the first time in a new browser, I get the following error.
        > >>>
        > >>>=================================================
        > >>>Errors Output
        > >>>, /usr/local/lib/perl5/site_perl/5.8.6/Apache/ASP.pm line 1518
        > >>>
        > >>>Debug Output
        > >>>, /usr/local/lib/perl5/site_perl/5.8.6/Apache/ASP.pm line 1518
        > >>>=====================================================
        > >>>
        > >>>But when I reload the application, I don't receive this error.
        > >>>Any
        > >>>thoughts on this?
        > >>>
        > >>>Thanks in advance,
        > >>>Sangeeth
        > >>>
        > >>>
        > >>>
        > >>>
        > >>>---------------------------------------------------------------------
        > >>>To unsubscribe, e-mail: asp-unsubscribe@...
        > >>>For additional commands, e-mail: asp-help@...
        > >>>
        > >>>
        > >>>
        > >>>
        > >>>


        ---------------------------------------------------------------------
        To unsubscribe, e-mail: asp-unsubscribe@...
        For additional commands, e-mail: asp-help@...
      Your message has been successfully submitted and would be delivered to recipients shortly.