Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-14297

Connecting to SAP HANA does not work with the prescribed driver

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • dv-future
    • fuse-next-kafkaconnect-TP1-GA
    • Data Integration
    • None
    • % %

      When creating a VDB with a SAP HANA datasource, the correct maven dependency according to the docs is com.sap.cloud.db.jdbc:ngdbc:pom:2.4.76. However, with that dependency included in the VDB CR, I get the following error on VDB start:

      Caused by: java.lang.RuntimeException: Failed to get driver instance for jdbcUrl=jdbc:sap://54.187.27.202:30015
      	at com.zaxxer.hikari.util.DriverDataSource.<init>(DriverDataSource.java:114) ~[HikariCP-3.4.2.jar!/:na]
      	at com.zaxxer.hikari.pool.PoolBase.initializeDataSource(PoolBase.java:321) ~[HikariCP-3.4.2.jar!/:na]
      	at com.zaxxer.hikari.pool.PoolBase.<init>(PoolBase.java:110) ~[HikariCP-3.4.2.jar!/:na]
      	at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:108) ~[HikariCP-3.4.2.jar!/:na]
      	at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) ~[HikariCP-3.4.2.jar!/:na]
      	at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:158) ~[spring-jdbc-5.2.5.RELEASE.jar!/:5.2.5.RELEASE]
      	at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:116) ~[spring-jdbc-5.2.5.RELEASE.jar!/:5.2.5.RELEASE]
      	at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:79) ~[spring-jdbc-5.2.5.RELEASE.jar!/:5.2.5.RELEASE]
      	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:324) ~[spring-jdbc-5.2.5.RELEASE.jar!/:5.2.5.RELEASE]
      	at org.springframework.boot.jdbc.EmbeddedDatabaseConnection.isEmbedded(EmbeddedDatabaseConnection.java:120) ~[spring-boot-2.2.6.RELEASE.jar!/:2.2.6.RELEASE]
      	at org.springframework.boot.autoconfigure.orm.jpa.DataSourceInitializedPublisher.lambda$isInitializingDatabase$0(DataSourceInitializedPublisher.java:116) ~[spring-boot-autoconfigure-2.2.6.RELEASE.jar!/:2.2.6.RELEASE]
      	at org.springframework.boot.autoconfigure.orm.jpa.HibernateSettings.getDdlAuto(HibernateSettings.java:41) ~[spring-boot-autoconfigure-2.2.6.RELEASE.jar!/:2.2.6.RELEASE]
      	at org.springframework.boot.autoconfigure.orm.jpa.HibernateProperties.determineDdlAuto(HibernateProperties.java:136) ~[spring-boot-autoconfigure-2.2.6.RELEASE.jar!/:2.2.6.RELEASE]
      	at org.springframework.boot.autoconfigure.orm.jpa.HibernateProperties.getAdditionalProperties(HibernateProperties.java:102) ~[spring-boot-autoconfigure-2.2.6.RELEASE.jar!/:2.2.6.RELEASE]
      	at org.springframework.boot.autoconfigure.orm.jpa.HibernateProperties.determineHibernateProperties(HibernateProperties.java:94) ~[spring-boot-autoconfigure-2.2.6.RELEASE.jar!/:2.2.6.RELEASE]
      	at org.springframework.boot.autoconfigure.orm.jpa.DataSourceInitializedPublisher.isInitializingDatabase(DataSourceInitializedPublisher.java:118) ~[spring-boot-autoconfigure-2.2.6.RELEASE.jar!/:2.2.6.RELEASE]
      	at org.springframework.boot.autoconfigure.orm.jpa.DataSourceInitializedPublisher.publishEventIfRequired(DataSourceInitializedPublisher.java:98) ~[spring-boot-autoconfigure-2.2.6.RELEASE.jar!/:2.2.6.RELEASE]
      	at org.springframework.boot.autoconfigure.orm.jpa.DataSourceInitializedPublisher.postProcessAfterInitialization(DataSourceInitializedPublisher.java:90) ~[spring-boot-autoconfigure-2.2.6.RELEASE.jar!/:2.2.6.RELEASE]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:431) ~[spring-beans-5.2.3.RELEASE.jar!/:5.2.3.RELEASE]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) ~[spring-beans-5.2.3.RELEASE.jar!/:5.2.3.RELEASE]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595) ~[spring-beans-5.2.3.RELEASE.jar!/:5.2.3.RELEASE]
      	... 23 common frames omitted
      Caused by: java.sql.SQLException: No suitable driver
      	at java.sql/java.sql.DriverManager.getDriver(DriverManager.java:298) ~[java.sql:na]
      	at com.zaxxer.hikari.util.DriverDataSource.<init>(DriverDataSource.java:106) ~[HikariCP-3.4.2.jar!/:na]
      	... 43 common frames omitted
      

      A workaroud for me was to include the original driver we used in legacy DV for connecting to HANA (version 1.00.102, obtained from our private nexus repo). This might be due to the fact that our instance of HANA is also version 1.00.x. QE currently does not have access to a newer HANA instance.

      Also note that with the above workaround, both the drivers need to be specified as dependencies, otherwise the VDB build will fail with the missing ngdbc dependency.

            rhn-engineering-rareddy Ramesh Reddy
            asmigala@redhat.com Andrej Smigala
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: