jboss 7 oracle数据源配置 [英] jboss 7 oracle datasource configuration

查看:335
本文介绍了jboss 7 oracle数据源配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在从jboss 4.3迁移到jboss 7.1.1(最终版),并且我正在尝试配置oracle数据源,但是它不起作用.以下是我设置oracle数据源所做的工作

I'm currently migrating from jboss 4.3 to jboss 7.1.1 (Final) and i'm trying to configure an oracle datasource but it's not working. Following is what I've done to setup an oracle datasource

1)下载了ojdbc6-11.jar并将其放在$ JBOSS_HOME/modules/com/oracle/ojdbc6/main文件夹中

1)Downloaded ojdbc6-11.jar and placed it inside the folder $JBOSS_HOME/modules/com/oracle/ojdbc6/main

2)在$ JBOSS_HOME/modules/com/oracle/ojdbc6/main下创建文件module.xml,这就是文件的内容

2)Created the file module.xml under $JBOSS_HOME/modules/com/oracle/ojdbc6/main and this is the content of the file

<module xmlns="urn:jboss:module:1.0" name="com.oracle.ojdbc6">
  <resources>
    <resource-root path="ojdbc6.jar"/>
  </resources>
  <dependencies>
    <module name="javax.api"/>
  </dependencies>
</module>

3)在standalone.xml内添加了以下驱动程序和数据源

3)Added the following driver and datasource inside standalone.xml

<drivers>
  <driiver name="oracle" module="com.oracle.ojdbc6">
    <xa-datasource-class>oracle.jdbc.OracleDriver</xa-datasource-class>
  </driver>
</drivers>

<datasource jndi-name="java:/Altis" pool-name="Altis" enabled="true" use-java-context="true">
  <connection-url>connurl</connection-url>
  <driver>oracle</driver>
  <security>
    <user-name>username</user-name>
    <password>passwd</password>
  </security>
</datasource>
</datasources>

但是,当我部署战争文件时,出现以下错误

However, when I deploy my war file, i get the following error

16:54:43,281 INFO  [org.jboss.as.server] (HttpManagementService-threads - 2) JBA
S015870: Deploy of deployment "altisavante.war" was rolled back with failure mes
sage {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.na
ming.context.java.module.altisavante.altisavante.env.Altisjboss.naming.context.j
ava.AltisMissing[jboss.naming.context.java.module.altisavante.altisavante.env.Al
tisjboss.naming.context.java.Altis]"]}

我想念什么吗?

推荐答案

以下是有关JBoss 7的数据源配置的链接,该链接当然适用于7.1

Here's a link about the data source configuration for JBoss 7 that of course work with 7.1

https://community.jboss.org/wiki/DataSourceConfigurationInAS7

该示例正在配置一个MySQL示例.
这就是我为Oracle驱动程序所做的

The example is configuring a MySQL example.
This is what i did for an Oracle Driver

<datasource jndi-name="java:/sigap_ws_receiver" pool-name="sigap_ws_receiver" enabled="true">
    <connection-url>jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=off)(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.1)(PORT=1524))(CONNECT_DATA=(SERVICE_NAME=profepa)(SERVER=DEDICATED)))</connection-url>
    <driver>com.oracle</driver>
    <pool>
        <min-pool-size>3</min-pool-size>
        <max-pool-size>5</max-pool-size>
    </pool>
    <security>
        <user-name>user</user-name>
        <password>pass</password>
    </security>
    <validation>
        <exception-sorter class-name="org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter"/>
    </validation>
    <timeout>
        <blocking-timeout-millis>5000</blocking-timeout-millis>
        <idle-timeout-minutes>5</idle-timeout-minutes>
    </timeout>
</datasource>

驱动程序部分如下所示:

The driver's section would look like this:

<drivers>
    <driver name="com.oracle" module="com.oracle">
        <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
    </driver>
</drivers>

我的module.xml位于jar ojdbc6.jar中的$ JBOSS_HOME \ modules \ com \ oracle \ main下:

My module.xml is under $JBOSS_HOME\modules\com\oracle\main within the jar ojdbc6.jar:

<module xmlns="urn:jboss:module:1.0" name="com.oracle">
    <resources>
        <resource-root path="ojdbc6.jar"/>
    </resources>
    <dependencies>
        <module name="javax.api"/>
    </dependencies>
</module>

这篇关于jboss 7 oracle数据源配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