IJ000604:尝试获取新连接时可抛出:null:javax.resource.ResourceException:无法创建连接

时间:2015-10-05 05:44:44

标签: oracle11g database-connection jboss7.x datasource

我的Test Connection上的 数据库 JBoss Application Console出现以下错误。

> 13:04:26,089 WARN  [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (HttpManagementService-threads - 4) IJ000604: Throwable while attempting to get a new connection: null: javax.resource.ResourceException: Could not create connection
    at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:324) [ironjacamar-jdbc-1.0.26.Final-redhat-1.jar:1.0.26.Final-redhat-1]
    at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:281) [ironjacamar-jdbc-1.0.26.Final-redhat-1.jar:1.0.26.Final-redhat-1]
    at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.createConnectionEventListener(SemaphoreArrayListManagedConnectionPool.java:842) [ironjacamar-core-impl-1.0.26.Final-redhat-1.jar:1.0.26.Final-redhat-1]
    at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.getConnection(SemaphoreArrayListManagedConnectionPool.java:386) [ironjacamar-core-impl-1.0.26.Final-redhat-1.jar:1.0.26.Final-redhat-1]
    at org.jboss.jca.core.connectionmanager.pool.AbstractPool.internalTestConnection(AbstractPool.java:686) [ironjacamar-core-impl-1.0.26.Final-redhat-1.jar:1.0.26.Final-redhat-1]
    at org.jboss.jca.core.connectionmanager.pool.strategy.OnePool.testConnection(OnePool.java:89) [ironjacamar-core-impl-1.0.26.Final-redhat-1.jar:1.0.26.Final-redhat-1]
    at org.jboss.as.connector.subsystems.common.pool.PoolOperations$TestConnectionInPool.invokeCommandOn(PoolOperations.java:143) [jboss-as-connector-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
    at org.jboss.as.connector.subsystems.common.pool.PoolOperations$1.execute(PoolOperations.java:82) [jboss-as-connector-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
    at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:611) [jboss-as-controller-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
    at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:489) [jboss-as-controller-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
    at org.jboss.as.controller.AbstractOperationContext.completeStepInternal(AbstractOperationContext.java:290) [jboss-as-controller-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
    at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:285) [jboss-as-controller-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
    at org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1132) [jboss-as-controller-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
    at org.jboss.as.controller.ModelControllerImpl.internalExecute(ModelControllerImpl.java:251) [jboss-as-controller-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
    at org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:152) [jboss-as-controller-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
    at org.jboss.as.controller.ModelControllerImpl$3.execute(ModelControllerImpl.java:474) [jboss-as-controller-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
    at org.jboss.as.controller.ModelControllerImpl$3.execute(ModelControllerImpl.java:464) [jboss-as-controller-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
    at org.jboss.as.domain.http.server.DomainApiHandler.processRequest(DomainApiHandler.java:263)
    at org.jboss.as.domain.http.server.DomainApiHandler.doHandle(DomainApiHandler.java:167)
    at org.jboss.as.domain.http.server.DomainApiHandler.handle(DomainApiHandler.java:174)
    at org.jboss.as.domain.http.server.security.SubjectAssociationHandler$1.run(SubjectAssociationHandler.java:69)
    at org.jboss.as.domain.http.server.security.SubjectAssociationHandler$1.run(SubjectAssociationHandler.java:65)
    at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.7.0_80]
    at javax.security.auth.Subject.doAs(Subject.java:415) [rt.jar:1.7.0_80]
    at org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:94) [jboss-as-controller-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
    at org.jboss.as.domain.http.server.security.SubjectAssociationHandler.handleRequest(SubjectAssociationHandler.java:65)
    at org.jboss.as.domain.http.server.security.SubjectAssociationHandler.handle(SubjectAssociationHandler.java:59)
    at org.jboss.as.domain.http.server.DomainApiCheckHandler.handle(DomainApiCheckHandler.java:45)
    at org.jboss.com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:78)
    at org.jboss.sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:69)
    at org.jboss.com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:81)
    at org.jboss.sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:710)
    at org.jboss.com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:78)
    at org.jboss.as.domain.http.server.RealmReadinessFilter.doFilter(RealmReadinessFilter.java:47)
    at org.jboss.as.domain.http.server.DmrFailureReadinessFilter.doFilter(DmrFailureReadinessFilter.java:45)
    at org.jboss.com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:81)
    at org.jboss.sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:682)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_80]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_80]
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_80]
    at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.1.Final-redhat-1.jar:2.1.1.Final-redhat-1]
