Jdbc Wildfly 10期末博士后驾驶员类别例外

Jdbc Wildfly 10期末博士后驾驶员类别例外,jdbc,postgresql-9.4,wildfly-10,Jdbc,Postgresql 9.4,Wildfly 10,最终有人能帮助我。目前,我在使用postgres驱动程序启动wildfly 10 Final时遇到了一个非常奇怪的问题,但在相同的设置下,wildfly 10 CR4将启动 我得到的例外情况如下: Caused by: javax.resource.ResourceException: IJ031089: Failed to load datasource: org.postgresql.Driver at org.jboss.jca.adapters.jdbc.local.LocalM

最终有人能帮助我。目前,我在使用postgres驱动程序启动wildfly 10 Final时遇到了一个非常奇怪的问题,但在相同的设置下,wildfly 10 CR4将启动

我得到的例外情况如下:

Caused by: javax.resource.ResourceException: IJ031089: Failed to load datasource: org.postgresql.Driver
    at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getDataSource(LocalManagedConnectionFactory.java:650)
    at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(LocalManagedConnectionFactory.java:311)
    ... 6 more
Caused by: java.lang.ClassCastException: org.postgresql.Driver cannot be cast to javax.sql.DataSource
    at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getDataSource(LocalManagedConnectionFactory.java:633)
    ... 7 more
奇怪的是,它适用于wildfly 10 CR4,但不适用于最终版本wildfly 10 final。有什么想法吗? 对我来说,这看起来像是一个类加载器问题,但我不是wildfly追踪它的专家

我的模块/org/postgres/main/module.xml:


我在standalone.xml中的驱动程序定义


org.postgresql.xa.PGXADataSource
org.postgresql.Driver
JavaJDK是:jdk1.8.0_73

如果能帮我解决问题,我将不胜感激

提前Thx


/david

实现数据源的类名为:

org.postgresql.ds.PGSimpleDataSource

我假设Wildfly将管理连接,因此您可能不需要池数据源,只需要简单的: 应该如此

<driver name="postgres" module="org.postgres">
    <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
    <datasource-class>org.postgresql.ds.PGSimpleDataSource</datasource-class>
</driver>

org.postgresql.xa.PGXADataSource
org.postgresql.ds.PGSimpleDataSource

ConnectionPoolDataSource不是(或不应该是)数据源。在
PGConnectionPoolDataSource
的情况下,它只实现
ConnectionPoolDataSource
。据我所知,WildFly希望这里有一个
数据源
。非常感谢你们两位!阅读你的回答听起来很合理;)datasource类需要一个数据源。不管怎样,谢谢!
org.postgresql.ds.PGSimpleDataSource
org.postgresql.ds.PGPoolingDataSource
<driver name="postgres" module="org.postgres">
    <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
    <datasource-class>org.postgresql.ds.PGSimpleDataSource</datasource-class>
</driver>