意外无法获得 java:jboss 的托管连接

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20569957/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 02:51:53  来源:igfitidea点击:

unexpected Unable to get managed connection for java:jboss

javajboss

提问by T-student

I have a web application, which runs on JBoss web EAP 6.1.

我有一个 Web 应用程序,它在 JBoss Web EAP 6.1 上运行。

It works fine, but sometimes at a certain point it logs this:

它工作正常,但有时在某个时候它会记录以下内容:

to be more precise when i ask a lot of times the connection it show me this error:

更准确地说,当我多次询问连接时,它会向我显示此错误:

 Caused by: javax.resource.ResourceException:Unable to get managed connection for java:jboss 

Can you tell me what I should do about this?

你能告诉我我应该怎么做吗?

Hereyou can find the full stacktrace of the error.

在这里您可以找到错误的完整堆栈跟踪。

the connection is well configured. the probelm happen after 3 minutes of continuous query

连接配置良好。连续查询3分钟后出现问题

采纳答案by T-student

most of the time it is because i must close the connection with the db sometime some connection are left open and jboss get crazy.

大多数时候是因为我必须关闭与数据库的连接,有时某些连接保持打开状态并且 jboss 变得疯狂。

回答by Sabuj Hassan

From your log trace, it says: Unable to get managed connection for java:jboss/EmirDS

从您的日志跟踪中,它说:无法获得 java:jboss/EmirDS 的托管连接

I suspect you didn't configure EmirDS as datasource at your JBoss. Here is how you can check using Jboss CLI, whether you have created it successfully!

我怀疑您没有在 JBoss 中将 EmirDS 配置为数据源。以下是如何使用 Jboss CLI 检查您是否已成功创建它!

  1. From commandprompt, enter into JBOSS_HOME\bin
  2. Type connect YOUR_IP:YOUR_PORT (example 192.169.1.10:9999)
  3. Type this to see whether your datasource is available or not:

    /subsystem=datasources/data-source=EmirDS:test-connection-in-pool

  1. 从命令提示符进入 JBOSS_HOME\bin
  2. 输入connect YOUR_IP:YOUR_PORT(例如192.169.1.10:9999)
  3. 键入此内容以查看您的数据源是否可用:

    /subsystem=datasources/data-source=EmirDS:test-connection-in-pool

You should see a msg like below if you are having a configured datasource named EmirDS

如果您有一个名为 EmirDS 的配置数据源,您应该会看到如下所示的消息

connection-in-pool
{
    "outcome" => "success",
    "result" => [true]
}

回答by Srinivasan Chinnaraj

How to try this from command prompt

如何从命令提示符尝试此操作

Type connect YOUR_IP:YOUR_PORT (example 192.169.1.10:9999) Type this to see whether your datasource is available or not:

输入 connect YOUR_IP:YOUR_PORT (example 192.169.1.10:9999) 输入以下内容以查看您的数据源是否可用:

/subsystem=datasources/data-source=EmirDS:test-connection-in-pool

/subsystem=datasources/data-source=EmirDS:test-connection-in-pool