Skip to Main Content

ORDS, SODA & JSON in the Database

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

after installing ORDS 22.1 can't access apex

SmithJohn45Jul 26 2022 — edited Jul 26 2022

Windows 10 based VM, (1) Oracle DB 21c XE, (2) Apex 22.1, (3)Java 11, (4) Apache Tomcat 9 (5) Ords 22.2 (number mentioned are sequence of installations)
checked @thatjeffsmith-oracle blog and tried to install ORDS 22.2
https://www.thatjeffsmith.com/archive/2022/04/oracle-rest-data-services-version-22-1-read-the-readme/
Apex in: c:\apex
Ords in: c:\ords and config folder: c:\ords\conf
Java in: c:\java
ords path sets in system variables c:\ords\bin
everything installed successfully, during installation of ords using "ords --config c:\ords\config install", there was no error, it means provided credentials was correct and it can create all objects in database (xepdb1)
then copied following contents:
copy c:\ords\ords.war C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps
copy c:\apex\images\* C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\i\
when in browser i entered localhost:8090/ it was fine (to check Tomcat is running) but when enter localhost:8090/ords/ it is showing below error:
image.pngis there anything i missed or something am doing wrong? if i did anything wrong, now how i can resolve? please help.
regards
please also check these prompts and my selections (some are selected defaults, just pressed enter key):

Enter a number to select the type of installation
[1] Install or upgrade ORDS in the database only
[2] Create or update a database pool and install/upgrade ORDS in the database
[3] Create or update a database pool only
Choose [2]: 1

Enter a number to select the database connection type to use
[1] Basic (host name, port, service name)
[2] TNS (TNS alias, TNS directory)
[3] Custom database URL
Choose [1]:

Enter the database host name [localhost]:

Enter the database listen port [1521]:

Enter the database service name [orcl]: XEPDB1

This post has been answered by jariola on Jul 28 2022
Jump to Answer

Comments

SmithJohn45

thanks @jariola
it is metioned in my post:
during installation of ords using "ords --config c:\ords\config install", there was...
regards

jariola

During install you have told where store config files. Tomcat don't know anything about that.
You need set JAVA_OPTS Dconfig.url as documentation says.

SmithJohn45

please help, how i can set it in Windows environment , also how to for creating config.url?
export JAVA_OPTS="-Dconfig.url=/scratch/my_ords_config"
regards
Is it correct as per my installations? set JAVA_OPTS="-Dconfig.url=c:\ords\config"

jariola

Sorry, I don't know how it's done in Windows.
Google how set environment variables in Windows for Tomcat.

SmithJohn45

thanks @jariola for your help.
regards

SmithJohn45

@jariola
configure environment variable as JAVA_OPTS as name and -Dconfig.url=c:\ords\config as value, stop and start Apache Tomcat, in browser trying to access localhost:8090/ords/ but still the same error appears.
i checked the c:\ords\config folder is empty, is there any problem that for some reasons, it failed to create configuration file... if any?
as per Tim Hall guide lines i tried creating environment variable JAVA_TOOL_OPTIONS and run but got same error.
https://oracle-base.com/articles/misc/oracle-rest-data-services-ords-installation-on-tomcat-22-onward
image.pngstill looking for help.
regards

jariola

Have you try rerun command ords --config c:\ords\config install and see do you get configuration files to that directory?
When you run that command, it should also output what directory is used for configuration.

SmithJohn45

@jariola
yes, there was an output which mentioned this config path, but its empty.
regards

jariola

Now I noticed from output you did post, it seems you have select [1] Install or upgrade ORDS in the database only. Meaning you don't even like to have configuration files for pool.

Enter a number to select the type of installation
  [1] Install or upgrade ORDS in the database only
  [2] Create or update a database pool and install/upgrade ORDS in the database
  [3] Create or update a database pool only
 Choose [2]: 1

You need chose [2] Create or update a database pool and install/upgrade ORDS in the database order to get also configuration files

SmithJohn45

@jariola thanks for your passions to help us.
so, it means i have to make another attempt.
is there anything for another attempt (upgrade/repair etc.) to must follow, please mention.
regards

jariola

If I understand correctly, you have now installed ORDS to database, but you didn't create configuration for pool.
Run again

ords --config c:\ords\config install

Then just create configuration selecting
[3] Create or update a database pool only
Then restart Tomcat, and see does APEX work.
Also you can check Tomcat logs what it says and does it find configuration for ORDS

kevinUCB

You must (eventually) create the database pool for ORDS to function.
You can re-run the command
ords --config c:\ords\config install
and choose either option 2 or 3 from the Installation Type selection.
For Tomcat on Windows, launch the application "Configure Tomcat". Navigate to the Java tab, and enter the
-Dconfig.url=c:\ords\config
in the Java Options box in the middle of the page.

SmithJohn45

