7 Replies Latest reply on Sep 2, 2015 9:13 PM by rgm83

    Theme roller generated CSS not found by ORDS

    John OToole (Dublin)

      APEX 5.0.0.00.31

       

      On my laptop, using embedded gateway configuration, I used theme roller to create a custom style and applied that to the application.  All looked good.

      I then exported the application and imported into another 5.0 environment which is using Oracle Rest Data Services.  Now I don't see the new style.  I get the following in the browser console:

       

      Failed to load resource: the server responded with a status of 503 (Service Unavailable)   http://<server>:<port>/ords/<workspace>/r/116/files/theme/42/v68/1889876851261765.css

       

      In Application Builder, if I go to:

      Application 116 > Shared Components > Themes > Create / Edit Theme

      Files.PNG

      The "Download" url is:

      http://<server>:<port>/ords/apex_util.get_blob_file?a=4000&s=6485134348914&p=227&d=22506724090040885&i=22503017727040865&p_pk1=1887365588206702&p_pk2=3110812980383996&p_ck=PQdgsTwwRnWcNJvzk6ZKew3QARo&p_content_disposition=attachment

      If I click on this I get to the CSS ok.

       

      Any idea what I'm doing wrong?

       

      Thanks,

      John

       

      Message was edited by: John OToole (Dublin) Added an image.

        • 1. Re: Theme roller generated CSS not found by ORDS
          Patrick Wolf-Oracle

          Hi John,

           

          using the 'Download' link in Edit Theme is using a different mechanism to download the file then when it's referenced in your application, that's why it's working.

           

          I do wonder if Static Application files work at all in your ORDS environment. When you upload an image as Static Application File in Shared Components -> Static Application Files and you reference that image in a 'Static Content' region within your application with

           

          <img src="#APP_IMAGES#name_of_image.jpg">
          
          
          

           

          Does that work? Do you see the image when you run the page?

           

          Another question, when you login into the Builder, are you getting a dialog box which talks about a missconfiguration and you should consult the Install Guide chapter 'Static File Support'?

           

          Regards

          Patrick


          Member of the APEX development team

          1 person found this helpful
          • 2. Re: Theme roller generated CSS not found by ORDS
            John OToole (Dublin)

            Thanks for getting back to me Patrick.

             

            >using the 'Download' link in Edit Theme is using a different mechanism to download the file then when it's referenced in your application, that's why it's working

            Ok, makes sense.

             

            >I do wonder if Static Application files work at all in your ORDS environment.

            No, I can't get that to work.  Statis Application files don't seem to be working at all in my ORDS environment. 


            >Another question, when you login into the Builder, are you getting a dialog box which talks about a missconfiguration and you should consult the Install Guide chapter 'Static File Support'?

            No.  Although I did after I installed ORDS 2.0.10.289.08.09 initially last week.  I then followed the steps in http://docs.oracle.com/cd/E59726_01/install.50/e39144/listener.htm#HTMIG29159

            to resolve it.  The message went away and now today I've noticed that statis files aren't working.


            I think I'll reinstall ORDS completely in case there is some issue with it.

            • 3. Re: Re: Theme roller generated CSS not found by ORDS
              John OToole (Dublin)

              I'm still getting this issue after a reinstall of ORDS 2.0.10.289.08.09.

              I've followed the steps in "4.7.2 Configuring RESTful Services" by running "@apex_rest_config.sql" and opening the ACL wide open for APEX_050000

              SQL> select dna.acl, dna.host, dna.lower_port, dna.upper_port, dnap.principal, dnap.privilege
                2  from dba_network_acls dna, dba_network_acl_privileges dnap
                3  where dna.acl = dnap.acl
                4  and dnap.principal = 'APEX_050000';
              
              
              ACL                            HOST                          LOWER_PORT UPPER_PORT PRINCIPAL              PRIVILE
              ------------------------------ ------------------------------ ---------- ---------- ------------------------------
              /sys/acls/power_users.xml      *                                                    APEX_050000            connect
              

               

              So while I can run my application ok from:

              http://<server>:<port>/ords/f?p=116

              I can't access the CSS or other static files I would need such as:

              http://<server>:<port>/ords/lps/r/116/files/theme/42/v68/1889876851261765.css

               

              Maybe I need to sleep on it.

              • 4. Re: Re: Re: Theme roller generated CSS not found by ORDS
                John OToole (Dublin)

                Ok, I got around this problem as follows:

                Once I'd finished up defining the new CSS using theme roller, I downloaded it from:

                Application 116 > Shared Components > Themes > Create / Edit Theme > Files


                I renamed it to "my_projejct.css" and dropped it into the \apex\images\css folder on my ORDS install. 


                Then in: Application 116 > Shared Components > Themes > Create / Edit Theme > Theme Styles

                I change "Output CSS File URL" from "#THEME_DB_IMAGES#10270192496933606.css" to "/i/css/my_project.css"

                 

                Now the style works.  I suspect this wasn't all necessary, but I couldn't get it to work any other way.

                 

                John

                • 5. Re: Theme roller generated CSS not found by ORDS
                  vuvarov-Oracle

                  Hi John,

                   

                  Do RESTful services actually work in your ORDS instance? Go to SQL Workshop > RESTful Services > oracle.example.hr, select "GET" method under "employees/", and click the "Test" button. Click "Reset Sample Data" link on the right on the RESTful Services page if you don't have this sample service.

                   

                  Do you see any errors in the ORDS console log file when accessing a Static File or a RESTful Service and receiving the 503 error? This blog by Colm has instructions about configuring logging in ORDS.

                   

                  P.S. Network ACL is not needed by the Static Files feature.

                   

                  Thanks,

                  Vlad

                  • 6. Re: Re: Theme roller generated CSS not found by ORDS
                    John OToole (Dublin)

                    Thanks for replying Vlad.

                     

                    I turned on ORDS console logging by setting:

                    <entry key="debug.debugger">true</entry>
                    <entry key="debug.printDebugToScreen">true</entry>
                    

                    in defaults.xml

                     

                    Then I tried to test the "GET" method under "employees/" as you suggested.  It failed with this error:

                     

                    Request Path passes syntax validation

                    Mapping request to database pool: PoolMap [_failed=false, _lastUpdate=1430175600000, _pattern=/test/, _poolName=apex, _regex=null, _type=BASE_PATH, _workspaceIdentifier=TEST, _serviceName=null]

                    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

                    hr/employees/ matches: hr/employees/ score: 0

                    Choosing: oracle.dbtools.rt.resource.templates.jdbc.JDBCResourceTemplateDispatcher as current candidate with score: Score [handle=JDBCURITemplate [scopeId=null, templateId=1910710916755648|1911381025755840, uriTemplate=hr/employees/], score=0, scope=SecurityConfig [constraint=none, realm=NONE, logonConfig=NONE], originsAllowed=[], corsEnabled=true]

                    Determining if request can be dispatched as a Tenanted RESTful Service

                    Request path has one path segment, continuing processing

                    Tenant Principal already established, cannot dispatch

                    Chose oracle.dbtools.rt.resource.templates.jdbc.JDBCResourceTemplateDispatcher as the final candidate with score: Score [handle=JDBCURITemplate [scopeId=null, templateId=1910710916755648|1911381025755840, uriTemplate=hr/employees/], score=0, scope=SecurityConfig [constraint=none, realm=NONE, logonConfig=NONE], originsAllowed=[], corsEnabled=true] for: GET hr/employees/

                    hr/employees/ is a public resource

                    Using generator: oracle.dbtools.rt.json.query.JSONQueryGenerator

                    Performing JDBC request as: JOT_TEST

                    WebException [statusCode=503]

                      at oracle.dbtools.rt.web.WebException.webException(WebException.java:343)

                      at oracle.dbtools.rt.web.WebException.serviceUnavailable(WebException.java:323)

                      at oracle.dbtools.rt.web.HttpEndpointBase.restfulServices(HttpEndpointBase.java:443)

                      at oracle.dbtools.rt.web.HttpEndpointBase.service(HttpEndpointBase.java:164)

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

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

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

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

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

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

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

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

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

                      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)

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

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

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

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

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

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

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

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

                    Caused by: oracle.dbtools.common.jdbc.ConnectionPoolException: The pool named: apex_rt is not correctly configured, error: ORA-01017: invalid username/password; logon denied

                     

                      at oracle.dbtools.common.jdbc.ConnectionPoolException.badConfiguration(ConnectionPoolException.java:65)

                      at oracle.dbtools.common.config.db.DatabaseConfig.badConfiguration(DatabaseConfig.java:209)

                      at oracle.dbtools.common.config.db.DatabaseConfig.getPool(DatabaseConfig.java:351)

                      at oracle.dbtools.common.config.db.DatabaseConfig.getPool(DatabaseConfig.java:331)

                      at oracle.dbtools.common.config.db.DatabaseConfig.access$200(DatabaseConfig.java:44)

                      at oracle.dbtools.common.config.db.DatabaseConfig$DatabaseFactory.apply(DatabaseConfig.java:385)

                      at oracle.dbtools.common.config.db.PerThreadConnectionCache$DisposableConnectionFactory.apply(PerThreadConnectionCache.java:239)

                      at oracle.dbtools.common.config.db.PerThreadConnectionCache$DisposableConnectionFactory.apply(PerThreadConnectionCache.java:223)

                      at oracle.dbtools.common.util.PerThreadCache.get(PerThreadCache.java:60)

                      at oracle.dbtools.common.config.db.PerThreadConnectionCache.get(PerThreadConnectionCache.java:49)

                      at oracle.dbtools.common.config.db.DatabaseConfig.getConnection(DatabaseConfig.java:80)

                      at oracle.dbtools.common.jdbc.ora.OraPrincipal.connection(OraPrincipal.java:69)

                      at oracle.dbtools.common.jdbc.BaseJDBCCallProvider.connection(BaseJDBCCallProvider.java:149)

                      at oracle.dbtools.common.jdbc.BaseJDBCCallProvider.transaction(BaseJDBCCallProvider.java:78)

                      at oracle.dbtools.rt.query.QueryGeneratorBase.generate(QueryGeneratorBase.java:73)

                      at oracle.dbtools.rt.resource.templates.v2.ResourceTemplatesDispatcher$HttpResourceGenerator.response(ResourceTemplatesDispatcher.java:311)

                      at oracle.dbtools.rt.web.RequestDispatchers.dispatch(RequestDispatchers.java:97)

                      at oracle.dbtools.rt.web.ETags.checkPrecondition(ETags.java:53)

                      at oracle.dbtools.rt.web.HttpEndpointBase.restfulServices(HttpEndpointBase.java:426)

                      ... 19 more

                     

                    So that told me that the apex_rt pool wasn't configured correctly.  I checked apex_rt.xml and found that it was looking for the APEX_REST_PUBLIC_USER username/password.  Maybe I entered the wrong password before - I can't be sure as it is hashed, so I put the correct password into this file now as clear text.  I restarted ORDS and RESTful Services are now working for me.

                     

                    Excellent.  Thanks for helping.

                     

                    John

                    • 7. Re: Theme roller generated CSS not found by ORDS
                      rgm83

                      Well if after you setup all ORDS but still getting 404 errors, please visite my reply on the post below, maybe could help you.

                       

                      Re: Plugin static files migration