获取Jhipster应用程序的用户创建异常
我已经使用Jhipster(Angular,MySQL)成功地生成了应用程序。作为管理员,我已经登录并尝试创建一个新用户,但我得到以下错误获取Jhipster应用程序的用户创建异常,jhipster,Jhipster,我已经使用Jhipster(Angular,MySQL)成功地生成了应用程序。作为管理员,我已经登录并尝试创建一个新用户,但我得到以下错误 2021-05-10 21:55:14.218 ERROR 29756 --- [ XNIO-1 task-2] com.kc.bsadhana.service.UserService : Exception in createUser() with cause = 'java.lang.RuntimeException: Connection
2021-05-10 21:55:14.218 ERROR 29756 --- [ XNIO-1 task-2] com.kc.bsadhana.service.UserService : Exception in createUser() with cause = 'java.lang.RuntimeException: Connection refused' and exception = 'Connection refused; nested exception is java.lang.RuntimeException: Connection refused'
org.springframework.dao.DataAccessResourceFailureException: Connection refused; nested exception is java.lang.RuntimeException: Connection refused
at org.springframework.data.elasticsearch.core.ElasticsearchExceptionTranslator.translateExceptionIfPossible(ElasticsearchExceptionTranslator.java:75)
at org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.translateException(ElasticsearchRestTemplate.java:362)
at org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.execute(ElasticsearchRestTemplate.java:345)
at org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.doIndex(ElasticsearchRestTemplate.java:143)
在application-dev.yml
文件中,我输入了数据库凭据:
datasource:
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:mysql://localhost:3306/bsadhana?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC&createDatabaseIfNotExist=true
username: root
password: rxxxx!
hikari:
甚至jhipster相关的表都是在我的数据库中创建的。但是当我试图创建一个新用户时,它抛出了上面报告的错误。是否还有其他地方需要输入这些凭据?错误表明您的应用程序无法连接到Elasticsearch实例,您应该确保使用以下命令启动它,如所述:
datasource:
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:mysql://localhost:3306/bsadhana?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC&createDatabaseIfNotExist=true
username: root
password: rxxxx!
hikari:
docker-compose -f src/main/docker/elasticsearch.yml up