Hi, posting in case you come across this too. After installing the 2.0.2 Listener in front of ApEx in a new 12c database all was working well until I tried to use the RESTful services URIs that are part of the oracle.example.hr module. When I'd try to test any of the handlers such as https://host:port/apex/workspace/hr/employees/ it would return 503 Service Unavailable errors.
I tried a lot of troubleshooting, including granting "connect through apex_rest_public_user" per Apex Listener 2.0 RESTful services error 503 and even upgrading my 12c Apex to 4.2.2, but still kept getting the 503 errors. It happened only for the RESTful service URIs, although at the same time I also tried to connect to the listener via SQLDeveloper and would get the 503 errors there (even after creating my adminlistener user).
Meanwhile the regular (non-RESTful) ApEx URIs were working fine. This seemed to point to a configuration issue or bad password keyed when running the @apex_rest_config.sql script, but no matter how many times I re-ran that script and no matter how carefully I typed the passwords, the 503 errors remained. I double-checked in dba_users and found the apex_listener, apex_rest_public_user were unlocked and I could even connect to those schemas with SQLDev, so it wasn't a password issue.
I got this same behavior whether I deployed to WebLogic or if I ran the listener in standalone mode. The break came when I enabled <entry key="debug.printDebugToScreen">true</entry> inside of the Listener's defaults.xml. Now I was throwing errors that pointed at the connections defined when I ran java -jar apex.war setup:
- Caused by: oracle.dbtools.common.jdbc.ConnectionPoolException: The pool named: apex_al is not correctly configured, error: Listener refused the connection with the following error:
- ORA-12514, TNS:listener does not currently know of service requested in connect descriptor
I had a look at my apex_listener/apex/conf/apex_al.xml file and compared it with the working apex.xml file. I think these are the files generated by java -jar apex.war setup. My apex_al.xml file was much smaller: it only had entries for db.password and db.username, while the apex.xml file had these entries plus ones for db.hostname, db.sid and db.servicename. I modified the apex_al.xml file to match the apex.xml file by adding entries for sid, servicename and hostname:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<comment>Saved on Wed Jul 24 17:42:05 EDT 2013</comment>
After restarting the listener, I threw a similar error but this time for apex_rt, so I did the same steps above to the apex_listener/apex/conf/apex_rt.xml file.
Changing both files to include sid, servicename and hostname info and restarting the listener did the trick. This also fixed my 503 errors in SQLDeveloper when connecting directly to the Listener.
Not sure if sid and servicename both need to be there or which one takes precedence, but it's likely that I populated both into the apex.xml in one of the many times I re-ran the java -jar apex.war setup command.