我需要在JBOSS EAP 7.0服务器中创建Oracle数据源
我使用以下命令从JBOSS管理CLI(命令行界面)部署了ojdbc6.jar
deploy <PATH_TO_ORACLE_DRIVER_JAR>
字符串
我可以看到服务器日志如下后,驱动程序部署
01:25:53,338 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) WFLYJCA0018: Started Driver service with driver-name = ojdbc6.jar
01:25:53,747 INFO [org.jboss.as.server] (management-handler-thread - 6) WFLYSRV0010: Deployed "ojdbc6.jar" (runtime-name : "ojdbc6.jar")
型
但是当我尝试从Jboss管理控制台创建oracle数据源(oracle.jdbc.driver.OracleDriver作为驱动程序类)时,我得到下面的错误
01:31:35,084 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 66) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "OracleDS")
]) - failure description: {"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.driver-demander.java:/OracleDS is missing [jboss.jdbc-driver.oracle]",
"org.wildfly.data-source.OracleDS is missing [jboss.jdbc-driver.oracle]"
]}
01:31:35,092 INFO [org.jboss.as.controller] (ServerService Thread Pool -- 66) WFLYCTL0183: Service status report
WFLYCTL0184: New missing/unsatisfied dependencies:
service jboss.data-source.reference-factory.OracleDS (missing) dependents: [service jboss.naming.context.java.OracleDS]
service jboss.data-source-config.OracleDS (missing) dependents: [service org.wildfly.data-source.OracleDS]
service jboss.jdbc-driver.oracle (missing) dependents: [service jboss.driver-demander.java:/OracleDS, service org.wildfly.data-source.OracleDS]
型
1)我可以知道是什么原因导致这个问题吗?缺少什么依赖性?
2)安装JDBC驱动程序作为JAR部署以创建数据源的方法正确吗?
1条答案
按热度按时间rqqzpn5f1#
安装JDBC驱动作为核心模块
Oracle JDBC Driver module.xml文件示例
字符串
Oracle数据源配置示例
型
管理CLI命令示例
此示例配置可通过使用以下管理CLI命令来实现。
1.添加Oracle JDBC驱动作为核心模块。
模块add --name=com.oracle --resources=/path/to/misc/jdbc_drivers/oracle/ojdbc7.jar --dependencies=javax.API,javax.transaction.api
2.注册Oracle JDBC驱动。
/subsystem=datasources/jdbc-driver=oracle:add(driver-name=oracle,driver-module-name=com.oracle,driver-xa-datasource-class-name=oracle.jdbc.xa.client.OracleXADataSource)
3.添加Oracle数据源。
data-source add --name=OracleDS --jndi-name=java:jboss/OracleDS --driver-name=oracle --connection-url=jdbc:Oracle:薄:@localhost:1521:XE --user-name=admin --password=admin --validate-on-match=true --background-validation=false --valid-connection-checker-class-name=org。jboss。JCA适配器jdbc扩展。OracleOracleValidConnectionChecker --exception-sorter-class-name=org。jboss。JCA适配器jdbc扩展。OracleOracleExceptionSorter--stale-connection-checker-class-name=org。jboss。JCA适配器jdbc扩展。OracleOracleStaleConnectionChecker
请参考链接https://access.redhat.com/documentation/en/red-hat-jboss-enterprise-application-platform/version-7.0/configuration-guide/#datasource_management