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!

Unable to use the regex mapping on ORDS 3.0.x URL mapping to connect to multiple DB using tomcat 6.0

Shivashish Roy-HumanaOct 19 2016 — edited Oct 27 2016

Hello folks, I am trying to use the regex feature of URL mapping in ORDS 3.0.6.176.08.46  to connect o 2 different Database ( Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production), Examples I have found in Oracle website or in other places  so far only show the example of "Routing Based on the Request Path Prefix" or "Routing Based on the Request URL Prefix" but the example is same i.e "https://example.com/ords/sales/f?p=1:1 ".

I want the mapping to be based on regex on the host name (i.e. .. https://sales.example.com/ords/f?p=1:1 to go to Sales Database and  https://hr.example.com/ords/f?p=1:1 go to HR Database). I am currently using ORDS 3.0.6.176.08.46 with APEX 4.2.5.00.8 .

We recently moved to Linux from windows, and i am trying to configure training and test DB instance using one web server via the feature "configuring multiple DB So any help  is greatly appreciated.

things i have tried so far is :

I have configured 2 separate DB connection pool for test and training in the ORDS configuration folder other than the default pointing to Test instance . using the below command on command line of linux and I have also tried using SQL developer via ORDS adminstrator

java -jar ords.war setup --database test

java -jar ords.war setup --database training

then ...completed the configuration as per the guideline and then ...ran

java -jar ords.war map-url --type regex  http://trn-.*   training

java -jar ords.war map-url --type regex  http://tst-.*   test

We have also tried escaping the regex as  ^http:\/\/trn-.*

we don't see any logging about the mapping on the tomcat 6 web sever log files when the tomcat is restarted or APEX pages are invoked.

Message was edited by: ac63b7f3-bac3-492c-b288-8df38382f6b5

Comments

Shivashish Roy-Humana

Fortunately, I was able to resolve the issue and found that when ORDS Admin is configured via SQL developer it leaves the WORKSPACE id ="" which caused the URL mapping not to work and connect to DB for APEX to launch.  additionally the "updated=######### " was also missing.  so I deleted the URL mapping XML file from the config folder and re-created via command line

java -jar ords.war map-url --type regex http://trn-.* training

I was able to make it work as desired using the REGEX expression . see below

old configuration  1

<?xml version="1.0" encoding="UTF-8"?>
<pool-config xmlns="http://xmlns.oracle.com/apex/pool-config">
<pool name="training" uri-pattern="http://trn-.*" workspace-id=""/>
<pool name="test" uri-pattern="http://tst-.*" workspace-id=""/>
</pool-config>

old configuration  2

<?xml version="1.0" encoding="UTF-8"?>
<pool-config xmlns="http://xmlns.oracle.com/apex/pool-config">
<pool name="training" uri-pattern="http://trn/http://trn-.*"/>
<pool name="test" uri-pattern="http://tst/http://tst-.*"/>
</pool-config>

both the above old configuration didn't work

new configuration

<?xml version="1.0" encoding="UTF-8"?>
<pool-config xmlns="http://xmlns.oracle.com/apex/pool-config">
<pool name="training" uri-pattern="http://trn-.*" updated="2016-10-27T15:39:38.527Z"/>
<pool name="test" uri-pattern="http://tst-.*" updated="2016-10-27T15:39:38.527Z"/>
</pool-config>

1 - 1
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Nov 24 2016
Added on Oct 19 2016
1 comment
664 views