2015-03-24 64 views
1

添加更新: 我能夠解決。抓取ojdbc6.jar並使用而不是14.我通過將<driver>oracle</driver>中的名稱更改爲允許數據源使用ojdbc6的oracle驅動程序的.jar <driver>ojdbc6.jar</driver>的名稱來解決問題。JBOSS 6.2 EAP缺少依賴關係數據源

從我所學到的,我們不需要創建一個模塊,但可以將.jar放入部署文件中,並且JBOSS將即時部署。我們只需要在驅動程序名稱中引用。對我來說,模塊沒有正確添加,所以很高興找到這種替代解決方案。不確定在這個時候的缺點。

####### Original Problem Below ####### 

尋找一些數據源錯誤的幫助。我將5.1 JBOSS應用程序遷移到6.2 JBOSS應用程序。花了幾天在線學習如何配置JBOSS 6.2我得到了下面的錯誤。我們的團隊需要遷移到JBOSS 6.2。我嘗試了幾種不同的方式來配置XML。我已經試過模塊vs將.jar放在deploy文件夾中。

我的當前設置如下:

ojdbc14.jar的是在部署文件夾

我已經更新,如下standalone.xml:

<datasources> 
    <datasource jndi-name="java:/jdbc/CCASDataSource" 
    pool-name="CCASDataSource" 
    enabled="true" 
    use-java-context="true"> 
    <connection-url>jdbc:oracle:thin:@##########:1521:########</connection-url> 
    <driver>oracle</driver> 
    <pool> 
    <min-pool-size>1</min-pool-size> 
    <max-pool-size>20</max-pool-size> 
    </pool> 
    <security> 
    <user-name>######</user-name> 
    <password>###### </password>  
    </security> 
    </datasource> 
    </datasources> 

錯誤:

15:00:41,684 INFO [org.jboss.modules] (main) JBoss Modules version 1.3.0.Final-redhat-2

15:00:42,089 INFO [org.jboss.msc] (main) JBoss MSC version 1.0.4.GA-redhat-1

15:00:42,151 INFO [org.jboss.as] (MSC service thread 1-6) JBAS015899: JBoss EAP 6.2.0.GA (AS 7.3.0.Final-redhat-14) starting

15:00:43,381 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found ccas.ear in deployment directory. To trigger deployment create a file called ccas.ear.dodeploy

15:00:43,403 INFO [org.xnio] (MSC service thread 1-3) XNIO Version 3.0.7.GA-redhat-1

15:00:43,404 INFO [org.jboss.as.server] (Controller Boot Thread) JBAS015888: Creating http management service using socket-binding (management-http)

15:00:43,410 INFO [org.xnio.nio] (MSC service thread 1-3) XNIO NIO Implementation Version 3.0.7.GA-redhat-1

15:00:43,417 INFO [org.jboss.remoting] (MSC service thread 1-3) JBoss Remoting version 3.2.18.GA-redhat-1

15:00:43,470 INFO [org.jboss.as.security] (ServerService Thread Pool -- 42) JBAS013171: Activating Security Subsystem

15:00:43,475 INFO [org.jboss.as.naming] (ServerService Thread Pool -- 37) JBAS011800: Activating Naming Subsystem

15:00:43,490 INFO [org.jboss.as.webservices] (ServerService Thread Pool -- 46) JBAS015537: Activating WebServices Extension

15:00:43,500 INFO [org.jboss.as.security] (MSC service thread 1-5) JBAS013170: Current PicketBox version=4.0.19.SP2-redhat-1

15:00:43,504 INFO [org.jboss.as.jsf] (ServerService Thread Pool -- 35) JBAS012605: Activated the following JSF Implementations: [main, 1.2]

15:00:43,520 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 29) JBAS010280: Activating Infinispan subsystem.

15:00:43,523 INFO [org.jboss.as.naming] (MSC service thread 1-1) JBAS011802: Starting Naming Service

15:00:43,566 INFO [org.jboss.as.connector.logging] (MSC service thread 1-6) JBAS010408: Starting JCA Subsystem (IronJacamar 1.0.23.Final-redhat-1)

15:00:43,582 INFO [org.jboss.as.mail.extension] (MSC service thread 1-5) JBAS015400: Bound mail session [java:jboss/mail/Default]

15:00:44,281 INFO [org.jboss.ws.common.management] (MSC service thread 1-1) JBWS022052: Starting JBoss Web Services - Stack CXF Server 4.2.3.Final-redhat-1

15:00:44,301 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-3) JBAS015012: Started FileSystemDeploymentService for directory C:\jboss-eap-6.2_CCAS\standalone\deployments

15:00:44,307 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "ccas.ear" (runtime-name: "ccas.ear")

15:00:44,308 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "ojdbc14.jar" (runtime-name: "ojdbc14.jar")

