简体   繁体   English

org.postgresql.util.PSQLException:致命:数据库“pma-springbootdb”

[英]org.postgresql.util.PSQLException: FATAL: database “pma-springbootdb”

I am working on my first sprinboot application, Where am trying to configure the properties for postgreSQL Database in my sprinboot application.我正在开发我的第一个 sprinboot 应用程序,我正在尝试在我的 sprinboot 应用程序中配置 postgreSQL 数据库的属性。 When i run this application i am getting following error.当我运行此应用程序时,我收到以下错误。

**org.postgresql.util.PSQLException: FATAL: database "pma-springbootdb" does not exist**
    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2533) ~[postgresql-42.2.12.jar:42.2.12]
    at org.postgresql.core.v3.QueryExecutorImpl.readStartupMessages(QueryExecutorImpl.java:2645) ~[postgresql-42.2.12.jar:42.2.12]
    at org.postgresql.core.v3.QueryExecutorImpl.<init>(QueryExecutorImpl.java:138) ~[postgresql-42.2.12.jar:42.2.12]
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:255) ~[postgresql-42.2.12.jar:42.2.12]
    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49) ~[postgresql-42.2.12.jar:42.2.12]
    at org.postgresql.jd
......
2020-06-03 09:33:13.052  WARN 1225 --- [         task-1] o.h.e.j.e.i.JdbcEnvironmentInitiator     : HHH000342: Could not obtain connection to query metadata : FATAL: database "pma-springbootdb" does not exist
2020-06-03 09:33:13.078  WARN 1225 --- [  restartedMain] ConfigServletWebServerApplicationContext : **Exception encountered during context initialization - cancelling refresh attempt: nested exception is org.springframework.beans.factory.BeanCreationException:** Error creating bean with name 'mvcConversionService' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is **org.springframework.beans.BeanInstantiationException: Failed to instantiate** 
**Related cause: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'requestMappingHandlerAdapter'** defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Unsatisfied dependency expressed   : Invocation of destroy method failed on bean with name 'entityManagerFactory': org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
2020-06-03 09:33:13.079  INFO 1225 --- [  restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor  : Shutting down ExecutorService 'applicationTaskExecutor'
2020-06-03 09:33:13.084  INFO 1225 --- [  restartedMain] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2020-06-03 09:33:13.112  INFO 1225 --- [  restartedMain] ConditionEvaluationReportLoggingListener 
**Caused by: org.springframework.beans.factory.BeanCreationException:** Error creating bean with name 'mvcConversionService' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.format.support.FormattingConversionService]: Factory method 'mvcConversionService' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'employeeRepository' defined in com.jrp.pma.dao.EmployeeRepository defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration: Cannot resolve reference to bean 'jpaMappingContext'
  • PostgreSQL properties PostgreSQL 属性

    spring.datasource.url=jdbc:postgresql://localhost:5432/pma-springbootdb spring.datasource.url=jdbc:postgresql://localhost:5432/pma-springbootdb

     spring.datasource.username=*** spring.datasource.password=*** spring.datasource.initialization-mode=never spring.jpa.hibernate.ddl-auto=none spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true spring.jpa.show-sql=true spring.thymeleaf.cache=false version=3.0.0
  • SQL Query SQL查询

    CREATE SEQUENCE IF NOT EXISTS employee_seq;如果不存在则创建序列 employee_seq;

     CREATE TABLE IF NOT EXISTS employee ( employee_id BIGINT NOT NULL DEFAULT nextval('employee_seq') PRIMARY KEY, email VARCHAR(100) NOT NULL, first_name VARCHAR(100) NOT NULL, last_name VARCHAR(100) NOT NULL ); CREATE SEQUENCE IF NOT EXISTS project_seq; CREATE TABLE IF NOT EXISTS project ( project_id BIGINT NOT NULL DEFAULT nextval('project_seq') PRIMARY KEY, name VARCHAR(100) NOT NULL, stage VARCHAR(100) NOT NULL, description VARCHAR(500) NOT NULL ); CREATE TABLE IF NOT EXISTS project_employee ( project_id BIGINT REFERENCES project, employee_id BIGINT REFERENCES employee );
  • Project.java项目.java

     @Entity public class Project { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "project_seq") private Long projectId; .... .... }

    * *

    • Employee.java员工.java

    * *

     @Entity public class Employee { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "employee_seq") private long employeeId; ... .. }

PostgreSQL 数据库结构

港口

The message database "pma-springbootdb" does not exist is self-explanatory.消息database "pma-springbootdb" does not exist是不言自明的。

This database does not exist in the PostgreSQL instance running on localhost with port 5432. Either it's a wrong database name or it's the wrong instance.此数据库不存在于 PostgreSQL 实例中,该实例在localhost上运行,端口为 5432。要么是错误的数据库名称,要么是错误的实例。

Please doublecheck: pma-springboot db vs pma-springboot bd请仔细检查:pma-springboot db vs pma-springboot bd

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 org.postgresql.util.PSQLException:致命:数据库“ postgres&gt;”不存在 - org.postgresql.util.PSQLException: FATAL: database “postgres>” does not exist org.postgresql.util.PSQLException:致命:数据库“&lt;<database_name> &gt;” 不存在,在 AWS java lambda</database_name> - org.postgresql.util.PSQLException: FATAL: database “<<database_name>>” does not exist, in the AWS java lambda ClassNotFoundException:org.postgresql.util.PSQLException - ClassNotFoundException: org.postgresql.util.PSQLException org.postgresql.util.PSQLException - 2019 - org.postgresql.util.PSQLException - 2019 引起:org.postgresql.util.PSQLException:致命:剩余的连接槽是为非复制超级用户连接保留的 - Caused by: org.postgresql.util.PSQLException: FATAL: remaining connection slots are reserved for non-replication superuser connections org.postgresql.util.PSQLException:致命:主机没有pg_hba.conf条目 - org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host 如何修复 org.postgresql.util.PSQLException:致命:用户密码验证失败 - How to fix org.postgresql.util.PSQLException: FATAL: password authentication failed for user org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host Linux error that works on Windows - org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host Linux error that works on Windows org.postgresql.util.PSQLException:致命:抱歉,已经有太多客户端 - org.postgresql.util.PSQLException: FATAL: sorry, too many clients already org.postgresql.util.PSQLException: FATAL: 用户 springboot maven 项目的密码验证失败 - org.postgresql.util.PSQLException: FATAL: password authentication failed for user springboot maven project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM