How do I get my ORDS sample service working?

166 Views Asked by At

I have a working APEX installation, running ORDS in standalone mode, with several applications in use. I have enabled my schema for ORDS and installed the sample service. However, when I try to test the https:///ords/rest/hr/employees/ service, I get a 404.

enter image description here

I've tried:

  • Another schema within the installation, and it doesn't work there either.
  • Resetting the sample service. Nada.
  • De-registering and re-registering the schema under a different alias and installing the sample service again. Zip

Why this isn't working?

1

There are 1 best solutions below

0
On

After much research and trials, I've found the answer:

TLDR: the password for the ORDS_PUBLIC_USER has expired

I found this article that talks about this problem, from which I was able to figure things out.

Apparently, by default, passwords expire after 180 days (of non-logging in?) and the corresponding account is locked. This seems to have no effect on the general operation of ORDS or APEX, since our production environment has been running without a problem for over a year.

The article recommends resetting the passwords of the following system accounts.

  • APEX_PUBLIC_USER
  • APEX_LISTENER
  • APEX_REST_PUBLIC_USER
  • ORDS_PUBLIC_USER

However, upon running

select * from dba_users where username like 'APEX%'

I could see that only the ORDS_PUBLIC_USER account was locked, so I only dealt with that one.

The article said to use the original passwords from when ORDS was installed, but upon inquiring what that was, I thought it too unsafe, so I decided to change it. That meant two things:

  1. Resetting the users database password with

    alter user ORDS_PUBLIC_USER identified by password account unlock;

( change password to your desired password )

  1. Change the password in the corresponding password file, which can be found at a path similar to /ords19/prod/ords/conf/apex_pu.xml and looks like this.

enter image description here

Replace the value of the db.username entry with an exclamation mark, followed by the plaintext password of your choice, and save the file. Thus, if you wanted to use the password foobar, you'd put !foobar. (Don't worry: When ORDS restarts and reads the file, it encrypts the password and writes the encrypted version back to the file so no one snooping around in your filesystem can get at it.)

After I did all this, I restarted ORDS, and voila! My REST sample service now returns data as intended! Thank you Internet.