15:00:44,367 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "null" (runtime-name: "ccas.war")

15:00:44,412 INFO [org.jboss.as.remoting] (MSC service thread 1-7) JBAS017100: Listening on 127.0.0.1:9999

15:00:44,416 INFO [org.jboss.as.remoting] (MSC service thread 1-8) JBAS017100: Listening on 127.0.0.1:4447

15:00:44,454 INFO [org.apache.coyote.http11] (MSC service thread 1-6) JBWEB003001: Coyote HTTP/1.1 initializing on : http-dev.mytest.com/127.0.0.1:8080

15:00:44,491 INFO [org.apache.coyote.http11] (MSC service thread 1-6) JBWEB003000: Coyote HTTP/1.1 starting on: http-dev.mytest.com/127.0.0.1:8080

15:00:44,942 INFO [org.infinispan.factories.GlobalComponentRegistry] (ServerService Thread Pool -- 65) ISPN000128: Infinispan version: Infinispan 'Delirium' 5.2.7.Final

15:00:44,986 INFO [org.infinispan.factories.TransactionManagerFactory] (ServerService Thread Pool -- 65) ISPN000161: Using a batchMode transaction manager

15:00:44,987 INFO [org.infinispan.factories.TransactionManagerFactory] (ServerService Thread Pool -- 67) ISPN000161: Using a batchMode transaction manager

15:00:45,168 INFO [org.infinispan.jmx.CacheJmxRegistration] (ServerService Thread Pool -- 65) ISPN000031: MBeans were successfully registered to the platform MBean server.

15:00:45,169 INFO [org.infinispan.jmx.CacheJmxRegistration] (ServerService Thread Pool -- 67) ISPN000031: MBeans were successfully registered to the platform MBean server.

15:00:45,170 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 65) JBAS010281: Started local-web cache from web container

15:00:45,172 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 67) JBAS010281: Started default-host/ccas cache from web container

15:00:45,182 INFO [org.jboss.web] (ServerService Thread Pool -- 67) JBAS018210: Register web context: /ccas

15:00:45,748 INFO [org.jboss.as.server] (ServerService Thread Pool -- 26) JBAS018559: Deployed "ojdbc14.jar" (runtime-name : "ojdbc14.jar")

15:00:45,748 INFO [org.jboss.as.server] (ServerService Thread Pool -- 26) JBAS018559: Deployed "ccas.ear" (runtime-name : "ccas.ear")

15:00:45,749 INFO [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report

JBAS014775: New missing/unsatisfied dependencies:

service jboss.jdbc-driver.oracle (missing) dependents: [service jboss.data-source.java:/jdbc/CCASDataSource, service 

jboss.driver-demander.java:/jdbc/CCASDataSource]

15:00:45,811 INFO [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/management

15:00:45,811 INFO [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990

15:00:45,812 ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: JBoss EAP 6.2.0.GA (AS 7.3.0.Final-redhat-14) started (with errors) in 4518ms - Started 360 of 430 services (3 services failed or missing dependencies, 66 services are passive or on-demand)

+2

僅供參考,ojdbc14.jar是古老的。你不應該使用它。 – OldProgrammer 2015-03-25 02:18:31

+0

我一直在嘗試ojdbc6&14都無濟於事。 – 2015-03-25 20:01:56

+0

如果你發佈你的答案,我可以獎勵你的觀點@OldProgrammer – 2015-03-26 16:11:52

回答

0

您將需要添加oracle jdbc驅動程序例如在部署應用程序之前,將ojdcb6.jar作爲JBoss 模塊加載到JBoss節點中。這也允許您在部署應用程序之前測試您的數據源連接是否正在通過JBoss控制檯(和/或CLI)工作。

創建以下目錄路徑:

${JBOSS_HOME}\modules\com\oracle\ojdbc6\main 

將您在這裏ojdbc6.jar,並創建一個module.xml文件在同一目錄中包含以下內容:在

<?xml version="1.0" ?> 
<module xmlns="urn:jboss:module:1.1" name="com.oracle" slot="main"> 

    <resources> 
     <resource-root path="ojdbc6.jar"/> 
    </resources> 

    <dependencies> 
     <module name="javax.api"/> 
     <module name="javax.transaction.api"/> 
    </dependencies> 
</module> 

然後你JBoss standalone.xml文件 - 在您的部分添加

<drivers> 
    <driver name="oracle" module="com.oracle"> 
     <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class> 
    </driver> 
</drivers> 

最終的解決方案在Redhat站點 - 請參閱https://access.redhat.com/solutions/93693 ...您將需要一個redhat支持帳戶才能訪問該帳戶。

+0

你的命名稍微偏離了,但是這個概念看起來像我看到的每個帖子都是在做這個模塊,但我們不需要創建一個模塊。這是我在上面做的。 – 2015-03-25 23:54:14