@jariola
as instructed, set environment variable: name = JAVA_TOOL_OPTIONS and value = -Dconfig.url=c:\ords\config and re-run the command (below is output of cmd window which run as Administrator): --with env variable JAVA_OPTS this was showing same previous error in browser window--
C:\Users\Apex221>ords --config c:\ords\config install
ORDS: Release 22.2 Production on Thu Jul 28 04:22:03 2022
Copyright (c) 2010, 2022, Oracle.
Configuration:
/C:/ords/config/
The configuration folder C:\ords\config does not contain any configuration files.
Oracle REST Data Services - Interactive Install
Enter a number to select the type of installation
[1] Install or upgrade ORDS in the database only
[2] Create or update a database pool and install/upgrade ORDS in the database
[3] Create or update a database pool only
Choose [2]: 3

Enter a number to select the database connection type to use
[1] Basic (host name, port, service name)
[2] TNS (TNS alias, TNS directory)
[3] Custom database URL
Choose [1]:

Enter the database host name [localhost]:
Enter the database listen port [1521]:
Enter the database service name [orcl]: XEPDB1
Enter a number to select additional feature(s) to enable:
[1] Database Actions (Enables all features)
[2] REST Enabled SQL and Database API
[3] REST Enabled SQL
[4] Database API
[5] None
Choose [1]:

Enter a number to configure ORDS for standalone mode
[1] Configure ORDS for standalone mode
[2] Skip
Choose [1]: 2

The setting named: db.connectionType was set to: basic in configuration: default
The setting named: db.hostname was set to: localhost in configuration: default
The setting named: db.port was set to: 1521 in configuration: default
The setting named: db.servicename was set to: XEPDB1 in configuration: default
The setting named: db.username was set to: ORDS_PUBLIC_USER in configuration: default
The setting named: db.password was set to: ****** in configuration: default
The setting named: feature.sdw was set to: true in configuration: default
The global setting named: database.api.enabled was set to: true
The setting named: restEnabledSql.active was set to: true in configuration: default
then run Tomcat and start server. in browser url bar enter: http://localhost:8090/ords
now it is showing below error (also same error when enter -Dconfig.url=c:\ords\config in Tomcat's Java tab as mentioned in @kevinucb post):
image.pngcatalina.2022-07-28.log (23.19 KB)attached log file contains for 2 attempts, first with environment variable JAVA_OPTS and 2nd with JAVA_TOOL_OPTIONS env variable which is showing: null
please note: i have used XEPDB1 as service name where i have installed Apex 22.1
regards

jariola

Did you check Tomcat log?
28-Jul-2022 09:29:09.214 WARNING [main] oracle.dbtools.common.logging.JDKLogSink.record The pool named: |default|lo| is invalid and will be ignored: The username or password for the connection pool named |default|lo|, are invalid, expired, or the account is locked

SmithJohn45

what it means?
after last run, i have following files in these folders. files attached, please check. (file extension .xml is not allowed, so i changed to .txt)
c:\ords\config\databases\default\pool.xml
c:\ords\config\global\settings.xml
pool.txt (506 Bytes)settings.txt (246 Bytes)regards

jariola
Answer

You have entered wrong password and/or user when configuring pool. Or database user you have used (ORDS_PUBLIC_USER) is locked or password is expired.
Check that ORDS_PUBLIC_USER is not locked and make sure you have entered correct password to configuration.
You can change database user password and then set it for pool
ords --config c:\ords\config config secret db.password

Marked as Answer by SmithJohn45 · Jul 28 2022
SmithJohn45

on development vm i have used same password " oracle " so i can remember it for all users during Apex and ORDS installations.
account of ORDS_PUBLIC_USER is showing status as OPEN
image.pnghave executed and set password for database pool as mentioned: ords --config c:\ords\config config secret db.password
and it bring the apex login page. much grateful and highly appreciate your efforts to guide us.
image.pngwith best regards

frankntx

When you set the db.password when running:
ords --config c:\ords\config config secret db.password
what password are you setting/using? The one for ORDS_PUBLIC_USER or the one for SYS or some other user?
I am going to interpret it as the password for ORDS_PUBLIC_USER is the account related to the above command.

frankntx

What does one do if one runs into this issue when installing ORDS 21.4? The command 'ords' does not exist.
ords --config config mypassword db.password
-bash: /opt/tomcat/ords/bin/ords: No such file or directory
Yet the issue is still with the connection pool |default|lo| (see Tomcat log entry below):
The username or password for the connection pool named |default|lo|, are invalid, expired, or the account is locked
oracle.dbtools.common.jdbc.ConnectionPoolConfigurationException: The username or password for the connection pool named |default|lo|, are invalid, expired, or the account is locked
The ORDS_PUBLIC_USER account is not locked.

SmithJohn45

@frankntx
What does one do if one runs into this issue when installing ORDS 21.4? The command 'ords' does not exist.
the ords.exe is part of ORDS 22.x not earlier versions as you have mentioned.

thatJeffSmith-Oracle

Please start a new thread.
And instead of running
ords
Everything is
java -jar ords.war

1 - 22

Post Details

Added on Jul 26 2022
22 comments
3,238 views