3 Replies Latest reply on Feb 27, 2017 9:23 AM by Pavel_p

    ORDS deployed to TomCat 404 Not Found boot issue



      I've just installed APEX 5.1+ords. deployed to TomCat 8.0.36 (OS is OpenSUSE Leap 42.2 if it's important). Both services (oracle-xe and tomcat) are started automatically by systemd but when I try to login to APEX, I get the message

      404 Not Found

          The request could not be mapped to any database. Check the request URL is correct, and that URL to database mappings have been correctly configured


      The problem is solved by simply restarting TomCat. Then after a successfull connection I also tried to stop the running database with TC running and to a connection attempt to the stopped DB backend it responded

      500 Internal Server Error

      but was able to connect again as soon as the DB was up.

      So I assume when TomCat starts sooner than oracle-xe service, ORDS cannot connect and does not make any other attempts to establish connection. Of course it would be possible to make sure that Oracle starts before TomCat, elaborating with systemd is annoying and I have no idea how to do the same on Windows, but since I haven't had any such problems with any of the previous ORDS releases, maybe someone from the development team could take a look at it if anything has changed and eventually modify this behaviour (I'm not saying to fix it because it's not exactly broken).

      If it was tough to reproduce, I could share the entire VM image.



        • 1. Re: ORDS deployed to TomCat 404 Not Found boot issue

          I've just installed the same to Centos 7 and the very same behaviour. Please, could anybody from the dev team kindly check this issue?

          In a nutshell: TomCat starts sooner than Oracle-xe service ready and ORDS returns 404 - not found instead of retrying to connect. After TomCat is restarted (this time is oracle up and running), ORDS connects as expected.

          • 2. Re: ORDS deployed to TomCat 404 Not Found boot issue



            I ran into the same issue (running XE11g, CentOS 6.8, APEX 5.1, ORDS, TomCat 8.0.41).

            The cause turned out to be the run level order of the tomcat and oracle-xe services.

            You can check those using (as root) ls /etc/rc*

            The oracle-xe service should always start before tomcat. In my case it did for some run levels, but not for others.

            To make sure it always does start first, I set the start run level for tomcat to 85 (oracle-xe had a maximum of 80, so 85 worked for me. Check to see if 85 is OK for you using the ls /etc/rc* above).


            • Steps (all as root):

            vi /etc/init.d/tomcat

            • Change the chkconfig line to:

            # chkconfig: 2345 85 80

            • Use the new configuration

            chkconfig --level 2345 tomcat reset

            • Check the new status

            ls /etc/rc*

            • Reboot the server


            This solved it for me.

            Note that I did numerous similar installations before, without ever seeing this behavior. Always with slightly different versions of OS, apex, ords, tomcat, etc. however, so some new version of one of the packages might be the cause...

            • 3. Re: ORDS deployed to TomCat 404 Not Found boot issue


              thanks for your response but you just repeated what I wrote in my previous posts and also your post could be considered as a bit confusing.

              Please, for your own sake, read something about Linux runlevels https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Installation_Guide/s1-boot-init-shutdown-s… (you'll hardly find there runlevels 85 and 90...) and also note that there is a completely different mechanism in all the mainstream Linux distributions including RHEL 7 + its derivatives (systemd instead of SysV init scripts).

              The thing here is not how to workaround this behaviour and starting Oracle before TomCat, the point is that these processes should be completely independent. It's not right to change the boot order and introduce some other dependencies into the boot process just because of one application deployed to TomCat.

              In fact there can be (and will be) deployment scenarios where TC and Oracle run on completely different machines and in such cases you have very limited options how to influence the boot order. Also there can be other apps deployed to TC that are completely Oracle independent, so I just want to start my TC no matter if Oracle DB is available or not and once it is up, ORDS should start returning expected results (which is not obviously happening).

              If this is the expected behaviour, it should be at least mentioned in the documentation that Oracle DB must be up and running before the TC server starts (maybe it is mentioned somewhere and I just did not see it).

              Please, Kris Rice-Oracle, Gordon Smith-Oracle, could you confirm that this is a new ORDS feature (because I've never experienced such behaviour in earlier versions) and from now on ORDS requires Oracle DB up and running when TC (and probably also other supported application servers) start?

              Best regards,