5 Replies Latest reply on Aug 7, 2020 2:45 PM by thatJeffSmith-Oracle

    ORDS 19.4 URI Prefix issue

    2943348

      we are using Oracle DB 19c and ORDS version 19.4

      at this new version of ORDS we got issue when we try to hit one of our service which has uri prefix: /ui/*

      the error msg is: The specified resource path does not exist or is not accessible: /ui/category.html

       

      ResourceNotFoundException [statusCode=404, reasons=[The specified resource path does not exist or is not accessible: /ui/category.html]]

      at oracle.dbtools.http.resources.HttpResourceHandlerImpl.checkTrailingSlash(HttpResourceHandlerImpl.java:175)

      at oracle.dbtools.http.resources.HttpResourceHandlerImpl.service(HttpResourceHandlerImpl.java:105)

      at oracle.dbtools.rt.ResourceTemplatesResources.doGet(ResourceTemplatesResources.java:83)

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)

      at oracle.dbtools.plugin.api.servlet.HttpServletBase.service(HttpServletBase.java:86)

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

      at oracle.dbtools.http.servlet.DispatchableServletAdaptor.service(DispatchableServletAdaptor.java:147)

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

      at oracle.dbtools.http.servlet.DispatchableServletBase.service(DispatchableServletBase.java:58)

      at oracle.dbtools.http.entrypoint.Dispatcher.dispatch(Dispatcher.java:143)

      at oracle.dbtools.http.entrypoint.EntryPoint$FilteredServlet.service(EntryPoint.java:243)

      at oracle.dbtools.http.filters.FilterChainImpl.doFilter(FilterChainImpl.java:73)

      at oracle.dbtools.http.forwarding.QueryFilteringRewrite.doFilter(QueryFilteringRewrite.java:90)

      at oracle.dbtools.http.filters.HttpFilter.doFilter(HttpFilter.java:47)

      at oracle.dbtools.http.filters.FilterChainImpl.doFilter(FilterChainImpl.java:64)

      at oracle.dbtools.http.forwarding.ForwardingFilter.doFilter(ForwardingFilter.java:68)

      at oracle.dbtools.http.filters.HttpFilter.doFilter(HttpFilter.java:47)

      at oracle.dbtools.http.filters.FilterChainImpl.doFilter(FilterChainImpl.java:64)

      at oracle.dbtools.http.cors.CORSPreflightFilter.doFilter(CORSPreflightFilter.java:68)

      at oracle.dbtools.http.filters.HttpFilter.doFilter(HttpFilter.java:47)

      at oracle.dbtools.http.filters.FilterChainImpl.doFilter(FilterChainImpl.java:64)

      at oracle.dbtools.http.cookies.auth.CookieSessionCSRFFilter.doFilter(CookieSessionCSRFFilter.java:71)

      at oracle.dbtools.http.filters.HttpFilter.doFilter(HttpFilter.java:47)

      at oracle.dbtools.http.filters.FilterChainImpl.doFilter(FilterChainImpl.java:64)

      at oracle.dbtools.http.auth.AuthenticationFilter.authenticate(AuthenticationFilter.java:101)

      at oracle.dbtools.http.auth.AuthenticationFilter.doFilter(AuthenticationFilter.java:64)

      at oracle.dbtools.http.filters.HttpFilter.doFilter(HttpFilter.java:47)

      at oracle.dbtools.http.filters.FilterChainImpl.doFilter(FilterChainImpl.java:64)

      at oracle.dbtools.url.mapping.RequestMapperImpl.doFilter(RequestMapperImpl.java:160)

      at oracle.dbtools.url.mapping.URLMappingBase.doFilter(URLMappingBase.java:95)

      at oracle.dbtools.url.mapping.filter.URLMappingFilter.doFilter(URLMappingFilter.java:130)

      at oracle.dbtools.http.filters.HttpFilter.doFilter(HttpFilter.java:47)

      at oracle.dbtools.http.filters.FilterChainImpl.doFilter(FilterChainImpl.java:64)

      at oracle.dbtools.http.auth.external.ExternalSessionFilter.doFilter(ExternalSessionFilter.java:59)

      at oracle.dbtools.http.filters.HttpFilter.doFilter(HttpFilter.java:47)

      at oracle.dbtools.http.filters.FilterChainImpl.doFilter(FilterChainImpl.java:64)

      at oracle.dbtools.rt.authentication.apex.ApexSessionQueryRewriteFilter.doFilter(ApexSessionQueryRewriteFilter.java:58)

      at oracle.dbtools.http.filters.HttpFilter.doFilter(HttpFilter.java:47)

      at oracle.dbtools.http.filters.FilterChainImpl.doFilter(FilterChainImpl.java:64)

      at oracle.dbtools.http.cors.CORSResponseFilter.doFilter(CORSResponseFilter.java:88)

      at oracle.dbtools.http.filters.HttpResponseFilter.doFilter(HttpResponseFilter.java:45)

      at oracle.dbtools.http.filters.FilterChainImpl.doFilter(FilterChainImpl.java:64)

      at oracle.dbtools.http.filters.AbsoluteLocationFilter.doFilter(AbsoluteLocationFilter.java:65)

      at oracle.dbtools.http.filters.HttpResponseFilter.doFilter(HttpResponseFilter.java:45)

      at oracle.dbtools.http.filters.FilterChainImpl.doFilter(FilterChainImpl.java:64)

      at oracle.dbtools.http.errors.ErrorPageFilter.doFilter(ErrorPageFilter.java:85)

      at oracle.dbtools.http.filters.HttpFilter.doFilter(HttpFilter.java:47)

      at oracle.dbtools.http.filters.FilterChainImpl.doFilter(FilterChainImpl.java:64)

      at oracle.dbtools.http.secure.ForceHttpsFilter.doFilter(ForceHttpsFilter.java:74)

      at oracle.dbtools.http.filters.HttpFilter.doFilter(HttpFilter.java:47)

      at oracle.dbtools.http.filters.FilterChainImpl.doFilter(FilterChainImpl.java:64)

      at oracle.dbtools.http.auth.ForceAuthFilter.doFilter(ForceAuthFilter.java:44)

      at oracle.dbtools.http.filters.HttpFilter.doFilter(HttpFilter.java:47)

      at oracle.dbtools.http.filters.FilterChainImpl.doFilter(FilterChainImpl.java:64)

      at oracle.dbtools.http.filters.Filters.filter(Filters.java:67)

      at oracle.dbtools.http.entrypoint.EntryPoint.service(EntryPoint.java:82)

      at oracle.dbtools.http.entrypoint.EntryPointServlet.service(EntryPointServlet.java:102)

      at oracle.dbtools.entrypoint.WebApplicationRequestEntryPoint.service(WebApplicationRequestEntryPoint.java:50)

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:286)

      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)

      at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137)

      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:350)

      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:247)

      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3702)

      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3672)

      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:328)

      at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)

      at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)

      at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)

      at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2443)

      at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2291)

      at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2269)

      at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1705)

      at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1665)

      at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:272)

      at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)

      at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)

      at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)

      at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)

      at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:652)

      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:420)

      at weblogic.work.ExecuteThread.run(ExecuteThread.java:360)

       

      can anybody please give us some insight about this issue.

      Thank You

        • 1. Re: ORDS 19.4 URI Prefix issue
          thatJeffSmith-Oracle

          What's the intent of a pattern like that, and what the code behind your service? Or is this a static resource thing (img/file) ?

          • 2. Re: ORDS 19.4 URI Prefix issue
            2943348

            i use this pattern in my application to generate the ui so my pattern is /ui/*

            i have try to change the pattern to "uii" and it works, just "ui" that get error

            is there any reserved words for uri prefix in ords?

            sample code:

            BEGIN

              ORDS.ENABLE_SCHEMA(

                  p_enabled             => TRUE,

                  p_schema              => 'ORDS',

                  p_url_mapping_type    => 'BASE_PATH',

                  p_url_mapping_pattern => 'ords',

                  p_auto_rest_auth      => FALSE);   

             

             

              ORDS.DEFINE_MODULE(

                  p_module_name    => 'ui',

                  p_base_path      => '/ui/',

                  p_items_per_page =>  25,

                  p_status         => 'PUBLISHED',

                  p_comments       => NULL);     

              ORDS.DEFINE_TEMPLATE(

                  p_module_name    => 'ui',

                  p_pattern        => 'category',

                  p_priority       => 0,

                  p_etag_type      => 'HASH',

                  p_etag_query     => NULL,

                  p_comments       => NULL);

              ORDS.DEFINE_HANDLER(

                  p_module_name    => 'ui',

                  p_pattern        => 'category',

                  p_method         => 'GET',

                  p_source_type    => 'plsql/block',

                  p_items_per_page =>  25,

                  p_mimes_allowed  => '',

                  p_comments       => NULL,

                  p_source         =>

            'BEGIN

               get_metadata_by_category(

                    p_SUPER_CATEGORY => :SUPER_CATEGORY,

                    p_out => :output,

                    status => :p_status

                );

            COMMIT;

            END;'

                  );

              ORDS.DEFINE_PARAMETER(

                  p_module_name        => 'ui',

                  p_pattern            => 'category',

                  p_method             => 'GET',

                  p_name               => 'X-APEX-STATUS-CODE',

                  p_bind_variable_name => 'p_status',

                  p_source_type        => 'HEADER',

                  p_param_type         => 'INT',

                  p_access_method      => 'OUT',

                  p_comments           => NULL);     

              ORDS.DEFINE_PARAMETER(

                  p_module_name        => 'ui',

                  p_pattern            => 'category',

                  p_method             => 'GET',

                  p_name               => 'output',

                  p_bind_variable_name => 'output',

                  p_source_type        => 'RESPONSE',

                  p_param_type         => 'RESULTSET',

                  p_access_method      => 'OUT',

                  p_comments           => NULL);     

              ORDS.DEFINE_HANDLER(

                  p_module_name    => 'ui',

                  p_pattern        => 'category',

                  p_method         => 'POST',

                  p_source_type    => 'plsql/block',

                  p_items_per_page =>  0,

                  p_mimes_allowed  => '',

                  p_comments       => NULL,

                  p_source         =>

            'BEGIN

                INSERT_ATTRIBUTE(

                    p_ATTR_NAME => :ATTR_NAME,

                    p_NOT_NULL => :NOT_NULL,

                    p_NOT_NULL_MSG => :NOT_NULL_MSG,

                    p_IS_REQUIRED => :IS_REQUIRED,

                    p_IS_HIDDEN => :IS_HIDDEN,

                    p_OBJECT_TYPE => :OBJECT_TYPE,

                    p_LABEL_TEXT => :LABEL_TEXT,

                    p_OBJECT_CATEGORY => :OBJECT_CATEGORY,

                    p_IS_SEARCHABLE => :IS_SEARCHABLE,

                    p_IS_VIEWABLE_ADD => :IS_VIEWABLE_ADD,

                    p_IS_VIEWABLE_EDIT => :IS_VIEWABLE_EDIT,

                    p_out => :object_id,

                    status => :p_status,

                    errCode => :p_errCode,

                    errMsgEn => :p_errMsgEn,

                    errMsgId => :p_errMsgId

                );

            END;'

                  );

              ORDS.DEFINE_PARAMETER(

                  p_module_name        => 'ui',

                  p_pattern            => 'category',

                  p_method             => 'POST',

                  p_name               => 'X-APEX-STATUS-CODE',

                  p_bind_variable_name => 'p_status',

                  p_source_type        => 'HEADER',

                  p_param_type         => 'INT',

                  p_access_method      => 'OUT',

                  p_comments           => NULL);     

              ORDS.DEFINE_PARAMETER(

                  p_module_name        => 'ui',

                  p_pattern            => 'category',

                  p_method             => 'POST',

                  p_name               => 'error_code',

                  p_bind_variable_name => 'p_errCode',

                  p_source_type        => 'RESPONSE',

                  p_param_type         => 'STRING',

                  p_access_method      => 'OUT',

                  p_comments           => NULL);     

              ORDS.DEFINE_PARAMETER(

                  p_module_name        => 'ui',

                  p_pattern            => 'category',

                  p_method             => 'POST',

                  p_name               => 'error_message_english',

                  p_bind_variable_name => 'p_errMsgEn',

                  p_source_type        => 'RESPONSE',

                  p_param_type         => 'STRING',

                  p_access_method      => 'OUT',

                  p_comments           => NULL);     

              ORDS.DEFINE_PARAMETER(

                  p_module_name        => 'ui',

                  p_pattern            => 'category',

                  p_method             => 'POST',

                  p_name               => 'error_message_indonesian',

                  p_bind_variable_name => 'p_errMsgId',

                  p_source_type        => 'RESPONSE',

                  p_param_type         => 'STRING',

                  p_access_method      => 'OUT',

                  p_comments           => NULL);     

              ORDS.DEFINE_PARAMETER(

                  p_module_name        => 'ui',

                  p_pattern            => 'category',

                  p_method             => 'POST',

                  p_name               => 'object_id',

                  p_bind_variable_name => 'object_id',

                  p_source_type        => 'RESPONSE',

                  p_param_type         => 'STRING',

                  p_access_method      => 'OUT',

                  p_comments           => NULL);     

             

              COMMIT;

            END;

             

            ths service is used to get some metadata that i store in the database

            • 3. Re: ORDS 19.4 URI Prefix issue
              EJ-Egyed

              What version of ORDS did you upgrade from?  I'm not 100% sure that this is your issue, but the parameter X-APEX-STATUS-CODE you are using has been deprecated since ORDS 18.3.  It has been replaced with X-ORDS-STATUS-CODE. It might be worth changing the name of your parameters to the new name to see if it resolves your error.

               

              Another way to set the HTTP status code is to just use the bind variable :status_code since in ORDS 18.3, it was introduced as an implicit parameter.  This way you can just replace :p_status with :status_code and not need to define any parameter for that bind variable and ORDS will set the HTTP status code properly.

               

              ORDS 18.3 documentation for implicit parameters: https://docs.oracle.com/en/database/oracle/oracle-rest-data-services/18.3/aelig/implicit-parameters.html#GUID-B0BB1694-7…

              thatJeffSmith-Oracle's blog about X-APEX-STATUS-CODE being deprecated (You only need to read the info before Part One): https://www.thatjeffsmith.com/archive/2018/10/x-ords-forward-ords-response-forward-to-another-resource/

              • 4. Re: ORDS 19.4 URI Prefix issue
                2943348

                I don't think it's the issue, because i got the error when i try to hit the service, not when i try to consume the result.

                Thank you for the information, i have try it and it works well at my other services but at "/ui/*" service still got the same error.

                • 5. Re: ORDS 19.4 URI Prefix issue
                  thatJeffSmith-Oracle

                  I understand now

                   

                  In fact, /ui/ is reserved by ORDS itself, as it's used to serve up our oauth2 stuff.

                   

                  I need to file a doc/API bug that 1, this list of reserved patterns needs documented and 2, the ords api needs to prevent you from publishing user based services under these reserved patterns.