3 Replies Latest reply on Apr 19, 2013 12:16 PM by Klaus Linhard

    Restful webservice 404 not found

    Klaus Linhard

      i am running the following configuration:

      Oracle Database
      Application Express 4.2.1
      apex_listener. on Glassfish 3.01

      Everything works fine except the restful webservices. In SQL-WorkShop when i create a simple GET webservice and klick on "Test"
      " 404 not found" comes up in the browser.

      In the log i can see:

      Request Path passes syntax validation
      Mapping request to database pool: PoolMap [_poolName=apex, _regex=null, _workspaceIdentifier=null, _failed=false, _lastUpdate=-1, _template=null, _type=REGEX]
      Applied database connection info
      Attempting to process with PL/SQL Gateway
      Not processed as PL/SQL Gateway request
      Attempting to process as a RESTful Service
      Determining if request can be dispatched as a Tenanted RESTful Service
      Request path has one path segment, continuing processing
      No Tenant Principal established yet, continuing processing
      APEX_LISTENER pool exists, continuing processing
      No matching tenant found for: ifc, cannot dispatch
      No candidate found for: GET ifc/certification in context: http://localhost:8080/apex/

      Thanks for your help !

      Kind Regards

      Edited by: user1705445 on Apr 18, 2013 5:02 AM

      Edited by: user1705445 on Apr 18, 2013 5:30 AM

      Edited by: user1705445 on Apr 18, 2013 5:56 AM
        • 1. Re: Restful webservice 404 not found
          Colm Divilly-Oracle
          Hi Klaus,
          to help diagnose the issue can you provide a full description of the RESTful Service include all the fields in the Resource Module,Template and Handler, especially:

          - The name of the workspace where the Resource Module is defined
          - The URL prefix of the Resource Module
          - The URI Template of the Resource Template
          - The HTTP Method of the Resource Handler
          - The SQL/PL-SQL of the Resource Handler

          Can you also provide the path-prefix of the workspace (Administration|Manage Service|Set Workspace Preferences|SQL Workshop|Path Prefix) and if you have defined any database mappings, the contents of url-mapping.xml
          • 2. Re: Restful webservice 404 not found
            Klaus Linhard
            Hello Colm,
            thanks for your quick response.

            Here is the description of the restful service:

            RESTful Service Module: certification
            URI Template: certification
            URI Prefix of the Resource Module: -- (empty)
            Priority: 0
            Entity Tag: Secure Hash

            Method: GET
            SourceType: Query
            Format: JSON
            RequireSecureAccess: No
            Source: select * from ifc.certification_status

            Name of the workspace where the Resource Module is defined: ifc
            path-prefix of the workspace : IFC
            Ther is just the defaults.xml and no url-mapping.xml because there is only one database

            <?xml version="1.0" encoding="UTF-8" standalone="no"?>
            <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
            <comment>Saved on Thu Apr 18 10:37:05 CEST 2013</comment>
            <entry key="security.disableDefaultExclusionList">false</entry>
            <entry key="db.password">@05142611FB956BD8CEEF379FA151BD370DC0D92C2D14665E29</entry>
            <entry key="cache.maxEntries">500</entry>
            <entry key="error.maxEntries">50</entry>
            <entry key="security.maxEntries">2000</entry>
            <entry key="cache.directory">/tmp/apex/cache</entry>
            <entry key="jdbc.DriverType">thin</entry>
            <entry key="log.maxEntries">50</entry>
            <entry key="db.hostname"></entry> -- not the used IP-Address
            <entry key="jdbc.MaxConnectionReuseCount">1000</entry>
            <entry key="log.logging">false</entry>
            <entry key="jdbc.InitialLimit">3</entry>
            <entry key="jdbc.MaxLimit">10</entry>
            <entry key="cache.monitorInterval">60</entry>
            <entry key="cache.expiration">7</entry>
            <entry key="jdbc.statementTimeout">900</entry>
            <entry key="jdbc.MaxStatementsLimit">10</entry>
            <entry key="db.sid">ORCL1</entry>
            <entry key="misc.defaultPage">apex</entry>
            <entry key="misc.compress"/>
            <entry key="jdbc.MinLimit">1</entry>
            <entry key="cache.type">lru</entry>
            <entry key="cache.caching">false</entry>
            <entry key="db.port">1521</entry>
            <entry key="error.keepErrorMessages">true</entry>
            <entry key="cache.procedureNameList"/>
            <entry key="cache.duration">days</entry>
            <entry key="jdbc.InactivityTimeout">1800</entry>
            <entry key="debug.debugger">false</entry>
            <entry key="security.verifySSL">false</entry>
            <entry key="debug.printDebugToScreen">true</entry>

            The connection to the database from apex.xml:
            <entry key="db.username">APEX_PUBLIC_USER</entry>

            Thanks again for your help !


            Edited by: Klaus Linhard on Apr 18, 2013 11:28 PM
            • 3. Re: Restful webservice 404 not found
              Klaus Linhard
              Got it working !

              The url-mapping.xml was missing.

              <?xml version="1.0" encoding="UTF-8"?>
              <pool-config xmlns="http://xmlns.oracle.com/apex/pool-config">
              <pool base-path="/ifc" name="apex" workspace-id="ifc"/>

              "apex" => Default database connection
              "/ifc" => where ifc=PathPrefix (Set Workspace Preferences)
              "ifc" => workspace-id

              Anyway thanks for your help !