4 Replies Latest reply on Nov 4, 2010 8:29 AM by mecomktg

    Procedure DENIED with Error Code: 404 on APEX Listener with OC4J


      Please help on this.

      I've installed APEX Listener with OC4J on Windows 2003 R2 (64 bit). After completing the instructions on APEX Listener installation with OC4J, I wasn't able to view the Oracle Application Express Login page by accessing http://localhost:9704/apex/apex.

      Please note that I used our existing oc4j (v10.1.3.1) used by BIEE in deploying apex. We have an existing APEX Engine on Oracle 10g Release

      Here's what I did for apex listener with oc4j
      1. download apex listener from oracle site (apex_listener.
      2. unzip apex listener
      3. unpack apex.war and modified web.xml (i change the param value of config.dir to desired location)
      4. repack apex.war using jar -cvf apex.war .
      5. create folder specified in 3
      6. on <oc4j install directory>/j2ee/home/default-web-app, I created folder i and copied all files and its folders from Oracle Application Express images directory (this is from DB server)
      7. login to Application Server Control Console (http://localhost:9704/em)
      8. create Admin and Manager Roles
      9. create adminlistener with Admin roles and managerlistener with Manager roles
      10. deploy apex.war using the instructions ( I uncheck the box for Inherit parent application's shared library imports). apex is listed on the applications and the status displays a green up-arrow.
      11. on the browser, I specify http://localhost:9704/apex/listenerConfigure to display the Application Express Listener Administration
      12. under connection tab, I inputed database connection details and choose basic for connection type.
      13. under security tab, on allowed procedures, I inputed apex*, wwv_*, f, p, n, v, c*, y*, apex_04000.*
      on database validation function I inputed CHECK_VALID_PROCEDURE (please see script below)
      14. under caching tab, on cache settings, I put d:\apex\cachefiles for the cache file location.
      15. under miscellaneous tab, on error reporting, I check on show debug message on console, show error messages on browser, keep most recent error messages and on logging I check keep most recent log messages
      16. click on apply, the url was change to http://localhost:9704/apex/apex but I nothing displays except "The webpage cannot be found" and the name of the tab is "HTTP 404 Not Found"

      Upon checking the log on oc4j, I got the following messages

      10/10/27 10:04:00 Oracle Containers for J2EE 10g ( initialized
      10/10/27 14:38:02 Using Config file:C:\DOCUME~1\SUF200~1\LOCALS~1\Temp\1\\apex\a
      2010-10-27 14:40:09.546 WARNING Error while registering Oracle JDBC Diagnosabili
      ty MBean.
      10/10/27 14:40:10 -- listing properties --
      10/10/27 14:40:10 PropertyCheckInterval=60
      10/10/27 14:40:10 ValidateConnection=true
      10/10/27 14:40:10 MinLimit=1
      10/10/27 14:40:10 MaxLimit=10
      10/10/27 14:40:10 InitialLimit=3
      10/10/27 14:40:10 AbandonedConnectionTimeout=900
      10/10/27 14:40:10 MaxStatementsLimit=10
      10/10/27 14:40:10 InactivityTimeout=1800
      10/10/27 14:40:10 MaxConnectionReuseCount=50000
      10/10/27 14:40:10 APEX Listener version :
      10/10/27 14:40:10 APEX Listener server info: Oracle Containers for J2EE 10g (10.

      ==== doGet()====
      isValidRequest(), procedure name: <apex>
      *** Add procedure to cache: apexAddProc: 359 ms*** Total number of arguments: 1
      ** checkRequestValidationFunction(), <apex> exclude=false
      ** checkInclusionList(), FOUND item match for apex.* for name: apex

      SID:301Parse: 0 ms

      *** Found procedure in cache: apex*** Total number of arguments: 1Exec: 0 ms
      Got results length:0
      ==== Headers from Results ====
      Adding X-DB-Content-length: 0
      H:ACCEPT=image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwav
      e-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/ms
      word, */*
      H:USER-AGENT=Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NE
      T CLR 1.1.4322; .NET CLR 2.0.50727)
      H:ACCEPT-ENCODING=gzip, deflate
      Cookie:JSESSIONID = 0a00989725e8f046d39d37db4b2da636f4617e4ce8e6

      ==== doGet()====
      isValidRequest(), procedure name: <f>
      *** Add procedure to cache: fAddProc: 203 ms*** Total number of arguments: 0
      Procedure DENIED with Error code:404

      CREATE OR REPLACE FUNCTION APEX_040000.check_valid_procedure (
      procedure_name IN VARCHAR2
      v_procedure_name VARCHAR2 (100);
      -- return true;
      v_procedure_name := LOWER (procedure_name);
      -- Don't touch this
      IF v_procedure_name IN ('p', 'n', 'f')
      OR v_procedure_name LIKE 'wwv_flow%'
      OR v_procedure_name LIKE 'apex%'
      END IF;
      -- Add custom functions here
      IF v_procedure_name IN ('idev_test.dwet_download_my_file')
      END IF;
      END check_valid_procedure;

      Thank you
        • 1. Re: Procedure DENIED with Error Code: 404 on APEX Listener with OC4J

          does the URL http://localhost:9704/apex work?
          I think the problem is that you have apex* as allowed procedure but you probably don't have a procedure "apex" in your database. In the default configuration /apex/apex redirects you to the same index you would get when calling just /apex, but it seems the allowed procedures overwrite this alias.
          You could try to run without all the security "enhancement" to use a database validation function and setting up allowed procedures. As the installation manual says, this is optional (and the APEX-internal validation will persist).

          • 2. Re: Procedure DENIED with Error Code: 404 on APEX Listener with OC4J
            Hi Udo,

            The URL http://localhost:9704/apex does not work. I've tried to run without all the security "enhancement" (I deleted the all data on inclusion list value for allowed procedures and validation function for database validation function) and when I hit apply button it went to url http://localhost:9704/apex/apex but I can't see the APEX Login page. It shows me "The webpage cannot be found".
            Also I check our database and there was procedure apex, f, p under APEX_04000 schema. I found out that APEX_PUBLIC_USER is connected to the database everytime I use http://localhost:9704/apex. Why can't I see the APEX Login page?

            • 3. Re: Procedure DENIED with Error Code: 404 on APEX Listener with OC4J
              Hi Ben,

              could you provide the log for the current 404? After you removed the allowed procedures etc. it should look different from the one you posted above.
              If you see the connection being opened, this probably is no network issue. Did you check the APEX_PUBLIC_USER is unlocked and the password is setup correctly? May there exist any password change rule in your database that also affects the APEX_PUBLIC_USER?
              You say, the APEX instance you are trying to access is running. How did you manage to access it before the Listener installation (i.e., which other web server (OHS, EPG) did you use)?

              • 4. Re: Procedure DENIED with Error Code: 404 on APEX Listener with OC4J
                Hi Udo,

                We tried to drop the existing APEX on our database then reinstall the APEX engine. Copied the Apex images to the server where OC4J resides then followed the instructions on APEX Listener with OC4J. Now, everything works fine. I can now see the APEX Login Page.