4 Replies Latest reply on Mar 1, 2011 1:30 PM by 795873

    Tomcat - HTTP Status 500 - System Unavailable. Please try again later.

    721224
      HI,
      I installed ORACLE XE + TOMCAT 7 + ORACLE XE on windows XP.
      All seems to work under debug session but on normal session I found the following message only when I put a specific parameter on my query.
      The same query with the same parameter runs in the sqldev client whitout errors


      Here below the massages:

      HTTP Status 500 - System Unavailable. Please try again later.

      type Status report

      message System Unavailable. Please try again later.

      description The server encountered an internal error (System Unavailable. Please try again later.) that prevented it from fulfilling this request.
      Apache Tomcat/7.0.2


      and in the log file:

      2011-02-23 18:04:19 Commons Daemon procrun stdout initialized
      APEX Listener version : 1.0.2.238.15.24
      APEX Listener server info: Apache Tomcat/7.0.2
      Using Config file:C:\Programmi\Apache Software Foundation\Tomcat 7.0\temp\apex\apex-config.xml
      -- listing properties --
      PropertyCheckInterval=60
      ValidateConnection=true
      MinLimit=1
      MaxLimit=10
      InitialLimit=3
      AbandonedConnectionTimeout=900
      MaxStatementsLimit=10
      InactivityTimeout=1800
      MaxConnectionReuseCount=50000

      ***********ERROR***********
      init: # headers=46
      declare nm owa.vc_arr := ?;
           vl owa.vc_arr := ?;
      begin
      owa.init_cgi_env( ?, nm, vl );
      htp.init; htp.HTBUF_LEN := 63;
      ? := sys_context('USERENV','SID');
      end;
      SID:18
      CALL:
      begin
      f(p=>?);
      commit;
      end;
      BINDS

      p:106:3:4503262208013405:::::PAGE CALL:
      declare
      nlns number := 999999;
      l_clob CLOB;
      lines htp.htbuf_arr;
      l_buff varchar2(32767);
      l_clob_init boolean:= false;
      l_file varchar2(5);
      begin
      OWA.GET_PAGE(lines, nlns);
      if (nlns > 1) then
      for i in 1..nlns loop
      if ( length(lines(i)) > 0 ) then
      if ( ( lengthb(l_buff) + lengthb(lines(i))) > 32767) then
                     if (NOT l_clob_init) then
                          dbms_lob.createtemporary(l_clob, TRUE);
                          dbms_lob.open(l_clob, dbms_lob.lob_readwrite);
                          l_clob_init:=true;
                     end if;
      dbms_lob.writeappend(l_clob,length(l_buff),l_buff);
      l_buff := lines(i);
      else
      l_buff := l_buff || lines(i);
      end if;
      end if;
      end loop;
      end if;
      if (l_clob_init) then
      dbms_lob.writeappend(l_clob,length(l_buff),l_buff);
      l_buff := '';
      end if;
      ? := l_clob;
      ? := l_buff;
      if (wpg_docload.is_file_download) then l_file:='TRUE'; else l_file := 'FALSE'; end if; ? := l_file;
      end;
      get_page FAILED:ORA-06502: PL/SQL: errore : buffer della stringa di caratteri troppo piccolo di numero o valore
      ORA-06512: a line 32

      ^^^^^^^^^^^^ERROR^^^^^^^^
      ORA-06502: PL/SQL: errore : buffer della stringa di caratteri troppo piccolo di numero o valore
      ORA-06512: a line 32


      ***********ERROR***********
      init: # headers=46
      declare nm owa.vc_arr := ?;
           vl owa.vc_arr := ?;
      begin
      owa.init_cgi_env( ?, nm, vl );
      htp.init; htp.HTBUF_LEN := 63;
      ? := sys_context('USERENV','SID');
      end;
      SID:18
      CALL:
      begin
      f(p=>?);
      commit;
      end;
      BINDS

      p:106:3:3777982020408238:::::PAGE CALL:
      declare
      nlns number := 999999;
      l_clob CLOB;
      lines htp.htbuf_arr;
      l_buff varchar2(32767);
      l_clob_init boolean:= false;
      l_file varchar2(5);
      begin
      OWA.GET_PAGE(lines, nlns);
      if (nlns > 1) then
      for i in 1..nlns loop
      if ( length(lines(i)) > 0 ) then
      if ( ( lengthb(l_buff) + lengthb(lines(i))) > 32767) then
                     if (NOT l_clob_init) then
                          dbms_lob.createtemporary(l_clob, TRUE);
                          dbms_lob.open(l_clob, dbms_lob.lob_readwrite);
                          l_clob_init:=true;
                     end if;
      dbms_lob.writeappend(l_clob,length(l_buff),l_buff);
      l_buff := lines(i);
      else
      l_buff := l_buff || lines(i);
      end if;
      end if;
      end loop;
      end if;
      if (l_clob_init) then
      dbms_lob.writeappend(l_clob,length(l_buff),l_buff);
      l_buff := '';
      end if;
      ? := l_clob;
      ? := l_buff;
      if (wpg_docload.is_file_download) then l_file:='TRUE'; else l_file := 'FALSE'; end if; ? := l_file;
      end;
      get_page FAILED:ORA-06502: PL/SQL: errore : buffer della stringa di caratteri troppo piccolo di numero o valore
      ORA-06512: a line 32

      ^^^^^^^^^^^^ERROR^^^^^^^^
      ORA-06502: PL/SQL: errore : buffer della stringa di caratteri troppo piccolo di numero o valore
      ORA-06512: a line 32


      Could you kindly help me.
      Thanks in advance for your help
      Best Regards
        • 1. Re: Tomcat - HTTP Status 500 - System Unavailable. Please try again later.
          Udo
          Hi Paolo,

          which APEX version do you use?
          There are only a few reasons that might lead to the behaviour you describe. These are
          - configured header size for Tomcat Connector is too small
          - configured character encoding for Tomcat Connector doesn't fit for APEX (you need UTF-8)
          - you don't have the required version of OWA_UTIL in your XE if you upgraded to a more recent APEX release (e.g. APEX 4.0)

          Have you configured the Tomcat's HTTP Connector to use the appropriate header size and character encoding?
          (see {thread:id=2174509})

          If you've upgraded your XEs APEX, e.g. to 4.0, you also have to update the OWA_UTIL in your XE. APEX versions from 3.0 onwards require at least 10.1.2.0.6, which is the version provided in the installation package. You may just update to that version by changing to the subdirectory owa of your APEX installation package and running
          @owainst.sql
          as sys (just like in the steps before).
          You can check if you have the appropriate version of OWA_UTIL installed by running
          select owa_util.get_version from dual;
          In addition you may also want to check if you performed all steps of this small [url http://www.oracle.com/technetwork/developer-tools/apex/upgrade-apex-for-xe-154969.html]HowTo for the upgrade of APEX in XE databases.

          -Udo
          1 person found this helpful
          • 2. Re: Tomcat - HTTP Status 500 - System Unavailable. Please try again later.
            721224
            Hi Udo,
            thanks a lot for your help,
            I'm using apex version 4.0.0.00.6 with Tomcat 7.0, I checked step by step all your suggestions but the listener seems doesn't work.
            I'm working with the version: 10.1.2.0.6 of owa_util.

            In the oracle XE setting step:
            the point configure SGA and PGA don't work;

            I tried to instal Glass Fish webserver but I have the same problem.

            I forgot to said ... that I installed in one machine server A oracle listener and in another machine server B oracle apex and oracle XE.
            When I connect direct to the server B everything works.


            Please help me because I'm becoming crazy.
            Thanks a lot for your help

            Edited by: PaoloT on 24-feb-2011 16.36
            • 3. Re: Tomcat - HTTP Status 500 - System Unavailable. Please try again later.
              Udo
              Hi Paolo,

              sorry for answering so late.
              So your environment seems to be configured correctly. Perhaps it would help to see the query you want to run. As you said, the error occurs only with certain parameters. Possibly we get a hint when we see what is supposed to happen in that step.

              -Udo
              • 4. Re: Tomcat - HTTP Status 500 - System Unavailable. Please try again later.
                795873
                Hi

                I have exactly the same problem but under GlassFish.
                I have installed 10g (10.2.0.3) with APEX 4.0.1 + GlassFish with Apex Listener + Windows xp.

                Sometimes some pages gives me this error. After restart DB and GlassFish everything works ok during couple hours.
                I have observed this strange behavior only under Windows, under Linux (Debian) everything works fine.


                Pawel