10 Replies Latest reply on Sep 14, 2018 2:20 PM by claudio4j

    WildFly-14: Oracle Url is invalid

    mayerw01

      It looks like WildFly 14 is not accepting the Oracle Url at all.

      Where the URL is of the form:  jdbc:oracle:<drivertype>:@<database> (OracleDriver (Oracle ® Database JDBC API Reference)

       

      Test connection fails with an java.sql.SQLException: Invalid  Oracle-URL provided : OracleDataSource.makeURL

       

      Obviously the reason is the '@' sign.

      When trying to save the datasource entry also an message is reported

      Steps may not be null

        • 1. Re: WildFly-14: Oracle Url is invalid
          claudio4j

          I created a oracle datasource with: jdbc:oracle:thin:@localhost:1521:orcalesid222 and it worked, then edited and saved with no problem.

          If you upgraded wildfly, it may be possible the HAL javascript code is cached, in this case, can you clean your browser cache and try again ?

           

          • 2. Re: WildFly-14: Oracle Url is invalid
            mayerw01

            Claudio did you also test the connection?

             

            I cleaned the browser cache and the issue with the '@' character disappeared.

            But the connection does still not work. And now I realized that following message is logged at startup:

             

            12:48:09,894 WARN  [org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService$AS7DataSourceDeployer] (MSC service thread 1-4) IJ020020: Connection Properties for DataSource: 'java:jboss/datasources/OracleTicket2RockDS' is empty, try to use driver-class: 'oracle.jdbc.driver.OracleDriver' and connection-url: 'jdbc:oracle:thin:@gigabyte:1521:xe' to connect database

             

            The test connection logs another message:

             

            12:59:35,673 WARN  [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (External Management Request Threads -- 2) IJ000604: Throwable while attempting to get a new connection: null: javax.resource.ResourceException: IJ031084: Unable to create connection

             

            It looks like the <connection-url> and <driver-class> parameters are ignored at all.

             

            When I add the Connection Properties the IJ020020 message is gone but 2 other exceptions are thrown:

             

            Caused by: javax.resource.ResourceException: IJ031089: Failed to load datasource: oracle.jdbc.pool.OracleDataSource

                    at org.jboss.ironjacamar.jdbcadapters@1.4.11.Final//org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getDataSource(LocalManagedConnectionFactory.java:654)

                    at org.jboss.ironjacamar.jdbcadapters@1.4.11.Final//org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(LocalManagedConnectionFactory.java:313)

                    ... 35 more

            Caused by: java.lang.NoSuchMethodException: Method setDriver-class not found

                    at org.jboss.ironjacamar.jdbcadapters@1.4.11.Final//org.jboss.jca.adapters.jdbc.util.Injection.inject(Injection.java:139)

                    at org.jboss.ironjacamar.jdbcadapters@1.4.11.Final//org.jboss.jca.adapters.jdbc.util.Injection.inject(Injection.java:68)

             

            I then tried to add a datasource for Postgres. It shows the same IJ020020 and IJ000604 messages.

             

            But the connection to MySql astonishly is working properly.

             

            What wonders me even more is that the XA connections for Oracle and Postgres work properly. So this issue seems to be related to non XA.

             

            When I choose "Custom" to specify my own settings the connection works.

             

            So there seems to be an issue with the predefined templates!

            • 3. Re: WildFly-14: Oracle Url is invalid
              claudio4j

              Can you paste the result of /subsystem=datasources//data-source=myds:read-resource ?

              • 4. Re: WildFly-14: Oracle Url is invalid
                mayerw01

                I am not quite sure what you want me to do. The datatasource 'myds' does not exist in my environment.

                And the other datasources are now working since I used the 'Custom' option for the set up.

                But here is the output of '/subsystem=datasources/data-source=OracleTicket2RockDS:read-resource instead'

                 

                {

                    "outcome" => "success",

                    "result" => {

                        "allocation-retry" => undefined,

                        "allocation-retry-wait-millis" => undefined,

                        "allow-multiple-users" => false,

                        "authentication-context" => undefined,

                        "background-validation" => undefined,

                        "background-validation-millis" => undefined,

                        "blocking-timeout-wait-millis" => undefined,

                        "capacity-decrementer-class" => undefined,

                        "capacity-decrementer-properties" => undefined,

                        "capacity-incrementer-class" => undefined,

                        "capacity-incrementer-properties" => undefined,

                        "check-valid-connection-sql" => undefined,

                        "connectable" => false,

                        "connection-listener-class" => undefined,

                        "connection-listener-property" => undefined,

                        "connection-url" => "jdbc:oracle:thin:@gigabyte:1521:XE",

                        "credential-reference" => undefined,

                        "datasource-class" => undefined,

                        "driver-class" => "oracle.jdbc.driver.OracleDriver",

                        "driver-name" => "oracle",

                        "elytron-enabled" => false,

                        "enabled" => true,

                        "enlistment-trace" => false,

                        "exception-sorter-class-name" => undefined,

                        "exception-sorter-properties" => undefined,

                        "flush-strategy" => undefined,

                        "idle-timeout-minutes" => undefined,

                        "initial-pool-size" => undefined,

                        "jndi-name" => "java:jboss/datasources/OracleTicket2RockDS",

                        "jta" => true,

                        "max-pool-size" => undefined,

                        "mcp" => "org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreConcurrentLinkedDequeManagedConnectionPool",

                        "min-pool-size" => undefined,

                        "new-connection-sql" => undefined,

                        "password" => "ticket2rock",

                        "pool-fair" => undefined,

                        "pool-prefill" => undefined,

                        "pool-use-strict-min" => undefined,

                        "prepared-statements-cache-size" => undefined,

                        "query-timeout" => undefined,

                        "reauth-plugin-class-name" => undefined,

                        "reauth-plugin-properties" => undefined,

                        "security-domain" => undefined,

                        "set-tx-query-timeout" => false,

                        "share-prepared-statements" => false,

                        "spy" => false,

                        "stale-connection-checker-class-name" => undefined,

                        "stale-connection-checker-properties" => undefined,

                        "statistics-enabled" => false,

                        "track-statements" => "NOWARN",

                        "tracking" => false,

                        "transaction-isolation" => undefined,

                        "url-delimiter" => undefined,

                        "url-selector-strategy-class-name" => undefined,

                        "use-ccm" => true,

                        "use-fast-fail" => false,

                        "use-java-context" => true,

                        "use-try-lock" => undefined,

                        "user-name" => "ticket2rock",

                        "valid-connection-checker-class-name" => undefined,

                        "valid-connection-checker-properties" => undefined,

                        "validate-on-match" => undefined,

                        "connection-properties" => undefined,

                        "statistics" => {

                            "jdbc" => undefined,

                            "pool" => undefined

                        }

                    }

                }

                • 5. Re: WildFly-14: Oracle Url is invalid
                  claudio4j

                  Sorry to take so long to get back, is the problem still persists ?

                  • 6. Re: WildFly-14: Oracle Url is invalid
                    mayerw01

                    The problem persists in so far that the templates are erroneous.

                    When choosing "custom" erverything seems to be working

                    • 7. Re: WildFly-14: Oracle Url is invalid
                      claudio4j

                      Can you post the "oracle" jdbc-driver configuration ?

                       

                      /subsystem=datasources/jdbc-driver=oracle:read-resource

                      • 8. Re: WildFly-14: Oracle Url is invalid
                        mayerw01

                        <driver name="oracle" module="com.oracle">

                              <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>

                               <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>

                            </driver>

                         

                         

                        {

                            "outcome" => "success",

                            "result" => {

                                "deployment-name" => undefined,

                                "driver-class-name" => "oracle.jdbc.driver.OracleDriver",

                                "driver-datasource-class-name" => undefined,

                                "driver-major-version" => undefined,

                                "driver-minor-version" => undefined,

                                "driver-module-name" => "com.oracle",

                                "driver-name" => "oracle",

                                "driver-xa-datasource-class-name" => "oracle.jdbc.xa.client.OracleXADataSource",

                                "jdbc-compliant" => undefined,

                                "module-slot" => undefined,

                                "profile" => undefined,

                                "xa-datasource-class" => undefined

                            }

                        }

                        • 9. Re: WildFly-14: Oracle Url is invalid
                          claudio4j

                          I could test it now, the Oracle template wrongly uses the oracle.jdbc.pool.OracleDataSource as datasource-class, but the correct value should be oracle.jdbc.datasource.OracleDataSource.

                           

                          You can use the "Custom" template or use the Oracle template and later clear the datasource-class attribute of the datasource entry.

                           

                          Thanks for reporting this error.

                          • 10. Re: WildFly-14: Oracle Url is invalid
                            claudio4j

                            I just confused the tests locally, the oracle jdbc datasource oracle.jdbc.pool.OracleDataSource  is correct. The oracle.jdbc.datasource.OracleDataSource is a interface and will not work.

                             

                            Setting the datasource-class and testing it, thows  URL Oracle invalid: OracleDataSource.makeURL. To fix it just remove the datasource-class from the datasource entry.