oracle JBoss JDBC 警告 - “无法填充池”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2579999/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
JBoss JDBC warning - "Unable to fill pool"
提问by Marcus Leon
We're getting this random warning from JBoss.. any idea why?
我们从 JBoss 那里收到了这个随机警告.. 知道为什么吗?
It happens at random times when there are no active threads. Everything works when any processing resumes.
当没有活动线程时,它会随机发生。当任何处理恢复时,一切正常。
13:49:31,764 WARN [JBossManagedConnectionPool] [ ] Unable to fill pool
org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Listener ref
used the connection with the following error:
ORA-12516, TNS:listener could not find available handler with matching protocol stack
The Connection descriptor used by the client was:
//localhost:1521/orcl
)
at org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory.createManagedConnection(XAManagedConnectionFactory.java
:144)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConne
ctionPool.java:577)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.fillToMin(InternalManagedConnectionPool.java:524)
at org.jboss.resource.connectionmanager.PoolFiller.run(PoolFiller.java:74)
at java.lang.Thread.run(Thread.java:619)
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
The Connection descriptor used by the client was:
//localhost:1521/orcl
Update: As per richj's post, here is the format of one of the four data sources we are using:
更新:根据richj 的帖子,这里是我们使用的四个数据源之一的格式:
<xa-datasource>
<jndi-name>ABCOracleDS</jndi-name>
<track-connection-by-tx/>
<isSameRM-override-value>false</isSameRM-override-value>
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
<xa-datasource-property name="URL">jdbc:oracle:thin:@//localhost:1521/orcl</xa-datasource-property>
<xa-datasource-property name="User">myuser</xa-datasource-property>
<xa-datasource-property name="Password">mypw</xa-datasource-property>
<min-pool-size>20</min-pool-size>
<max-pool-size>200</max-pool-size>
<valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker
</valid-connection-checker-class-name>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter
</exception-sorter-class-name>
<no-tx-separate-pools/>
<metadata>
<type-mapping>Oracle10g</type-mapping>
</metadata>
</xa-datasource>
回答by richj
The Connection descriptor used by the client was:
//localhost:1521/orcl
I think the problem is likely to be somewhere in the datasource definitions. Do you have more than one datasource definition in your JBoss hot deploy directory? Are your datasource definitions correct and complete - particularly the properties used to build the connection URL?
我认为问题很可能出在数据源定义的某个地方。您的 JBoss 热部署目录中是否有多个数据源定义?您的数据源定义是否正确且完整——尤其是用于构建连接 URL 的属性?
Update 1
更新 1
I'm not sure about the slashes, I think maybe the URL:
我不确定斜线,我想也许是 URL:
jdbc:oracle:thin:@//localhost:1521/orcl
should look like this:
应该是这样的:
jdbc:oracle:thin:@localhost:1521:orcl
Update 2
更新 2
Here is a reference from Oraclethat supports the syntax with slashes.
Here is a reference from Orafaqthat supports the syntax with colons.
这是Oracle的参考,它支持带斜杠的语法。
这是来自Orafaq的参考,它支持带冒号的语法。
Perhaps it's worth a try even if the slashes are legal?
即使斜线是合法的,也许也值得一试?
Update 3
更新 3
Just a few more ideas from the "getting desperate" box of tricks:
从“变得绝望”的技巧盒中再提一些想法:
ORA-12516: TNS:listener could not find available handler with matching protocol stack
This message looks like a TNS configuration issue. The JDBC thin driver shouldn't need a TNS configuration, but I've found that sometimes it just refuses to work without one.
此消息看起来像是 TNS 配置问题。JDBC 瘦驱动程序不需要 TNS 配置,但我发现有时它只是拒绝在没有配置的情况下工作。
You could also try the fully qualified host name instead of localhost. Sometimes machine.company.comworks when machineon its own doesn't.
您也可以尝试使用完全限定的主机名而不是localhost。有时machine.company.com可以工作,而机器本身却无法工作。