10 Replies Latest reply: Apr 18, 2013 8:47 AM by clcarter RSS

    Oracle 11 XE Application Express connection failure

    810461
      Hello,

      Some how today I could not be able to connect to my database via oracle xe apex interface with Internet Explorer. My OS is Win 7 Enterprise Ed. When I use my java program I could write and read data, but some how something is wrong with apex.

      I try the following urls for connecting:


      Url:
      http://127.0.0.1:8080/apex/f?p=4950 /

      Result:
      Cycle Detected
      --------------------------------------------------------------------------------
      Description: Your request is prohibited because it would cause a cycle.


      Url:
      http://localhost:8080/apex/f?p=4950

      Result:
      Internet Explorer cannot display the webpage



      Url:
      http://myip:8080/apex/f?p=4950

      //Result:
      Connection refused

      --------------------------------------------------------------------------------
      Description: Connection refused


      how can establish the connection?
        • 1. Re: Oracle 11 XE Application Express connection failure
          clcarter
          how can establish the connection?
          Three things are required for Apex. One, the database. It has to be running. Two, the listener, it also has to be running.

          Third, the apex is a service that requires a correct networking configuration on the database host.
          When I use my java program I could write and read data
          So that is one way to answer the database requirement, obviously the database would have to be up to get a connection to the database.

          Depends on how the java client is set up, usually via a connect string, one would think the listener is running but that may not be the case. The listener is not required to connect to the database at the host, its main purpose is handling remote database connection requests.

          In a command box, Start/Run/cmd.exe check the listener status and verify the hostname. The listener status will also show the endpoints in use- one is the TCP port, default is 1521, for database connections. There should also be a "presentation ... http ... port=8080 ..." endpoint for apex.
          lsnrctl status
          ... Listening Endpoints Summary...
           ... may have a ...PROTOCOL=IPC... line but its not relevant to an apex issue ...
           ...ADDRESS=(PROTOCOL=tcp)(HOST=<hostname or IPv4 IP host address>)(PORT=1521)...
           ...(HOST=<hostname>)(PORT=8080)...
          ...
          lsnrctl services
          ... critical bits for apex in the Services: ... XEXDB ...
          hostname
            ... <hostname> (?)
          ping <hostname>
           ... pinging ...[n.n.n.n] ... 
          ping n.n.n.n 
          ... (?)
          Note that the 1521 line may have hostname or it might show an N.N.N.N IP address, the 8080 line has to show hostname. Any variance in the network client setup for TCP will prevent the apex service from working on the host.

          In your command box Properties/Options tab check the Quick Edit checkbox. That will allow a mouse drag to highlight and press <enter> to copy text from the command box to the clipboard.

          Edited by: clcarter on Apr 17, 2013 3:05 PM
          add hostname vfy
          • 2. Re: Oracle 11 XE Application Express connection failure
            810461
            Thank you very much for your consediration and for your enlightning answers.

            The output of cmd line as to lsnrctl status and lsnrctl services are:


            Microsoft Windows [Version 6.1.7601]
            Copyright (c) 2009 Microsoft Corporation. All rights reserved.

            C:\Users\uguralper.aydin>lsnrctl status

            LSNRCTL for 32-bit Windows: Version 11.2.0.2.0 - Production on 18-NIS-2013 09:00
            :09

            Copyright (c) 1991, 2010, Oracle. All rights reserved.

            Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
            TNS-12541: TNS:no listener
            TNS-12560: TNS:protocol adapter error
            TNS-00511: No listener
            32-bit Windows Error: 2: No such file or directory
            Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=nb2-temp.enerjisa.local)
            (PORT=1521)))
            TNS-12545: Connect failed because target host or object does not exist
            TNS-12560: TNS:protocol adapter error
            TNS-00515: Connect failed because target host or object does not exist
            32-bit Windows Error: 1004: Unknown error

            C:\Users\uguralper.aydin>lsnrctl services

            LSNRCTL for 32-bit Windows: Version 11.2.0.2.0 - Production on 18-NIS-2013 09:00
            :21

            Copyright (c) 1991, 2010, Oracle. All rights reserved.

            Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
            TNS-12541: TNS:no listener
            TNS-12560: TNS:protocol adapter error
            TNS-00511: No listener
            32-bit Windows Error: 2: No such file or directory
            Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=nb2-temp.enerjisa.local)
            (PORT=1521)))
            TNS-12545: Connect failed because target host or object does not exist
            TNS-12560: TNS:protocol adapter error
            TNS-00515: Connect failed because target host or object does not exist
            32-bit Windows Error: 1004: Unknown error

            C:\Users\uguralper.aydin>


            How can I fix those problems?
            • 3. Re: Oracle 11 XE Application Express connection failure
              Mahir M. Quluzade
              oforce wrote:
              Thank you very much for your consediration and for your enlightning answers.

              The output of cmd line as to lsnrctl status and lsnrctl services are:


              Microsoft Windows [Version 6.1.7601]
              Copyright (c) 2009 Microsoft Corporation. All rights reserved.

              C:\Users\uguralper.aydin>lsnrctl status

              LSNRCTL for 32-bit Windows: Version 11.2.0.2.0 - Production on 18-NIS-2013 09:00
              :09

              Copyright (c) 1991, 2010, Oracle. All rights reserved.

              Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
              TNS-12541: TNS:no listener
              TNS-12560: TNS:protocol adapter error
              TNS-00511: No listener
              32-bit Windows Error: 2: No such file or directory
              Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=nb2-temp.enerjisa.local)
              (PORT=1521)))
              TNS-12545: Connect failed because target host or object does not exist
              TNS-12560: TNS:protocol adapter error
              TNS-00515: Connect failed because target host or object does not exist
              32-bit Windows Error: 1004: Unknown error

              C:\Users\uguralper.aydin>lsnrctl services

              LSNRCTL for 32-bit Windows: Version 11.2.0.2.0 - Production on 18-NIS-2013 09:00
              :21

              Copyright (c) 1991, 2010, Oracle. All rights reserved.

              Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
              TNS-12541: TNS:no listener
              TNS-12560: TNS:protocol adapter error
              TNS-00511: No listener
              32-bit Windows Error: 2: No such file or directory
              Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=nb2-temp.enerjisa.local)
              (PORT=1521)))
              TNS-12545: Connect failed because target host or object does not exist
              TNS-12560: TNS:protocol adapter error
              TNS-00515: Connect failed because target host or object does not exist
              32-bit Windows Error: 1004: Unknown error

              C:\Users\uguralper.aydin>


              How can I fix those problems?
              Can you try ?
               lsnrctl  start 
              Mahir
              • 4. Re: Oracle 11 XE Application Express connection failure
                810461
                Thanks. I tried but I got the following error:


                C:\Users\uguralper.aydin>lsnrctl start

                LSNRCTL for 32-bit Windows: Version 11.2.0.2.0 - Production on 18-NIS-2013 09:17
                :36

                Copyright (c) 1991, 2010, Oracle. All rights reserved.

                Starting tnslsnr: please wait...

                TNS-12560: TNS:protocol adapter error
                TNS-00530: Protocol adapter error


                C:\Users\uguralper.aydin>
                • 5. Re: Oracle 11 XE Application Express connection failure
                  Mahir M. Quluzade
                  Then you must start windows service OracleServiceXE.
                  • 6. Re: Oracle 11 XE Application Express connection failure
                    Udo
                    Hi,

                    I think the error messages are pretty clear:
                    TNS-12545: Connect failed because target host or object does not exist
                    TNS-12560: TNS:protocol adapter error
                    TNS-00515: Connect failed because target host or object does not exist
                    Are you sure the hostname in your listener.ora is the acutally the (resolvable) hostname of your machine?
                    HOST=nb2-temp.enerjisa.local
                    Try to ping your machine using a command line box, e. g.
                    ping nb2-temp.enerjisa.local
                    Could it be that hostname is bound to a dynamic DHCP IP address? You should have a static IP for the hostname you use to bind your database listener to...

                    -Udo
                    • 7. Re: Oracle 11 XE Application Express connection failure
                      810461
                      Thanks. Well I changed the hostname and then I got the following output, but I still can't connect to application interface. What might be wrong?
                      Microsoft Windows [Version 6.1.7601]
                      Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
                      
                      C:\Users\uguralper.aydin>lsnrctl status
                      
                      LSNRCTL for 32-bit Windows: Version 11.2.0.2.0 - Production on 18-NIS-2013 12:26
                      :25
                      
                      Copyright (c) 1991, 2010, Oracle.  All rights reserved.
                      
                      Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
                      STATUS of the LISTENER
                      ------------------------
                      Alias                     LISTENER
                      Version                   TNSLSNR for 32-bit Windows: Version 11.2.0.2.0 - Produ
                      ction
                      Start Date                18-NIS-2013 12:22:10
                      Uptime                    0 days 0 hr. 4 min. 17 sec
                      Trace Level               off
                      Security                  ON: Local OS Authentication
                      SNMP                      OFF
                      Default Service           XE
                      Listener Parameter File   C:\oraclexe\app\oracle\product\11.2.0\server\network\a
                      dmin\listener.ora
                      Listener Log File         C:\oraclexe\app\oracle\diag\tnslsnr\nb-temp2\listener\
                      alert\log.xml
                      Listening Endpoints Summary...
                        (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc)))
                        (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
                      Services Summary...
                      Service "CLRExtProc" has 1 instance(s).
                        Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
                      Service "PLSExtProc" has 1 instance(s).
                        Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
                      Service "XE" has 1 instance(s).
                        Instance "XE", status UNKNOWN, has 1 handler(s) for this service...
                      The command completed successfully
                      
                      C:\Users\uguralper.aydin>lsnrctl services
                      
                      LSNRCTL for 32-bit Windows: Version 11.2.0.2.0 - Production on 18-NIS-2013 12:27
                      :59
                      
                      Copyright (c) 1991, 2010, Oracle.  All rights reserved.
                      
                      Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
                      Services Summary...
                      Service "CLRExtProc" has 1 instance(s).
                        Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
                          Handler(s):
                            "DEDICATED" established:0 refused:0
                               LOCAL SERVER
                      Service "PLSExtProc" has 1 instance(s).
                        Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
                          Handler(s):
                            "DEDICATED" established:0 refused:0
                               LOCAL SERVER
                      Service "XE" has 1 instance(s).
                        Instance "XE", status UNKNOWN, has 1 handler(s) for this service...
                          Handler(s):
                            "DEDICATED" established:0 refused:0
                               LOCAL SERVER
                      The command completed successfully
                      
                      C:\Users\uguralper.aydin>
                      • 8. Re: Oracle 11 XE Application Express connection failure
                        Udo
                        Well I changed the hostname and then I got the following output, but I still can't connect to application interface. What might be wrong?
                        So your database listener is up and running now, but port for the database internal HTTP server has not been registered yet. Possibly a database restart is necessary after changing the hostname. Did you do that already?
                        A second option would be another service that uses TCP port 8080 on your machine, so the database listener can't bind to that port.
                        If these two hints don't help, we'll probably have to dig log files to find out what's interfering...

                        -Udo
                        • 9. Re: Oracle 11 XE Application Express connection failure
                          810461
                          I think the listener does not listen to port 8080, because on cmd when I typed: netstat -an | find ":8080" I didn't see that the port is being listened. Where or how can I see the port which is being used for application express, are there any default ports which are used instead of 8080 for apex?
                          • 10. Re: Oracle 11 XE Application Express connection failure
                            clcarter
                            the listener does not listen to port 8080
                            That is correct. The listener listens for database requests on the (default) 1521.

                            The 8080 port is for the XEXDB service. Since XEXDB does not show in the services list, there won't be a LISTEN on the 8080 port. Therefore apex web pages won't work. The port can be changed, but if its not working ... hmmm ... its not going to work anyway.
                            HOST=127.0.0.1
                            More changes are needed if you want to use loopback for the listener setup. If you want to go that route, point the database at that listener, back to the command box:
                            sqlplus /nolog
                            conn system
                            ... password ... connected ...
                            alter system set local_listener = '(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521))' scope=both;
                            alter system register;
                            exit
                            lsnrctl stat
                            ... endpoints:
                            ... port=1521 ...
                            ... port=8080 ...
                            But the loopback IP won't allow any remote client connections. Perhaps the easiest way to work around a "broken" listener setup, move listener.ora file out of the way. Important, stop the listener first. Then go to the oraclexe...network/admin folder and move listener.ora file out of the way, i.e. rename it to "listener.ora.bak" and start the listener.

                            Might lose the ipc as well as the plsext and clrext services, but they're not needed unless you're doing external program calls from the database, a few other things, but not relevant for your basic XE installation.