This content has been marked as final. Show 6 replies
I'm not sure I got your question right, but I'll try to find some solution anyway.
If I close the CMD, I will lose the connection, and I have to reconfigure it again.That's what happens when a shell is terminated - all associated processes will stop as well. However, if you have a apex-config.xml in your apex.home you shouldn't need to configure your APEX Listener each time your start it, but it would reuse an existing configuration.
If I open APEX locally , I mean by using the shortcut "Get Started With Oracle Database 11g Express Edition" , Then I will lose the connection that uses the default port of the listener, that is 8080.Now, if you have XE running on the same (local) machine as you have your APEX Listener running in standalone mode, you probably have a port conflict: By default, both APEX Listener in standalone mode and the Embedded PL/SQL Gateway (EPG) use port 8080. The EPG is activated as web server for APEX in XE after a fresh installation, the APEX Listener would be an alternative in that case. You can either stop the EPG, or reconfigure any of the two web servers to use a different port, if you want to run them parallel.
To change the port used by the APEX Listener in standalone mode, you simply add another parameter to the startup: -Dapex.port=8888 and you're done.
To change the port used by the EPG, connect as sys and run the following
If you want to disable the EPG, simply set the port to *0* .
EXEC DBMS_XDB.SETHTTPPORT(8888); COMMIT;
After I configured the listener I got this message on the CMDThat's what it should look like.
No, since your topic is "lose the connection when closing the CMD", I assume you search for an alternative. You could run the APEX Listener as a Windows service, even in standalone mode. To do this, you create a batch file, e.g.
Note that you have to set JAVA_HOME as system property or replace the call with the absolute path to your JDK or make sure the JDK is in your PATH variable.
%JAVA_HOME%\java -Dapex.home=D:\oracle\APEX_Listener\_home -Dapex.images=D:\oracle\apex_4_0_2\images -Dapex.port=8888 -jar D:\oracle\APEX_Listener\apex_listener.188.8.131.52.15.23\apex.war >>D:\oracle\APEX_Listener\apex_listener.184.108.40.206.15.23\my_apex_listener.log 2>&1
Of course, you can and should change the other directories as well to fit to your system.
Next, create a Windows service, e.g. using [url https://iain.cx/src/nssm/]NSSM (free) or [url http://support.microsoft.com/kb/137890]SRVANY (MS, non-free), that starts your batch as a windows service.
The command for creating that service using NSSM could look as follows
You can edit the service properties afterwards, e.g. change the start mode from "Automatic" to "On Demand".
nssm install APEX_Listener D:\oracle\APEX_Listener\apex_listener.220.127.116.11.15.23\startup.cmd
I hope this answers your question. If not, please point me into the right direction.
Thanks Udo for the advice on setting up the NSSM windows service ( i was using srvany before but did not get the detailed logging - i probably didnt have it configured correctly),1 person found this helpful
I now have a standalone listener running with NSSM (on windows 7) with the following entry in my startup.cmd file:
"%JAVA_HOME%\bin\java.exe" -Dapex.home=E:\tmp\apex -Dapex.images=E:\apex_4.0.2_en\apex\images -Dapex.port=8080 -Dapex.erase -jar E:\apex_listener.18.104.22.168.15.23\apex.war >>E:\apex_listener.22.214.171.124.15.23\my_apex_listener.log 2>&1
A word of warning though - after struggling a bit with errors in the logs I found that i needed to run the java command manually for the first time (in a command prompt as administrator) - just to setup the passwords for the adminlistener and managerlistener accounts. But once setup the service now works really well, Thanks!
But once setup the service now works really well, Thanks!I'm glad to hear that.
A word of warning though - after struggling a bit with errors in the logs I found that i needed to run the java command manually for the first time (in a command prompt as administrator) - just to setup the passwords for the adminlistener and managerlistener accounts.Indeed. In the post above I recommended having the apex-config.xml in the apex.home already. It seems I didn't point that out with enough emphasis. Thanks for highlighting that demand.
P.S.: Could you please mark that question as answered using the account of the original post, and mark helpful and/or correct answers in order to make it easier for others searching the forum to spot relevant posts easy.
I appreciate your help, and I am sorry for being late to mark this question as "Answered".
Can it really be true that the developers at Oracle thought that the standalone CMD window was an acceptable solution, so that's why we have to use a third-party tool to install the Apex listener as a service? Does UAT mean anything at Oracle?
This thread has long been marked as answered as the reported problem was solved.
If you want a discussion on the requirement to re-invent missing OS features, please start your own thread, but don't cannibalize existing ones. There are users who just search for a solution for a given problem, and I think your post won't help them.