java WebSphere IBM MQ连接泄漏导致线程阻塞

r3i60tvu  于 2023-03-28  发布在  Java
关注(0)|答案(1)|浏览(219)

在Websphere Connection泄漏跟踪日志中获取MQ连接堆栈跟踪。不确定为什么Websphere未在配置的超时内释放连接。已占用
我们在WAS JMS池设置中将MQ JMS池连接超时配置为5秒。
无法理解为什么仍在使用连接。当我们读取JMS消息时,我们正在使用finally代码块关闭连接。没有其他应用程序错误日志。
使用WAS跟踪字符串作为--〉=info:JMSApi=all:JMSServer=all:消息=全部:JMS_WASTraceAdapter=all:com.ibm.mq.=所有:jmsApi=all:ConnLeakLogic=all:j2c.*=all

Connection marked to be destroyed.  Waiting for transaction end and connection close - MCWrapper id 53b353b3  Managed connection com.ibm.ejs.jms.JMSManagedQueueConnection@29422942
        managed connection factory = com.ibm.ejs.jms.WMQJMSRAManagedConnectionFactory@70a470a4
        physical connection = com.ibm.mq.jms.MQXAQueueConnection@44504450
        connectorName = JMS$MIUFACTORY$JMSManagedConnection@11
        credential = null
        open connection handles = [com.ibm.ejs.jms.JMSQueueConnectionHandle@655a655a]  State:STATE_ACTIVE_INUSE Thread Id: 0000005f Thread Name: WebContainer : 5 Handle count 1 Start time inuse Wed Jan 18 16:00:18 GMT 2023 Time inuse 1479 (seconds)
    Connection marked to be destroyed.  Waiting for transaction end and connection close - MCWrapper id 270b270b  Managed connection com.ibm.ejs.jms.JMSManagedQueueConnection@1c921c92
        managed connection factory = com.ibm.ejs.jms.WMQJMSRAManagedConnectionFactory@70a470a4
        physical connection = com.ibm.mq.jms.MQXAQueueConnection@3c933c93
        connectorName = JMS$MIUFACTORY$JMSManagedConnection@7
        credential = null
        open connection handles = [com.ibm.ejs.jms.JMSQueueConnectionHandle@1c2f1c2f]  State:STATE_ACTIVE_INUSE Thread Id: 00000035 Thread Name: WebContainer : 2 Handle count 1 Start time inuse Wed Jan 18 15:24:28 GMT 2023 Time inuse 3629 (seconds)
  Total number of connection in unshared pool: 2 Connection Leak Logic Information:
  MCWrapper id 53b353b3  Managed connection com.ibm.ejs.jms.JMSManagedQueueConnection@29422942
        managed connection factory = com.ibm.ejs.jms.WMQJMSRAManagedConnectionFactory@70a470a4
        physical connection = com.ibm.mq.jms.MQXAQueueConnection@44504450
        connectorName = JMS$MIUFACTORY$JMSManagedConnection@11
        credential = null
        open connection handles = [com.ibm.ejs.jms.JMSQueueConnectionHandle@655a655a]  State:STATE_ACTIVE_INUSE Thread Id: 0000005f Thread Name: WebContainer : 5 Handle count 1
     Start time inuse Wed Jan 18 16:00:18 GMT 2023 Time inuse 1479 (seconds)
     Last allocation time Wed Jan 18 16:00:18 GMT 2023
       getConnection stack trace information:
          com.ibm.ejs.j2c.ConnectionManager.allocateConnection(ConnectionManager.java:900)
          com.ibm.ejs.jms.JMSQueueConnectionFactoryHandle.createQueueConnection(JMSQueueConnectionFactoryHandle.java:84)

WebSphere版本详细信息:版本7.0.0.45MQ版本:实施-标题:WebSphere MQ资源适配器实现-版本:7.0.1.14
编辑:经过分析,这个连接泄漏是由于在一个服务执行期间加载失败的类。
即使我们的库存在于EAR中,它仍然在加载ClassNotFoundException时出错,因为加载的类存在于一个jar中。
::java.lang.ClassNotFoundException::

java.net.URLClassLoader.findClass(URLClassLoader.java:457): 
at com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java:201):  
at java.lang.ClassLoader.loadClass(ClassLoader.java:676):   
at com.ibm.ws.bootstrap.ExtClassLoader.loadClass(ExtClassLoader.java:112):  
at java.lang.ClassLoader.loadClass(ClassLoader.java:642):   
at com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:62):   
at com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:58):   
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:545):  
at java.lang.ClassLoader.loadClass(ClassLoader.java:642):   
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:513):  
at java.lang.ClassLoader.loadClass(ClassLoader.java:642):   
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:545):  
at java.lang.ClassLoader.loadClass(ClassLoader.java:642):   
at
u7up0aaq

u7up0aaq1#

这些连接泄漏是由于长时间运行的WebSphere长时间运行的事务导致线程处于活动状态,而不是关闭连接句柄。

相关问题