Postgresql 无法创建请求的服务(Hibernate&x2B;JPA)

Postgresql 无法创建请求的服务(Hibernate&x2B;JPA),postgresql,hibernate,jpa,Postgresql,Hibernate,Jpa,我正在尝试设置与postgresql数据库的连接以创建SessionFactory。但是,当我尝试启动我的应用程序时,总是会出现“无法创建请求的服务”的错误 密码、名称和url正确。 <?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"

我正在尝试设置与postgresql数据库的连接以创建SessionFactory。但是,当我尝试启动我的应用程序时,总是会出现“无法创建请求的服务”的错误
密码、名称和url正确。

<?xml version='1.0' encoding='utf-8'?> 
<!DOCTYPE hibernate-configuration PUBLIC
    "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
    "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>

    <!-- Database connection settings -->
    <property name="connection.driver_class">org.postgresql.Driver</property>
    <property name="connection.url">jdbc:postgresql://127.0.0.1:5432/Hibernate</property>
    <property name="connection.username">postgres</property>
    <property name="connection.password">vfrae0v5</property>

    <!-- SQL dialect -->
    <property name="dialect">org.hibernate.dialect.PostgreSQL10Dialect</property>

    <!-- Echo all executed SQL to stdout -->
    <property name="show_sql">true</property>

</session-factory>

将您的属性更改为:

<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQL10Dialect" />


错误很明显,您没有指定hibernate.dialogue属性,如果可以连接到数据库,则不需要设置方言,但在您的情况下,似乎没有数据库侦听127.0.0.1:5432

its not persist.xml文件我想您需要在持久性xml中设置它,我编辑我的comment@DaniilBaev即使如此,错误也会告诉您正确的名称是
hibernate.dialogue
,而不仅仅是
dialogue
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQL10Dialect" />