我正在寻找一个涉及jboss数据源的问题的帮助。
我在64位CentOS 7虚拟机上运行Jboss EAP 6.4.0GA域。我试图将postgresql数据源添加到名为uat_prod的数据库,但看起来驱动程序未正确加载。我可以添加数据源,当我们重新启动服务器时,服务器日志显示:
JBAS010404:部署不符合JDBC的驱动程序类org.postgresql.Driver(版本9.2) JBAS015876:开始部署" postgresql-9.2-1004.jdbc4.jar" (runtime-name:" postgresql-driver")
我可以启用数据源,但是当我们测试连接时,我们会收到以下错误:
尝试获取新连接时抛出:null:javax.resource.ResourceException:无法创建连接 引起:javax.resource.ResourceException:无法注册驱动程序:postgresql-driver 引起:java.lang.ClassNotFoundException:postgresql-driver来自[Module" deployment.postgresql-driver:main"来自服务模块加载器]
谢谢你看看。
/opt/jboss-eap-6.4/domain/configuration/domain.xml
<datasources>
<datasource jta="true" jndi-name="java:/comp/env/jdbc/conuat_prod" pool-name="conuat_prod" enabled="true" use-ccm="false" statistics-enabled="false">
<connection-url>jdbc:postgresql://localhost:5432/uat_prod</connection-url>
<driver-class>postgresql-driver</driver-class>
<driver>postgresql-driver</driver>
<pool>
<min-pool-size>0</min-pool-size>
<max-pool-size>25</max-pool-size>
<flush-strategy>IdleConnections</flush-strategy>
</pool>
<security>
<user-name>jboss</user-name>
</security>
<validation>
<validate-on-match>false</validate-on-match>
<background-validation>false</background-validation>
</validation>
<timeout>
<set-tx-query-timeout>false</set-tx-query-timeout>
<blocking-timeout-millis>0</blocking-timeout-millis>
<idle-timeout-minutes>0</idle-timeout-minutes>
<query-timeout>0</query-timeout>
<use-try-lock>0</use-try-lock>
<allocation-retry>0</allocation-retry>
<allocation-retry-wait-millis>0</allocation-retry-wait-millis>
</timeout>
<statement>
<share-prepared-statements>false</share-prepared-statements>
</statement>
</datasource>
<drivers>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
/opt/jboss-eap-6.4/modules/system/layers/base/org/postgresql/main/module.xml
(postgresql-9.3-1100.jdbc4.jar也在这个主目录中)
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="org.postgresql">
<resources>
<resource-root path="postgresql-9.3-1100.jdbc4.jar"/>
</resources>
<dependencies><module name="javax.api"/></dependencies>
</module>
服务器日志:
[服务器:posuat] 10:15:5530 WARN [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool](ServerService线程池 - 69)IJ000604:尝试获取新连接时可抛出: null:javax.resource.ResourceException:无法创建连接 [服务器:posuat]在org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:356)[ironjacamar-jdbc-1.0.31.Final-redhat-1.jar:1.0.31.Final -redhat-1] [服务器:posuat] at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:304)[ironjacamar-jdbc-1.0.31.Final-redhat-1.jar:1.0.31.Final -redhat-1] [服务器:posuat]在org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.createConnectionEventListener(SemaphoreArrayListManagedConnectionPool.java:834)[ironjacamar-core-impl-1.0.31.Final-redhat-1.jar:1.0 .31.Final-红帽-1] [服务器:posuat] at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.getConnection(SemaphoreArrayListManagedConnectionPool.java:379)[ironjacamar-core-impl-1.0.31.Final-redhat-1.jar:1.0 .31.Final-红帽-1] [服务器:posuat]在org.jboss.jca.core.connectionmanager.pool.AbstractPool.internalTestConnection(AbstractPool.java:728)[ironjacamar-core-impl-1.0.31.Final-redhat-1.jar:1.0.31 .Final-红帽-1] [服务器:posuat]在org.jboss.jca.core.connectionmanager.pool.strategy.OnePool.testConnection(OnePool.java:89)[ironjacamar-core-impl-1.0.31.Final-redhat-1.jar:1.0 .31.Final-红帽-1] [服务器:posuat]在org.jboss.as.connector.subsystems.common.pool.PoolOperations $ TestConnectionInPool.invokeCommandOn(PoolOperations.java:143)[jboss-as-connector-7.5.0.Final-redhat-21.jar :7.5.0.Final-红帽-21] [服务器:posuat]在org.jboss.as.connector.subsystems.common.pool.PoolOperations $ 1.execute(PoolOperations.java:82)[jboss-as-connector-7.5.0.Final-redhat-21.jar: 7.5.0.Final-红帽-21] [服务器:posuat]在org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:702)[jboss-as-controller-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat -21] [服务器:posuat]在org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:537)[jboss-as-controller-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat -21] [服务器:posuat]在org.jboss.as.controller.AbstractOperationContext.completeStepInternal(AbstractOperationContext.java:338)[jboss-as-controller-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat -21] [服务器:posuat]在org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:314)[jboss-as-controller-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat -21] [服务器:posuat]在org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1144)[jboss-as-controller-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat -21] [服务器:posuat]在org.jboss.as.controller.ModelControllerImpl.internalExecute(ModelControllerImpl.java:331)[jboss-as-controller-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat -21] [服务器:posuat]在org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:201)[jboss-as-controller-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat -21] [服务器:posuat]在org.jboss.as.controller.remote.TransactionalProtocolOperationHandler.internalExecute(TransactionalProtocolOperationHandler.java:235)[jboss-as-controller-7.5.0.Final-redhat-21.jar:7.5.0.Final -redhat-21] [服务器:posuat]在org.jboss.as.controller.remote.TransactionalProtocolOperationHandler $ ExecuteRequestHandler.doExecute(TransactionalProtocolOperationHandler.java:175)[jboss-as-controller-7.5.0.Final-redhat-21.jar:7.5.0 .Final-红帽-21] [服务器:posuat]在org.jboss.as.controller.remote.TransactionalProtocolOperationHandler $ ExecuteRequestHandler $ 1.run(TransactionalProtocolOperationHandler.java:138)[jboss-as-controller-7.5.0.Final-redhat-21.jar:7.5。 0.Final-红帽-21] [服务器:posuat]在org.jboss.as.controller.remote.TransactionalProtocolOperationHandler $ ExecuteRequestHandler $ 1.run(TransactionalProtocolOperationHandler.java:134)[jboss-as-controller-7.5.0.Final-redhat-21.jar:7.5。 0.Final-红帽-21] java.security.AccessController.doPrivileged [Native Method] [服务器:posuat] [rt.jar:1.8.0_131] [服务器:posuat]在javax.security.auth.Subject.doAs(Subject.java:360)[rt.jar:1.8.0_131] [服务器:posuat]在org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:83)[jboss-as-controller-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat -21] [服务器:posuat]在org.jboss.as.controller.remote.TransactionalProtocolOperationHandler $ ExecuteRequestHandler $ 2 $ 1.run(TransactionalProtocolOperationHandler.java:154)[jboss-as-controller-7.5.0.Final-redhat-21.jar:7.5 .0.Final-红帽-21] [服务器:posuat]在org.jboss.as.controller.remote.TransactionalProtocolOperationHandler $ ExecuteRequestHandler $ 2 $ 1.run(TransactionalProtocolOperationHandler.java:150)[jboss-as-controller-7.5.0.Final-redhat-21.jar:7.5 .0.Final-红帽-21] java.security.AccessController.doPrivileged [Native Method] [服务器:posuat] [rt.jar:1.8.0_131] [服务器:posuat]在org.jboss.as.controller.remote.TransactionalProtocolOperationHandler $ ExecuteRequestHandler $ 2.execute(TransactionalProtocolOperationHandler.java:150)[jboss-as-controller-7.5.0.Final-redhat-21.jar:7.5。 0.Final-红帽-21] [服务器:posuat] at org.jboss.as.protocol.mgmt.AbstractMessageHandler $ 2 $ 1.doExecute(AbstractMessageHandler.java:298) [服务器:posuat] at org.jboss.as.protocol.mgmt.AbstractMessageHandler $ AsyncTaskRunner.run(AbstractMessageHandler.java:537) [服务器:posuat]在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[rt.jar:1.8.0_131] [服务器:posuat]在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)[rt.jar:1.8.0_131] [服务器:posuat]在java.lang.Thread.run(Thread.java:748)[rt.jar:1.8.0_131] [服务器:posuat]在org.jboss.threads.JBossThread.run(JBossThread.java:122)[jboss-threads-2.1.2.Final-redhat-1.jar:2.1.2.Final-redhat-1] [服务器:posuat]引起:javax.resource.ResourceException:无法注册驱动程序:postgresql-driver [服务器:posuat]在org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getDriver(LocalManagedConnectionFactory.java:654)[ironjacamar-jdbc-1.0.31.Final-redhat-1.jar:1.0.31.Final -redhat-1] [服务器:posuat]在org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:317)[ironjacamar-jdbc-1.0.31.Final-redhat-1.jar:1.0.31.Final -redhat-1] [服务器:posuat] ......还有31个 [服务器:posuat]引起:java.lang.ClassNotFoundException:postgresql-driver来自[Module&#34; deployment.postgresql-driver:main&#34;来自服务模块加载器] [服务器:posuat]在org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213)[jboss-modules.jar:1.3.6.Final-redhat-1] [服务器:posuat]在org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459)[jboss-modules.jar:1.3.6.Final-redhat-1] [服务器:posuat]在org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408)[jboss-modules.jar:1.3.6.Final-redhat-1] [服务器:posuat]在org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389)[jboss-modules.jar:1.3.6.Final-redhat-1] [服务器:posuat]在org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134)[jboss-modules.jar:1.3.6.Final-redhat-1] java.lang.Class.forName0上的[Server:posuat](本机方法)[rt.jar:1.8.0_131] java.lang.Class.forName上的[Server:posuat](Class.java:348)[rt.jar:1.8.0_131] [服务器:posuat]在org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getDriver(LocalManagedConnectionFactory.java:640)[ironjacamar-jdbc-1.0.31.Final-redhat-1.jar:1.0.31.Final -redhat-1] [服务器:posuat] ... 32更多
答案 0 :(得分:0)
您可以在EAP 6 Administration and Configuration Guide - 6.8. Example Datasources中找到多个数据库的数据源示例配置。 我建议先检查一下。