gpt4 book ai didi

java - 错误 "org.postgresql.Driver is not a valid javax.sql.DataSource implementation"不会影响任何内容。如何去除它?

转载 作者:行者123 更新时间:2023-12-02 09:42:28 33 4
gpt4 key购买 nike

我想从 TomeEE 服务器转到 WildFly。我有使用 postgresql 数据库的应用程序。

根据不同的教程我1)将驱动部署到服务器2) 将其注册到数据源中。

enter image description here

连接测试成功。

当我尝试启动项目时,出现以下错误:

09:18:45,442 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "PostgresDS")
]) - failure description: {"WFLYCTL0080: Failed services" => {"org.wildfly.data-source.PostgresDS" => "WFLYJCA0033: Error during the deployment of PostgresDS
Caused by: org.jboss.jca.deployers.common.DeployException: WFLYJCA0030: unable to deploy
Caused by: org.jboss.as.controller.OperationFailedException: WFLYJCA0117: org.postgresql.Driver is not a valid javax.sql.DataSource implementation [ \"WFLYJCA0117: org.postgresql.Driver is not a valid javax.sql.DataSource implementation\" ]"}}
09:18:45,443 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "PostgresDS")

但是一切正常!是什么原因导致此错误?我可以删除它吗?

附注我有一个依赖项 im pom.xml:

        <dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.5</version>
</dependency>

我的 persistence.xml:

<persistence-unit name="PersistenceUnitJTA" transaction-type="JTA">
<jta-data-source>java:jboss/PostgresDS</jta-data-source>
<properties>
...
</properties>
</persistence-unit>

最佳答案

As documented in the manual Postgres JDBC 驱动程序提供的 DataSource 实现类是:org.postgresql.ds.PGConnectionPoolDataSource

您需要在“数据源类”属性中配置类名。

关于java - 错误 "org.postgresql.Driver is not a valid javax.sql.DataSource implementation"不会影响任何内容。如何去除它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56965154/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com