Uploaded image for project: 'Apache Hop (incubating)'
  1. Apache Hop (incubating)
  2. HOP-2422

Test DB connection does not use variables correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 0.70
    • GUI
    • None
    • Windows 10, hop 060 as of 2021/01/14

    Description

      The "Test" functionality in the metadata "Relational Database Connection" dialog does not work when variables are used for the DB connection details.

      Although the correct variable contents coming from an environment config file are shown when hovering over the fields, the "Test" fails with ad throws a stracktrac, see below.

      Seems like it is trying to check against the variable name strings instead of the values.

      Within a pipeline the database connection is correctly working.

      Environment

       

       

      Error connecting to database [immodb] :org.apache.hop.core.exception.HopDatabaseException: 
      Error occurred while trying to connect to the databaseError connecting to database: (using class org.mariadb.jdbc.Driver)
      For input string: "${IMMODBPORT}"
      org.apache.hop.core.exception.HopDatabaseException: 
      Error occurred while trying to connect to the databaseError connecting to database: (using class org.mariadb.jdbc.Driver)
      For input string: "${IMMODBPORT}"
      	at org.apache.hop.core.database.Database.normalConnect(Database.java:413)
      	at org.apache.hop.core.database.Database.connect(Database.java:345)
      	at org.apache.hop.core.database.Database.connect(Database.java:315)
      	at org.apache.hop.core.database.Database.connect(Database.java:305)
      	at org.apache.hop.core.database.DatabaseFactory.getConnectionTestReport(DatabaseFactory.java:50)
      	at org.apache.hop.core.database.DatabaseFactory.getConnectionTestResults(DatabaseFactory.java:71)
      	at org.apache.hop.core.database.DatabaseMeta.testConnectionSuccess(DatabaseMeta.java:2048)
      	at org.apache.hop.ui.core.database.DatabaseMetaEditor.testConnection(DatabaseMetaEditor.java:755)
      	at org.apache.hop.ui.core.database.DatabaseMetaEditor.test(DatabaseMetaEditor.java:671)
      	at org.apache.hop.ui.core.database.DatabaseMetaEditor.lambda$createButtonsForButtonBar$3(DatabaseMetaEditor.java:798)
      	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
      	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4105)
      	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1037)
      	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3922)
      	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3524)
      	at org.apache.hop.ui.hopgui.HopGui.open(HopGui.java:383)
      	at org.apache.hop.ui.hopgui.HopGui.main(HopGui.java:312)
      Caused by: org.apache.hop.core.exception.HopDatabaseException: 
      Error connecting to database: (using class org.mariadb.jdbc.Driver)
      For input string: "${IMMODBPORT}"	at org.apache.hop.core.database.Database.connectUsingClass(Database.java:510)
      	at org.apache.hop.core.database.Database.normalConnect(Database.java:398)
      	... 16 more
      Caused by: java.lang.NumberFormatException: For input string: "${IMMODBPORT}"
      	at java.base/java.lang.NumberFormatException.forInputString(Unknown Source)
      	at java.base/java.lang.Integer.parseInt(Unknown Source)
      	at java.base/java.lang.Integer.parseInt(Unknown Source)
      	at org.mariadb.jdbc.HostAddress.parseSingleHostAddress(HostAddress.java:49)
      	at org.mariadb.jdbc.HostAddress.parse(HostAddress.java:19)
      	at org.mariadb.jdbc.JDBCUrl.parseConnectorJUrl(JDBCUrl.java:107)
      	at org.mariadb.jdbc.JDBCUrl.parse(JDBCUrl.java:125)
      	at org.mariadb.jdbc.Driver.connect(Driver.java:104)
      	at org.apache.hop.core.database.DelegatingDriver.connect(DelegatingDriver.java:47)
      	at java.sql/java.sql.DriverManager.getConnection(Unknown Source)
      	at java.sql/java.sql.DriverManager.getConnection(Unknown Source)
      	at org.apache.hop.core.database.Database.connectUsingClass(Database.java:491)
      	... 17 moreHostname:	${IMMODBHOST}
      Port:	${IMMODBPORT}
      Database name:	${IMMODBNAME}
      Url:	jdbc:mariadb://192.168.115.12:3306/immo

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              pfabrici Peter Fabricius
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: