部署 Gitbub CI 的问题:连接尝试失败



我正在尝试使用 github CI 部署我的应用程序。我的配置文件是应用程序默认的,它在尝试获取与数据库的连接时会生成错误。

我的工作流程是:

name: Java CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Setup PostgreSQL
uses: Harmon758/postgresql-action@v1.0.0
- name: Build with Maven
run: mvn -B package --file pom.xml

部署中生成的错误:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.exception.JDBCConnectionException: Unable to open JDBC Connection for DDL execution

检查数据库是否正在侦听连接字符串引用的端口,可以排除故障的是将容器/服务器/等上的 postgresql 端口从执行 Spring 应用程序的任何内容中卷曲并相应地调整网络

最新更新