Caused by: java.sql.SQLRecoverableException: IO Error: Connection reset
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:428)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:536)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:228)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)
    at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:296) [ironjacamar-jdbc-1.0.26.Final-redhat-1.jar:1.0.26.Final-redhat-1]
    ... 40 more
Caused by: java.net.SocketException: Connection reset
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:118) [rt.jar:1.7.0_80]
    at java.net.SocketOutputStream.write(SocketOutputStream.java:159) [rt.jar:1.7.0_80]
    at oracle.net.ns.Packet.send(Packet.java:386)
    at oracle.net.ns.ConnectPacket.send(ConnectPacket.java:182)
    at oracle.net.ns.NSProtocol.connect(NSProtocol.java:284)
    at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1054)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:308)
    ... 45 more

这是standalone.xml配置......

 <subsystem xmlns="urn:jboss:domain:datasources:1.2">
        <datasources>
            <datasource jndi-name="java:/jdbc/pcbDB" pool-name="pcbdb" enabled="true">
                <connection-url>jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=off)(ADDRESS=(PROTOCOL=TCP)(HOST=dev-scan.dev.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=CBSMSBLDEV)(SERVER=DEDICATED)))</connection-url>
                <driver>com.oracle</driver>
                <pool>
                    <min-pool-size>11</min-pool-size>
                    <max-pool-size>20</max-pool-size>
                    <use-strict-min>false</use-strict-min>
                    <flush-strategy>FailingConnectionOnly</flush-strategy>
                </pool>
                <security>
                    <user-name>cbsmsbldev</user-name>
                    <password>TechM1234</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>
            <datasource jndi-name="java:/jdbc/pcbScheduler" pool-name="pcbscheduler" enabled="true">
                <connection-url>jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=off)(ADDRESS=(PROTOCOL=TCP)(HOST=dev-scan.dev.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=CBSMSBLDEV)(SERVER=DEDICATED)))</connection-url>
                <driver>com.oracle</driver>
                <pool>
                    <min-pool-size>11</min-pool-size>
                    <max-pool-size>20</max-pool-size>
                </pool>
                <security>
                    <user-name>cbsmsbldev</user-name>
                    <password>TechM1234</password>
                </security>
                <timeout>
                    <blocking-timeout-millis>5000</blocking-timeout-millis>
                    <idle-timeout-minutes>5</idle-timeout-minutes>
                </timeout>
            </datasource>
            <drivers>
                <driver name="com.oracle" module="com.oracle">
                    <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
                </driver>
            </drivers>
        </datasources>
 </subsystem>

请告知此问题的原因。

我在其他环境中获得了相同的配置。我不知道为什么我现在遇到这个问题。主机, - dev-scan.dev.com和端口1521可供JBoss Application Server系统访问。

2 个答案:

答案 0 :(得分:0)

我观察了telnet到1521端口................

防火墙或其他一些配置。使连接立即关闭,

我希望这应该成为问题的原因.....

$telnet dev-scan.dev.com 1521
Trying 10.252.103.108...
Connected to cmdbdev-scan.dev.com.
Escape character is '^]'.
Connection closed by foreign host.

问题是在socket-connection-close

之后立即发生Escape character is '^]'.
  

连接被外国主机关闭。

答案 1 :(得分:0)

我也遇到了同样的问题,我发现我的连接网址是故障的,因为它无法连接到数据库。检查连接URL,用户名和密码。