1 2 3 Previous Next 34 Replies Latest reply on Dec 7, 2011 10:32 PM by Udo

    Apex Listener Errors

    Habib
      I am running Apex 4.01 on XE. Operating system is Centos 5.5. Apex Listener version is 1.0.2.238.15.24.

      Running on Tomcat 6. I know it is not supported but I have seen many people running this.

      Few days back I got error while creating Dynamic Action. When creating Standard Dynamic Action, just after putting the name for the dynamic action and pressing Next button following error came:


      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/6.0.26


      Advanced dynamic actions were running correctly. I tried the same instance with mod_plsql (without apex listener) and everything was running fine.

      Some other day an end-user complaint that when he provides login/password on login page the same above mentioned error comes. The other users were not getting this. The first page after login in our application is an interactive report. The difference between the users could be due to a customized interactive report. But the same application was running fine on mod_plsql.

      Next day the same user with the same application could run the application fine with Apex Listener.

      I am wondering is it all due to tomcat or Apex Listener is yet to mature?

      Any thoughts are welcome.

      Habib
        • 1. Re: Apex Listener Errors
          Kris Rice-Oracle
          Did you put it into debug mode? Did you check the log file? If so, please post those so I can look, otherwise there's nothing to look at.

          -kris
          • 2. Re: Apex Listener Errors
            Habib
            Thanks for the reply

            I don't know how to enable debug mode however I found following in catalina.out
            ClientAbortException:  java.net.SocketException: Broken pipe
                    at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:358)
                    at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:354)
                    at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:381)
                    at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:370)
                    at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:89)
                    at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:83)
                    at oracle.dbtools.apex.ModApexContext.write(ModApexContext.java:142)
                    at oracle.dbtools.apex.ModApexContext.write(ModApexContext.java:113)
                    at oracle.dbtools.apex.ModApex.handleRequest(ModApex.java:207)
                    at oracle.dbtools.apex.ModApex.doGet(ModApex.java:84)
                    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
                    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
                    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
                    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:465)
                    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
                    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
                    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
                    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
                    at java.lang.Thread.run(Thread.java:636)
            Caused by: java.net.SocketException: Broken pipe
                    at java.net.SocketOutputStream.socketWrite0(Native Method)
                    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
                    at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
                    at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.java:741)
                    at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:434)
                    at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:349)
                    at org.apache.coyote.http11.InternalOutputBuffer$OutputStreamOutputBuffer.doWrite(InternalOutputBuffer.java:765)
                    at org.apache.coyote.http11.filters.IdentityOutputFilter.doWrite(IdentityOutputFilter.java:127)
                    at org.apache.coyote.http11.InternalOutputBuffer.doWrite(InternalOutputBuffer.java:574)
                    at org.apache.coyote.Response.doWrite(Response.java:560)
                    at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:353)
                    ... 24 more
            
            ***********ERROR***********
            _init_: # headers=47
             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:158
            CALL:
            begin
             f(p=>?);
            commit;
              end;
            BINDS
            
            p:184:5:3352929162927499::NO:::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: numeric or value error: character string buffer too small
            ORA-06512: at line 32
            
            ^^^^^^^^^^^^ERROR^^^^^^^^
            ORA-06502: PL/SQL: numeric or value error: character string buffer too small
            ORA-06512: at line 32
            • 3. Re: Apex Listener Errors
              JoeZ
              Hi
              I got the same errors using APEX 4.0 and 4.0.1 with glassfish 3.0.1 on XP and/or Ubuntu (every possible combination) with Oracle XE on XP or Ubuntu. So it seems not to be a port specific problem.
              Regards
              Joe
              • 4. Re: Apex Listener Errors
                Habib
                Hi JoeZ

                Did you find a solution to this? My server is running quite unreliable because of this. User get the error anytime and it is automatically fixed some other time. Quite strange.
                • 5. Re: Apex Listener Errors
                  JoeZ
                  I would be really happy if I got a solution, but until now .... "welcome to the club"
                  :-(
                  Joe
                  • 6. Re: Apex Listener Errors
                    Habib
                    Today the users are facing the same error but on another page. I can see the following in catalina.out
                    p:184:70:3287847234513193::NO:::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: numeric or value error: character string buffer too small
                    ORA-06512: at line 32
                    
                    ^^^^^^^^^^^^ERROR^^^^^^^^
                    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
                    ORA-06512: at line 32
                    
                    Current Time:   Mon Sep 20 01:28:52 EST 2010<br />
                    Server Uptime:  1 Days 23:21:29.107<br />
                    Total Accesses: 758001.0<br />
                    Total Traffic:  381.26M<br />
                    Total Errors:   531<br />
                    Total File Downloads:   923<br />
                    Total Processing Time:  0 Days 22:48:31.717<br />
                    
                    Processing Time in milliseconds:<br />  Minimum: 0   Average: 108   Median: 44   Maximum: 31<br />
                    Database Time in milliseconds:<br />    Minimum: 0   Average: 97   Median: 40   Maximum: 28<br />
                    Active Requests:        1<br />
                    Connections in the pool apex:
                            Active: 1   Available: 45<br />
                    Security:<br /> Total Entries: 0   Maximum Entries Allowed: 2000<br />
                    Caching Files:<br />    Caching file is disabled.<br />
                    • 7. Re: Apex Listener Errors
                      Habib
                      Hello Kris

                      I will be really thankful if you help me in solving the above issue.

                      Habib
                      • 8. Re: Apex Listener Errors
                        Prabodh
                        Hi Habib,

                        May be you have already done it, trying to verify.
                        1. Have you upgraded OWA_UTIL to 10.1.2.0.6 by running the scripts in apex/woa folder? If not, run owainst.sql in sqlplus as sys
                        2. Have you upgraded the ALL_PROCEDURES package? See http://pear-pdb.blogspot.com/2010/07/apex-listener-and-oracle-xe.html

                        Regards,
                        • 9. Re: Apex Listener Errors
                          Habib
                          Hi Prabodh

                          Thanks a lot for the answer.

                          1. Does not the upgrade to 4.01 run the newer owa packages? I haven't run them manually. So if the upgrade does not do this it can be the cause of the problem.

                          2. ALL_PROCEDURES issue was with the earlier version of Apex Listener. The issues was fixed in later version so I don't think it is needed in my case.

                          Habib
                          • 10. Re: Apex Listener Errors
                            Habib
                            SQL> select owa_util.get_version from dual;

                            GET_VERSION
                            --------------------------------------------------------------------------------
                            10.1.2.0.4


                            Above is the version I have. Should I run the script?
                            • 11. Re: Apex Listener Errors
                              Habib
                              I have run the script and now monitoring the results. Will keep you updated on this.
                              • 12. Re: Apex Listener Errors
                                Habib
                                Hi

                                Even after running OWA script I am still facing the same problems. Here are the latest logs from catalina.out


                                ***********ERROR***********
                                init: # headers=49
                                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:178
                                CALL:
                                begin
                                f(p=>?);
                                commit;
                                end;
                                BINDS

                                p:184:5:2247467739102761::NO:::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: numeric or value error: character string buffer too small
                                ORA-06512: at line 32
                                • 13. Re: Apex Listener Errors
                                  Udo
                                  Hi Habib,

                                  I'm running Apex Listener on Tomcat and still encounter some problems now and then when not using english language. Possibly there are issues with locales and character conversion I haven't fixed yet. But I think, things have improved after adding some more or less configuration-related parts.
                                  The first one is part of the connector configuration in your server.xml. I took this from a formerly published ORACLE document that no longer exists - except in the google cache ;)
                                  Have a look:
                                  http://webcache.googleusercontent.com/search?q=cache:IPCCWQsPbvUJ:www.oracle.com/technetwork/developer-tools/apex/apex-listener-install-web-097739.html
                                  I'd print out that document in order to keep the information in mind that Oracle once (accidently) officially supported Tomcat while having the Lister in EA-status. ;)

                                  There are two relevant aspects for your configuration: The maxHttpHeaderSize and the URIEncoding.
                                  The latter solution needs additional configuration, as noted here:
                                  Re: Accentuated characters problem
                                  It is an ugly hack to patch the war file to support that filter, but it still works with the current release 1.0.2 and as far as I can say, my system is more stable when using that setup. Perhaps it helps you too.

                                  -Udo
                                  • 14. Re: Apex Listener Errors
                                    Habib
                                    Thanks for the help

                                    I have increased maxHttpHeaderSize. Will test it now. The problem with the testing is this problem does not appear always. So I have to keep checking with the users about this.

                                    Thanks again.

                                    Habib
                                    1 2 3 Previous Next