2015-03-24 109 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