Can anyone explain why the apex listener tries to return on port 7777 and is there any way we can change it?
In our infrastructure we block that port for security reasons.
We are using OC4J (10.1.3.5.0).
The port is set by the JEE container i.e. by OC4J , not by the Apex Listener. So to change it, you need to change the configuration of the application server. Tell us a little more about your environment - are you using OC4J stand-alone, or as part of Oracle Application Server?
We are using OC4J as part of Oracle Application Server which currently sits behind content management devices and caching servers for load balancing.
We previously have set APEX up to use the mod-plsql gateway but are looking to move to the listener without having to change to weblogic at the moment.
Makes sense - 7777 is the default port for OAS on UNIX and Linux. It is changed in httpd.conf, but to use a port below 1024 in that environment, you either have to run as root, or change permissions on the executable so that it runs with root's permissions. Look in the OAS docs and forum for full instructions.