Can't get Oracle ORDS to serve a request with APEX 5 restful services and Oracle XE11g

空扰寡人 提交于 2019-12-11 14:34:01

问题


I'm using Oracle 11g XE, I installed the latest version of APEX (5) on it and now I'm trying to use the restful services options to expose my tables via rest. I've downloaded ORDS and followed the instructions here to install and run it as standalone. I create a rest service in apex but I don't know how to test it - I've tried various URLS and not got any response!

My apex is installed as http://localhost:8080/apex/

On startup ORDS appears to suggest that it maps to /ords but this doesn't appear to be the case.

If I navigate to http://localhost:8080/ords I get an Authentication required popup - requires a username and password. The server says XDB.

I've also created a restful service based on EMP with uri template emp_json. I expected this to be served at http://localhost:8080/ords/emp_json (or maybe http://localhost:8080/apex/emp_json) but again I only get the authentication required popup. I've tried the password for various db users here e.g. APEX_REST_PUBLIC_USER but I just get a not found response.

2015-08-06 11:24:29.520:INFO::main: Logging initialized @764ms
Aug 06, 2015 11:24:29 AM oracle.dbtools.standalone.StandaloneJetty setupDocRoot
INFO: The document root is serving static resources located in: E:\software\ords\ords\standalone\doc_root
2015-08-06 11:24:29.972:INFO:oejs.Server:main: jetty-9.2.z-SNAPSHOT
2015-08-06 11:24:29.972:INFO:oejsh.ContextHandler:main: Started o.e.j.s.h.ContextHandler@83f700d{/,null,AVAILABLE}
2015-08-06 11:24:30.019:INFO:/ords:main: INFO: Using configuration folder: E:\software\ords\ords
2015-08-06 11:24:30.019:INFO:/ords:main: FINEST: |ApplicationContext [configurationFolder=E:\software\ords\ords, services=Application Scope]|
Aug 06, 2015 11:24:30 AM oracle.dbtools.common.config.db.DatabasePools validatePool
INFO: Validating pool: apex
Aug 06, 2015 11:24:30 AM oracle.dbtools.common.config.db.DatabasePools validatePool
INFO: Pool: apex is correctly configured
Aug 06, 2015 11:24:30 AM oracle.dbtools.common.config.db.DatabasePools validatePool
INFO: Validating pool: apex_al
Aug 06, 2015 11:24:30 AM oracle.dbtools.common.config.db.DatabasePools validatePool
INFO: Pool: apex_al is correctly configured
Aug 06, 2015 11:24:30 AM oracle.dbtools.common.config.db.DatabasePools validatePool
INFO: Validating pool: apex_pu
Aug 06, 2015 11:24:30 AM oracle.dbtools.common.config.db.DatabasePools validatePool
INFO: Pool: apex_pu is correctly configured
Aug 06, 2015 11:24:30 AM oracle.dbtools.common.config.db.DatabasePools validatePool
INFO: Validating pool: apex_rt
Aug 06, 2015 11:24:30 AM oracle.dbtools.common.config.db.DatabasePools validatePool
INFO: Pool: apex_rt is correctly configured
2015-08-06 11:24:30.582:INFO:/ords:main: INFO: Oracle REST Data Services initialized|Oracle REST Data Services version : 3.0.1.177.18.02|Oracle REST Data Services server info: jetty/9.2.z-SNAPSHOT|
2015-08-06 11:24:30.597:INFO:oejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@1f0f2a1a{/ords,null,AVAILABLE}
2015-08-06 11:24:30.613:INFO:oejs.ServerConnector:main: Started ServerConnector@5c702c89{HTTP/1.1}{0.0.0.0:8080}
2015-08-06 11:24:30.613:INFO:oejs.Server:main: Started @1857ms

回答1:


It is a late answer but still...

Try to navigate directly to the default login page:

http://localhost:8080/apex/f?p=4550 or http://localhost:8080/ords/f?p=4550

depending on how you deployed it.

Regarding REST:

http://localhost:8080/apex/emp_json In SQL developer you have to specify no authentication, have you?

Remember that there was an additional step in the APEX installation to enable REST capabilities.




回答2:


The database has a default webserver for XDB that is on port 8080.

If I navigate to http://localhost:8080/ords I get an Authentication required popup - requires a username and password. The server says XDB.

Change that port with this

SQL> -- set http port
SQL> begin
 2    dbms_xdb.sethttpport('9090');
 3  end;
 4  /

OR change the port for ORDS by editing E:\software\ords\ords\standalone\standalone.properties

#Tue Feb 06 12:26:12 EST 2018
jetty.port=9090                 <<<<<<<<<<< CHANGE THIS >>>>>>>>>>
standalone.access.log=/tmp/ordsLOGS
standalone.context.path=/ords
standalone.doc.root=/Users/klrice/workspace/githubTools/trunk/ords/
standalone.scheme.do.not.prompt=true
standalone.static.context.path=/i
standalone.static.path=/Users/klrice/workspace/apex_trunk/images


来源:https://stackoverflow.com/questions/31853475/cant-get-oracle-ords-to-serve-a-request-with-apex-5-restful-services-and-oracle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!