Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Trouble connecting to Oracle 12c database

    My setup
    Windows 10 Home 64 bit
    SmartClient v11.1p_2017-10-07 Enterprise evaluation
    Oracle 12c release 2 on Amazon AWS
    ojdbc8.jar
    Java 8 update 144 SDK and JRE

    I am trying to connect to an Oracle 12c r2 database hosted on Amazon AWS. I can connect to the server just fine with a local install of SQL-Developer (an Oracle SQL tool). I downloaded the ojdbc driver for Oracle 12c r2, which is ojdbc8.jar and placed it in the WEB-INF/lib folder in both the SDK and runtime folders of SmartClient. This driver requires Java 8 so I installed Java 8 SDK and JRE. (I had Java 9 on my laptop). I then opened the Admin Console and tried to configure the database. I used the same settings as used for my SQL-Developer setup. I can Test setup fine but then when I save the database configuration it seems to crash Tomcat because the console stops working (page not found). So I closed the command line window and re-ran the start_embedded_server.command file. After doing this several times I realized that the server window showed that it was using Java 9. So I uninstalled Java 9 and re-ran "start_embedded_server.command" command file. I could then see that it was using Java 8 at that point. But I continue to have the same issue. When I pull up the database configuration in the Admin console the database name/SID is always cleared and I have to re-enter it and Save it. I also noticed that the "Obtain Connections Using" is set to datasource (I believe it defaulted to DataSource when I first selected Oracle as the database). I'm not sure of the difference. Anyway here is what happens when I try to update the database configuration:

    1. If I don't change "datasource" to "DataSource" but enter the SID, I test and get "Failure: Unable to connect. Error from Driver: java.sql.SQLException: Invalid Oracle URL specified: OracleDataSource.makeURL"
    2. If I remember to change "datasource" to "DataSource" along with entering the SID, I get "Transport error - HTTP code: 404 for URL: http://localhost:8080/tools/adminConsoleOperations.jsp" which basically means Tomcat as crashed. I can refresh the page and I get page not found. This also happens if I change "datasource" to "Driver Manager"

    As I said, even though I save the change, when I restart Tomcat these two fields always revert to "Obtain Connections Using" = datasource and SID is blank. Any help would be appreciated in understanding what I'm doing wrong.

    #2
    When you run start_embedded_server you will see a bunch of logs about server startup. If you close that console window you have killed the server; that's most likely why, in step 2, the jsp that the Admin Console uses to actually do things is missing, because you've shut down the server.

    Another possibility would be that you simply removed that file - you should verify that it's present on disk.

    Comment


      #3
      Originally posted by Isomorphic View Post
      When you run start_embedded_server you will see a bunch of logs about server startup. If you close that console window you have killed the server; that's most likely why, in step 2, the jsp that the Admin Console uses to actually do things is missing, because you've shut down the server.

      Another possibility would be that you simply removed that file - you should verify that it's present on disk.
      I only close the server when I realize that it has crashed (Admin console is not responsive and a page refresh returns page not found). The sequence of events is 1) enter database config 2) Test (fine) 3) Save 4) crash 5) restart server and see that SID is blank and "Obtain Connections Using" is set to datasource 6) repeat.

      By the file I assume you mean the "start_embedded_server.command" command file. I know the file is present because I am double-clicking on it to execute it.

      Comment


        #4
        Generally speaking, JVMs don't suddenly die. Even fundamental errors like running out of memory are cleanly reported in the logs. Consider that you may be somehow killing or halting the server process rather than seeing it silently die.

        The file that we were saying might be missing is adminConsoleOperations.jsp. In the normal course of use, there would be no reason for this file in particular to be missing if the rest of the "tools" directory is there, but with your very abnormal results, you ought to check.

        Comment


          #5
          Originally posted by Isomorphic View Post
          Generally speaking, JVMs don't suddenly die. Even fundamental errors like running out of memory are cleanly reported in the logs. Consider that you may be somehow killing or halting the server process rather than seeing it silently die.

          The file that we were saying might be missing is adminConsoleOperations.jsp. In the normal course of use, there would be no reason for this file in particular to be missing if the rest of the "tools" directory is there, but with your very abnormal results, you ought to check.
          The adminConsoleOperations.jsp file is there. I would like to send you the entire log from Tomcat but it exceeds the allowable size limit. It also exceeds the allowable message limit so I can't paste it in the message. I am attaching the portion of the log that occurs after I enter and save the database configuration. I removed hostname, usernames and passwords and replaced them with <redacted>. Otherwise this is the complete log from this point until it crashes. I see errors and warnings but I don't know what to make of them. I would greatly appreciate your help.
          Attached Files

          Comment


            #6
            Still hoping to get some help with this issue so I can start my evaluation of your framework. Any help would be greatly appreciated in reviewing the server log I attached in the previous post.

            Comment


              #7
              Hi RodBailey1967 ,

              do you perhaps have two default databases in server.properties?
              I saw this in the log:
              Code:
              === 2017-10-15 01:53:16,986 [at]]] WARN  ISCInit - Failed to populate JNDI context with JDBC connections configured in server.properties
              javax.naming.NameAlreadyBoundException: Name [defaultDatabase] is already bound in this Context
              Best regards
              Blama

              Comment


                #8
                The problem with the server appearing to crash / disappear is reflected in this log:

                java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already
                What this basically means is that the server decided to shut down the current instance and restart. We've not had this reported before. One way you might trigger this is if, in the middle of using the Admin Console tool, you went and started editing key files or moving .jars around.

                If this doesn't sound like something you did, what we would suggest is to close any editors that are editing anything in the SDK, and close any filesystem viewers or other tools that might be holding files open under the SDK, then start the server from scratch and take absolutely no steps at all except to use the UI from within a web browser. If you still get weird behavior, we'd like to see logs for this.

                Ultimately, the Admin Console tool is optional, and you can just directly type the settings you'd like to use into the server.properties file. This is all documented here.

                As far as what's actually wrong with your settings, you've redacted them partly, but it looks like you might be typing the hostname for your server as something like "host: actualhost:port". Manually typing in that "host:" prefix, if you're doing so, doesn't look correct.


                Comment


                  #9
                  A further note - this log appears to be from just hitting the "Save" button after putting in some DB settings. This writes the settings to server.properties for you, but doesn't try them out. As far as why the connection isn't working, hit the "Test" button and, if the resulting error isn't clear enough to you, show us the logs from that.

                  Comment

                  Working...
                  X