Forum Stats

  • 3,852,814 Users
  • 2,264,140 Discussions
  • 7,905,150 Comments

Discussions

ORDS 22.1

Hallo

I am trying to setup ords 22.1 for two days now. Everytime something else is not working. According to documentation if i install ORDS and run it and then enable rest services for a schema (myschema) and then for a table (emp) in this schema, I shall be able to do this

localhost:8080/ords/myschema/emp

and see the table content as JSON document in my browser. Heaven Knows how often I tried this, everytime the same thing: 404

Of course ords is running... Database is running... Am I ever going to make this happen. So difficult ufff. Wanted to introduce this to my colleagues in the company but seems to fail all the time.

Thanks in advance

Answers

  • thatJeffSmith-Oracle
    thatJeffSmith-Oracle Distinguished Product Manager Posts: 8,765 Employee

    Sorry you're having such a difficult time with this AMW2F.

    Can you show where you are rest enabling the schema and then the table?

    Did you enable SQL Developer Web?

    If so, can you login as 'myschema' by going to

    localhost:8080/ords/sql-developer ?

    ORDS is running and the database is running - do you see ORDS_PUBLIC_USER connections in your database? Do you see any errors in the ORDS standard out messages?

    Paavo
  • User_AMW2F
    User_AMW2F Member Posts: 4 Green Ribbon

    Hi,

    Many thanks for your reply. I really appreciate it.

    I will write here the steps I did.

    1. I Installed OracleXE213_Win64
    2. I am able to login with ---> sqlplus sys/[email protected]/xepdb1 as sysdba
    3. show pdbs says ---> CON_ID:3, CON_NAME: XEPDB1, OPEN MODE: READ WRITE, RESTRICTED: NO
    4. I installed ---> ORDS: Release 22.2 Production
    5. I started --> java -jar ords.war --config d:\ords\config serve
    6. I Followed the instructions to create a user like in
    7. https://oracle-base.com/articles/misc/oracle-rest-data-services-ords-autorest#create-test-db-user
    8. Created the user "myschema" and the table "emp" with 14 records
    9. I used  SQL Developer Version 17.4.0.355
    10. SQL Developer Web was not used, I don't know how to install it and where to get it
    11. I can see 3 ORDS_PUBLIC_USER in session browser
    12. In SQL Developer on the Schema "myschema" I chose ---> REST Services / Enable REST Services
    13. After expanding the "myschema" node I chose on the table "EMP" the option ---> Enable REST Services...
    14. I followed the dialog steps
    15. Then I did ---> localhost:8080/ords/myschema and also localhost:8080/ords/myschema/emp
    16. Both land in 404 Not Found
    17. No errors in ORDS and the last three lines are

    Oracle REST Data Services server info: jetty/9.4.48.v20220622

    Oracle REST Data Services java info: Java HotSpot(TM) 64-Bit Server VM 17.0.2+8-LTS-86

    Oracle REST Data Services version : 22.2.1.r2021302

    Many thanks

  • thatJeffSmith-Oracle
    thatJeffSmith-Oracle Distinguished Product Manager Posts: 8,765 Employee

    Tim's article has you enable the schema like so


    BEGIN
      ORDS.enable_schema(
        p_enabled             => TRUE,
        p_schema              => 'TESTUSER2',
        p_url_mapping_type    => 'BASE_PATH',
        p_url_mapping_pattern => 'hr',
        p_auto_rest_auth      => FALSE
      );
        
      COMMIT;
    END;
    /
    

    And the object

    BEGIN
      ORDS.enable_object (
        p_enabled      => TRUE, -- Default  { TRUE | FALSE }
        p_schema       => 'TESTUSER2',
        p_object       => 'EMP',
        p_object_type  => 'TABLE', -- Default  { TABLE | VIEW }
        p_object_alias => 'employees'
      );
        
      COMMIT;
    END;
    /
    

    Then that would mean your url would be

    /ords/hr/employees

    not

    /ords/myschema/emp


    When you installed ORDS, it asks if you want to enable SQL Developer Web, if you said 'yes', then you can simply go to

    /ords/sql-developer


    and then login as TESTUSER2

    First prompt say hr, and then on 2nd prompt, provide TESTUSER2 and it's password to login.

  • User_AMW2F
    User_AMW2F Member Posts: 4 Green Ribbon

    Thanks for the reply.

    I did not followed the instructions on the WebSite literally, I susbstituted HR with MYSCHEMA and i did not also executed the PL/SQL Blocks, I let SQL Developer do it for me.

    I uninstalled ORDS fully and start everything from the very beginning. As you see I installed ORDS again and at no point I was asked if I want to install SQL Developer Web. I pasted above all the questions that was asked during the installation and the last question was the default Port Number which was 8080 and I accepted. After that the installation started and went all through the end with no questions anymore.

    People sometimes also use java -jar ords.war to create a user and assign the SQL Developer role to it which is also not available in my case. All options that I have are these lsited below:

    as SYS I did this

    CREATE USER testuser2 IDENTIFIED BY testuser2 DEFAULT TABLESPACE users QUOTA UNLIMITED ON users;

    GRANT CREATE SESSION, CREATE TABLE TO testuser2;

    I created the table emp under testuser2 and inserted 14 rows. So this time I stick to the same name and do not change it.

    Then I did this in SQL Developer:

    According the the WebSite, thats enough and I do not need to go any further and right now without doing anything else Web services from the schema can now be referenced using the following base URL.

    But Unfortunately this is what I get:


  • thatJeffSmith-Oracle
    thatJeffSmith-Oracle Distinguished Product Manager Posts: 8,765 Employee

    There's nothing to be found at that URL, it's just there's nothing there to get.

    You need an object AFTER the user, then you can GET the data in that table.


    /ords/testuser2/emps/ -- or whatever your table was enabled as

  • User_AMW2F
    User_AMW2F Member Posts: 4 Green Ribbon

    Thanks for your reply and yout patience.

    In the documentation

    it is written that right after the step I did, something must be there. Remember the HR in image below was chosen as the url-mapping-pattern and I just left it to "testuser2".

    But no problem I go one step further and enable AutoREST for the table emp within the schema "testuser2"

    So next step I did this as you suggested is this:

    ===================================


    and now we are back to our original problem that I tried to explain namely this:

    I did not change the url pattern mapping from testuser2 to hr so I have the URL

    http://localhost:8080/ords/testuser2/emp which as you see land in 404 Not Found

    Best,

    AT

  • thatJeffSmith-Oracle
    thatJeffSmith-Oracle Distinguished Product Manager Posts: 8,765 Employee

    your url is wrong it's ords/hr/emp

    Also, you're not reading the Oracle Docs, you're reading articles on Oracle-Base. The author is an oracle expert, but he doesn't produce official docs, all of those are at docs.oracle.com