4 Replies Latest reply: Dec 21, 2011 9:59 AM by 728847 RSS

    ERR-7620 - Could not determine workspace for application

    728847
      Hi All,

      "Anychart" using AJAX callback fails with *"sqlerrm:ORA-20876: Stop APEX Engine"* Error. When I click on this error in my firebug tool, I get the below error.

      Error-720 Could not Determine the workspace for the application.

      Our applications (which has Anycharts) work fine in 3.2, but when migrated to 4.1 throws the above error. I'm using Ajax call back to build the xml.
      After so many retries, and help with firebug, I was able to identify the source of the problem, it was the last line of the AJAX callback code which was the source for the error.

           htmldb_application.g_unrecoverable_error := true;


      Here's the AJAX code:
      DECLARE
      l_total NUMBER ;
      l_filer varchar2(200);
      BEGIN
           OWA_UTIL.mime_header ('text/xml', FALSE);
           OWA_UTIL.http_header_close;
           HTP.p ('<?xml version = "1.0" encoding="utf-8" standalone = "yes"?>');
           HTP.P('<anychart>');
              -- HTP.p ('<margin all="0"/>');
                HTP.P('<settings>');
                     HTP.P('<animation enabled="True"/>');
                HTP.P('</settings>');
           HTP.P('<charts>');
                HTP.P('<chart plot_type="CategorizedVertical">');
                     HTP.P('<data_plot_settings default_series_type="Bar">');
                          HTP.P('<bar_series group_padding="0.3" shape_type="Cylinder">');
                               HTP.P('<tooltip_settings enabled="True">');
                                    HTP.P('<background>');
                                         HTP.P('<border color="DarkColor(%Color)"/>');
                                    HTP.P('</background>');
           HTP.P('<format>');
           HTP.P('{%SeriesName} ({%YValue}{numDecimals:0} GB)');
           HTP.P('{%YPercentOfCategory}{numDecimals:1}% Of Filer Storage');
           HTP.P('</format>');
                               HTP.P('</tooltip_settings>');
                               HTP.P('<bar_style>');
                                    HTP.P('<effects>');
                                         HTP.P('<bevel enabled="false"/>');
                                    HTP.P('</effects>');
                               HTP.P('</bar_style>');
                          HTP.P('</bar_series>');
                     HTP.P('</data_plot_settings>');
                     HTP.P('<data>');
                          FOR cFILER IN (     SELECT * FROM     XYZ......                              
      
                               ------- 
                                                         -----
                                                                      -------
       
                                    )
                          LOOP
                               ------- 
                                                         -----
                                                                      -------
                          END LOOP;
                     HTP.P('</data>');
                     HTP.P('<chart_settings>');
                     --HTP.p ('<chart_background enabled="false"/>');
                          HTP.P('<title  position="top" align_by="Chart"  align ="Near" enabled="true"><font underline="true"/>');
                          HTP.P('<text> Filer - Total Capacity</text>');
                          HTP.P('</title>');
                          HTP.P('<subtitle position="top" align_by="Chart" align ="Near" enabled="true">');
                               HTP.P('<background enabled="false"/>');
                               HTP.P('<text> ' || l_filer ||  ' (' ||  l_total || ' GB)</text>');
                          HTP.P('</subtitle>');
                          HTP.P('<legend enabled="true" position="Right" align="Spread" ignore_auto_item="true" padding="2" width = "80%">');
                               HTP.P('<format>{%Icon} {%SeriesName} ({%YValue}{numDecimals:2} GB)</format>');
                               HTP.P('<title enabled="true">');
                                    HTP.P('<text>Distribution of Storage</text>');
                               HTP.P('</title>');
                               HTP.P('<columns_separator enabled="False"/>');
                               HTP.P('<items>');
                                    HTP.P('<item source="Points"/>');
                               HTP.P('</items>');
                          HTP.P('</legend>');
                          HTP.P('<axes>');
                                    HTP.P('<y_axis enabled="False">');
                                         HTP.P('<major_tickmarks enabled="False" />');
                                         HTP.P('<minor_tickmarks enabled="False" />');
                                         HTP.P('<scale mode="PercentStacked"/>');
                                    HTP.P('</y_axis>');
                                HTP.P('<x_axis enabled="False">');
                                HTP.P('</x_axis>');
                          HTP.P('</axes>');
                     HTP.P('</chart_settings>');
                HTP.P('</chart>');
           HTP.P('</charts>');
           HTP.P('</anychart>');    
           htmldb_application.g_unrecoverable_error := true;
      END;
      If I comment out the last line in the Code the Chart seems to be working fine. Just wondering why this a problem in 4.1 and works well in 3.2 ??? Any ideas ??

      We have so many Applications using Anycharts (using AJAX call backs), so modifying "All" would be a lot of effort.

      Thanks!
      Chandu
        • 1. Re: ERR-7620 - Could not determine workspace for application
          728847
          Instead of an AJAX process I created a "before Header" process in the page, and it works great !

          I have included
          htmldb_application.g_unrecoverable_error := true;
          If I comment out this line from the "before Header" process, I get an "XML parser error" .. Somehow the process behaves differently if using Ajax calls vs the page process.
          when Using AJAX to build it doesn't like the statement being included whereas in a "page process" it needs that statement to tell xml tag build was complete and forcefully shut the APEX engine.

          Can someone please help?

          Thanks!
          • 3. Re: ERR-7620 - Could not determine workspace for application
            Patrick Wolf-Oracle
            Hi Chandu,

            I was able to reproduce your issue and have filed bug# 13524990 which we plan to fix in 4.1.1.

            About your question why does it work in a process of type "Before Header" and not in a "On Demand" process.

            *"Before Header" processes* are designed to be used as part of the page rendering. So multiple processes of this type or other types will fire during rendering of the page.
            With apex_application.stop_apex_engine; (the new supported and documented API) or apex_application.g_unrecoverable_error := true; (that's the old not documented way) it's possible to tell the APEX engine that it should stop after the current process and not continue the page rendering.

            *"On Demand" processes* are designed to be called with an AJAX call, and only the specified process will fire. So we didn't really expect that someone is using apex_application.g_unrecoverable_error in there because the process will stop anyway. We will fix that in 4.1.1.

            Workarounds:

            1) Remove the apex_application.g_unrecoverable_error from all your on-demand processes
            2) If there are too many, you could also export your application so that you get a text file and just replace htmldb_application.g_unrecoverable_error := true; with an empty string and then re-import the application again. That should be quicker if you really have a huge number of on-demand processes.

            Regards
            Patrick
            -----------
            My Blog: http://www.inside-oracle-apex.com
            APEX Plug-Ins: http://apex.oracle.com/plugins
            Twitter: http://www.twitter.com/patrickwolf
            • 4. Re: ERR-7620 - Could not determine workspace for application
              728847
              Thanks Patrick for your help. Will look into the workarounds you suggested and evaluate which one will work for us better.

              I was expecting the same behavior in 4.1 as in 3.2. Our On Demand processes (AJAX) use the *apex_application.g_unrecoverable_error := true;
              in the process definition. Also, I have seen there are a lot of posts on this forum to use this statement to explicitly stop the APEX engine rendering. It might be a different version from 4.1.

              Anyways, thanks for your time. Appreciated your help !!

              -Chandu