Jhipster关于启动时jawsdb MariaDB插件的Heroku问题

Jhipster关于启动时jawsdb MariaDB插件的Heroku问题,heroku,mariadb,jhipster,hikaricp,jawsdb-maria,Heroku,Mariadb,Jhipster,Hikaricp,Jawsdb Maria,我正在尝试用maven、angular和maria db部署一个基本的jhipster应用程序。按照jhipster指南,我已经配置了应用程序并部署了本地编译的项目。所有上传都正常,但在启动过程中,我收到了以下问题: 2020-11-12T16:15:57.719036+00:00 app[web.1]: 2020-11-12 16:15:57.701 INFO 4 --- [ main] com.gate42.advpoint.AdvpointApp :

我正在尝试用maven、angular和maria db部署一个基本的jhipster应用程序。按照jhipster指南,我已经配置了应用程序并部署了本地编译的项目。所有上传都正常,但在启动过程中,我收到了以下问题:

2020-11-12T16:15:57.719036+00:00 app[web.1]: 2020-11-12 16:15:57.701  INFO 4 --- [           main] com.gate42.advpoint.AdvpointApp          : Starting AdvpointApp on cd5ce05d-5f60-4f27-a236-8c53eab442f9 with PID 4 (/app/target/advpoint-0.0.1-SNAPSHOT.jar started by u32323 in /app)
2020-11-12T16:15:57.735456+00:00 app[web.1]: 2020-11-12 16:15:57.728  INFO 4 --- [           main] com.gate42.advpoint.AdvpointApp          : The following profiles are active: prod,heroku
2020-11-12T16:16:05.779094+00:00 app[web.1]: 2020-11-12 16:16:05.776 ERROR 4 --- [           main] com.zaxxer.hikari.HikariConfig           : Failed to load driver class com.mysql.cj.jdbc.Driver from HikariConfig class classloader org.springframework.boot.loader.LaunchedURLClassLoader@6d00a15d
2020-11-12T16:16:05.781901+00:00 app[web.1]: 2020-11-12 16:16:05.781  WARN 4 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'servletEndpointRegistrar' defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration$WebMvcServletEndpointManagementContextConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrar]: Factory method 'servletEndpointRegistrar' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'healthEndpoint' defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.class]: Unsatisfied dependency expressed through method 'healthEndpoint' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'healthContributorRegistry' defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.health.HealthContributorRegistry]: Factory method 'healthContributorRegistry' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.actuate.autoconfigure.jdbc.DataSourceHealthContributorAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under '' to com.zaxxer.hikari.HikariDataSource
2020-11-12T16:16:05.820063+00:00 app[web.1]: 2020-11-12 16:16:05.819 ERROR 4 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   :
2020-11-12T16:16:05.820065+00:00 app[web.1]:
2020-11-12T16:16:05.820066+00:00 app[web.1]: ***************************
2020-11-12T16:16:05.820066+00:00 app[web.1]: APPLICATION FAILED TO START
2020-11-12T16:16:05.820067+00:00 app[web.1]: ***************************
2020-11-12T16:16:05.820067+00:00 app[web.1]:
2020-11-12T16:16:05.820068+00:00 app[web.1]: Description:
2020-11-12T16:16:05.820068+00:00 app[web.1]:
2020-11-12T16:16:05.820069+00:00 app[web.1]: Failed to bind properties under '' to com.zaxxer.hikari.HikariDataSource:
2020-11-12T16:16:05.820069+00:00 app[web.1]:
2020-11-12T16:16:05.820070+00:00 app[web.1]: Property: driverclassname
2020-11-12T16:16:05.820071+00:00 app[web.1]: Value: com.mysql.cj.jdbc.Driver
2020-11-12T16:16:05.820072+00:00 app[web.1]: Origin: "driverClassName" from property source "source"
2020-11-12T16:16:05.820073+00:00 app[web.1]: Reason: Failed to load driver class com.mysql.cj.jdbc.Driver in either of HikariConfig class loader or Thread context classloader
2020-11-12T16:16:05.820073+00:00 app[web.1]:
2020-11-12T16:16:05.820073+00:00 app[web.1]: Action:
2020-11-12T16:16:05.820074+00:00 app[web.1]:
2020-11-12T16:16:05.820074+00:00 app[web.1]: Update your application's configuration
2020-11-12T16:16:05.820074+00:00 app[web.1]:
2020-11-12T16:16:05.957077+00:00 heroku[web.1]: Process exited with status 1
2020-11-12T16:16:06.003260+00:00 heroku[web.1]: State changed from starting to crashed
2020-11-12T16:42:37.888949+00:00 heroku[web.1]: State changed from crashed to starting
我的heroku配置是application-heroku.yml,是自动创建的:

eureka:
  instance:
    hostname: advpoint.herokuapp.com
    non-secure-port: 80
    prefer-ip-address: false

spring:
  datasource:
    type: com.zaxxer.hikari.HikariDataSource
    url: ${JDBC_DATABASE_URL}
    username: ${JDBC_DATABASE_USERNAME}
    password: ${JDBC_DATABASE_PASSWORD}
    hikari:
      maximumPoolSize: 8
数据库连接信息由jawsdb插件自动创建。 我能做些什么来解决这个问题?
多亏了这些答案。

为了解决这个问题,我在pom文件中添加了这个依赖项:

<dependency>
     <groupId>mysql</groupId>
     <artifactId>mysql-connector-java</artifactId>
</dependency>

mysql
mysql连接器java
我认为在heroku配置期间,它是自动添加的。
我不知道这是否会成为一个问题,但我认为这可以由jawsdb插件在使用时自动完成。

您尝试过这个吗?我不确定这是jawsdb插件的问题,它不应该负责管理您的项目依赖关系;我宁愿认为这是jhipster生成器或其heroku子生成器中的一个bug。欢迎在github上报告更多细节。此外,Jhipster中不推荐使用MySQL,而支持PostgreSQL