2014-07-02 398 views
1

我正在嘗試設置Vibur DBCP以針對Oracle 11g數據庫實例工作,但我不斷收到Oracle異常。將Vibur DBCP連接到Oracle數據庫時出現錯誤

這是URL =的jdbc:神諭:薄:@ // db.vonagenetworks.net/MY_SERVICE

,當我與我們的Tomcat的連接池使用此URL工作。

我得到以下錯誤...。

org.vibur.dbcp.ViburDBCPException: java.sql.SQLException: Listener refused the connection with the following error: 
ORA-12516, TNS:listener could not find available handler with matching protocol stack 

    at org.vibur.dbcp.pool.ConnectionFactory.create(ConnectionFactory.java:114) ~[vibur-dbcp-1.1.1.jar:?] 
    at org.vibur.dbcp.pool.ConnectionFactory.create(ConnectionFactory.java:53) ~[vibur-dbcp-1.1.1.jar:?] 
    at org.vibur.objectpool.ConcurrentLinkedPool.create(ConcurrentLinkedPool.java:119) ~[vibur-object-pool-2.0.0.jar:?] 
    at org.vibur.objectpool.ConcurrentLinkedPool.<init>(ConcurrentLinkedPool.java:110) ~[vibur-object-pool-2.0.0.jar:?] 
    at org.vibur.dbcp.pool.PoolOperations.<init>(PoolOperations.java:73) ~[vibur-dbcp-1.1.1.jar:?] 
    at org.vibur.dbcp.ViburDBCPDataSource.start(ViburDBCPDataSource.java:196) ~[vibur-dbcp-1.1.1.jar:?] 
    at contactmanager.dao.DataSourceInitializer.initializeDataSources(DataSourceInitializer.java:96) [DataSourceInitializer.class:?] 
    at contactmanager.dao.DataSourceInitializer.init(DataSourceInitializer.java:49) [DataSourceInitializer.class:?] 
    at javax.servlet.GenericServlet.init(GenericServlet.java:160) [servlet-api.jar:3.0.FR] 
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280) [catalina.jar:7.0.47] 
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193) [catalina.jar:7.0.47] 
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088) [catalina.jar:7.0.47] 
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5176) [catalina.jar:7.0.47] 
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5460) [catalina.jar:7.0.47] 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:7.0.47] 
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) [catalina.jar:7.0.47] 
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) [catalina.jar:7.0.47] 
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633) [catalina.jar:7.0.47] 
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:983) [catalina.jar:7.0.47] 
    at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1660) [catalina.jar:7.0.47] 
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [?:1.7.0_17] 
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [?:1.7.0_17] 
    at java.util.concurrent.FutureTask.run(FutureTask.java:166) [?:1.7.0_17] 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [?:1.7.0_17] 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [?:1.7.0_17] 
    at java.lang.Thread.run(Thread.java:722) [?:1.7.0_17] 
Caused by: java.sql.SQLException: Listener refused the connection with the following error: 
ORA-12516, TNS:listener could not find available handler with matching protocol stack 

    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:458) ~[ojdbc6.jar:11.2.0.3.0] 
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:546) ~[ojdbc6.jar:11.2.0.3.0] 
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:236) ~[ojdbc6.jar:11.2.0.3.0] 
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32) ~[ojdbc6.jar:11.2.0.3.0] 
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521) ~[ojdbc6.jar:11.2.0.3.0] 
    at java.sql.DriverManager.getConnection(DriverManager.java:579) ~[?:1.7.0_17] 
    at java.sql.DriverManager.getConnection(DriverManager.java:221) ~[?:1.7.0_17] 
    at org.vibur.dbcp.pool.ConnectionFactory.doCreate(ConnectionFactory.java:139) ~[vibur-dbcp-1.1.1.jar:?] 
    at org.vibur.dbcp.pool.ConnectionFactory.create(ConnectionFactory.java:110) ~[vibur-dbcp-1.1.1.jar:?] 
    ... 25 more 
Caused by: oracle.net.ns.NetException: Listener refused the connection with the following error: 
ORA-12516, TNS:listener could not find available handler with matching protocol stack 

    at oracle.net.ns.NSProtocol.connect(NSProtocol.java:395) ~[ojdbc6.jar:11.2.0.3.0] 
    at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1102) ~[ojdbc6.jar:11.2.0.3.0] 
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:320) ~[ojdbc6.jar:11.2.0.3.0] 
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:546) ~[ojdbc6.jar:11.2.0.3.0] 
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:236) ~[ojdbc6.jar:11.2.0.3.0] 
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32) ~[ojdbc6.jar:11.2.0.3.0] 
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521) ~[ojdbc6.jar:11.2.0.3.0] 
    at java.sql.DriverManager.getConnection(DriverManager.java:579) ~[?:1.7.0_17] 
    at java.sql.DriverManager.getConnection(DriverManager.java:221) ~[?:1.7.0_17] 
    at org.vibur.dbcp.pool.ConnectionFactory.doCreate(ConnectionFactory.java:139) ~[vibur-dbcp-1.1.1.jar:?] 
    at org.vibur.dbcp.pool.ConnectionFactory.create(ConnectionFactory.java:110) ~[vibur-dbcp-1.1.1.jar:?] 
    ... 25 more 

回答

3

這似乎在Oracle數據庫服務器已用盡可用進程,爲此沒有更多的新連接到服務器進行是一個常見的問題。請檢查thisthis鏈接瞭解更多詳情。

第二個鏈接表明可以通過以下方式增加Oracle數據庫中的進程數:alter system set processes = 100 scope = spfile;

我認爲最好將Oracle中的進程數設置爲比您爲vibur-dbcp配置的最大連接數稍高的數,即如果您已配置poolMaxSize = 100,然後將Oracle中的進程數設置爲150.如果多個應用程序連接到同一個Oracle數據庫服務器,則可能需要將poolMaxSize乘以連接應用程序的數量,然後添加一些備用額外的50或100到它。

請讓我知道這是否有幫助。

相關問題