jboss eap 6.2连接池oracle

时间:2015-01-12 20:15:12

标签: oracle jboss connection-pooling jboss-eap-6

我的jboss eap 6.2的连接池无法正常工作。我已经在standalone.xml中设置了我的池,并且它已正确部署。

[org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) JBAS010400: Bound data source [java:/Oracle_LPBridge_DS]

standalone.xml配置

<datasources>
    <datasource jndi-name="java:/Oracle_LPBridge_DS" pool-name="Oracle_LPBridge_DS" enabled="true" use-java-context="true">
        <connection-url>jdbc:oracle:thin:@aa.bbb.cc.com:1522:ddd111spc1</connection-url>
        <driver>oracle</driver>
        <security>
            <user-name>cccccccc</user-name>
            <password>cccccccc</password>
        </security>
        <validation>
            <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker"></valid-connection-checker>
            <stale-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker"></stale-connection-checker>
            <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter"></exception-sorter>
        </validation>
    </datasource>
    <drivers>
        <driver name="oracle" module="com.oracle.jdbc">
            <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
            <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
        </driver>
    </drivers>
</datasources>

正在部署连接池。 在我的spring applicationContex.xml中,我在下面使用但它总是给出java:/ Oracle_LPBridge_DS未找到错误。

<bean id="dataSourcelpbridge" class="org.springframework.jndi.JndiObjectFactoryBean">
  <property name="jndiName" value="java:/Oracle_LPBridge_DS" />
</bean>

=============================================== ==============================

15:18:08,025 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/bridge]] (ServerService Thread Pool -- 160) JBWEB000287: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourcelpb-ridge': Invocation of init method failed; nested exception is javax.naming.NameNotFoundException; remaining name 'java:/Oracle_LPBridge_DS'
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1488) [spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:524) [spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461) [spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) [spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) [spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) [spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) [spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:608) [spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) [spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) [spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389) [spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294) [spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) [spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3777) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
    at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:156) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
    at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_55]
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_55]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_55]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_55]
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_55]
    at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: javax.naming.NameNotFoundException; remaining name 'java:/Oracle_LPBridge_DS'
    at org.eclipse.jetty.jndi.local.localContextRoot.lookup(localContextRoot.java:490) [jetty-jndi-8.1.14.v20131031.jar:8.1.14.v20131031]
    at org.eclipse.jetty.jndi.local.localContextRoot.lookup(localContextRoot.java:536) [jetty-jndi-8.1.14.v20131031.jar:8.1.14.v20131031]
    at javax.naming.InitialContext.lookup(InitialContext.java:411) [rt.jar:1.7.0_55]
    at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:154) [spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:87) [spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152) [spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178) [spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95) [spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105) [spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:201) [spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:187) [spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1547) [spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1485) [spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    ... 23 more

15:18:08,047 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/bridge]] (ServerService Thread Pool -- 160) Set web app root system property: 'webapp.root' = [C:\Users\502312813\Documents\LP Bridge\Installables\jboss-eap-6.2.0.1\jboss-eap-6.2\standalone\deployments\bridge.war\]
15:18:08,048 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/bridge]] (ServerService Thread Pool -- 160) Set web app root system property: 'webapp.root' = [C:\Users\502312813\Documents\LP Bridge\Installables\jboss-eap-6.2.0.1\jboss-eap-6.2\standalone\deployments\bridge.war\]
15:18:08,049 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/bridge]] (ServerService Thread Pool -- 160) Initializing log4j from [classpath:log4j.properties]
15:18:08,064 ERROR [org.apache.catalina.core] (ServerService Thread Pool -- 160) JBWEB001103: Error detected during context /bridge start, will stop it
15:18:08,076 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/bridge]] (ServerService Thread Pool -- 160) Shutting down log4j
15:18:08,076 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/bridge]] (ServerService Thread Pool -- 160) Closing Spring root WebApplicationContext
15:18:08,083 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 160) MSC000001: Failed to start service jboss.web.deployment.default-host./bridge: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./bridge: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context
    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_55]
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_55]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_55]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_55]
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_55]
    at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context
    at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:161)
    at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60)
    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93)
    ... 6 more

请说明我做错了什么。 我还尝试了jboss-web.xml,web.xml,然后在applicationContext.xml中添加了它。这也没有用。

谢谢你的帮助。

1 个答案:

答案 0 :(得分:0)

请求Link to jboss developer network

他们的小费修好了。 我正在使用jetty-jndi.jar创建问题。我必须将它从pom.xml中删除,之后它就被修复了。

需要更改standalone.xml以将其中的数据源名称更改为

java:jboss / datasources / Oracle_LPBridge_DS

applicationContext.xml更改为     

之后就开始工作了。