【发布时间】:2021-08-10 12:11:06
【问题描述】:
我是 Jboss 的新手。我正在尝试使用 Jboss 启动 Spring Boot,但遇到了 postgres 驱动程序的问题。当我启动服务器时,会弹出以下错误并崩溃。
> 13:00:47,681 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "DigitalFarm_DS")
]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => ["jboss.jdbc-driver.postgresql"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"org.wildfly.data-source.DigitalFarm_DS is missing [jboss.jdbc-driver.postgresql]",
"jboss.driver-demander.java:jboss/datasources/DigitalFarmDS is missing [jboss.jdbc-driver.postgresql]"
]
}
13:00:47,682 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "DigitalFarm_DS")
]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => [
"jboss.jdbc-driver.postgresql",
"jboss.jdbc-driver.postgresql"
],
还有我的独立文件
<datasources>
<datasource jndi-name="java:jboss/datasources/DigitalFarmDS" pool-name="DigitalFarm_DS" enabled="true" use-java-context="true" statistics-enabled="true">
<connection-url>jdbc:postgresql://localhost:5432/DigitalFarm</connection-url>
<driver>postgresql</driver>
<security>
<user-name>_db_username</user-name>
<password>_db_password_</password>
</security>
</datasource>
<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true" statistics-enabled="${wildfly.datasources.statistics-enabled:${wildfly.statistics-enabled:false}}">
<connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
<driver>h2</driver>
<security>
<user-name>sa</user-name>
<password>sa</password>
</security>
</datasource>
<drivers>
<driver name="postgresql" module="org.postgresql">
<driver-class>org.postgresql.Driver</driver-class>
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
</driver>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
我正在为 wildfly 使用此依赖项
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-websocket</artifactId>
</exclusion>
</exclusions>
</dependency>
请帮帮我。你有遇到过这个问题吗?
【问题讨论】:
标签: java postgresql jboss wildfly