【问题标题】:Problem with Deploy Gitbub CI: The connection attempt failed部署 Gitbub CI 的问题:连接尝试失败
【发布时间】:2020-04-05 12:07:21
【问题描述】:

我正在尝试使用 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

【问题讨论】:

    标签: java spring github continuous-integration devops


    【解决方案1】:

    检查数据库是否正在侦听您的连接字符串所引用的端口,可以解决的问题是从正在执行您的 spring 应用程序的任何内容中卷曲容器/服务器/等上的 postgresql 端口并相应地调整网络

    【讨论】:

      猜你喜欢
      • 2019-01-06
      • 2014-09-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-20
      • 2014-12-25
      • 2022-12-10
      • 2013-03-26
      相关资源
      最近更新 更多