首页 > 代码库 > weblogic 解决线程阻塞
weblogic 解决线程阻塞
最近,发现应用在weblogic服务器运行一段时间后,会报超时错误,查看weblogic后台日志:
<Error> <WebLogicServer> <BEA-000337> <[STUCK] ExecuteThread: ‘7‘ for queue:
‘weblogic.kernel.Default (self-tuning)‘ has been busy for "629" seconds working on the request "Workmanager: default, Version:
0, Scheduled=true, Started=true, Started time: 629789 ms
[
POST /JLCSB/xfireservices/CustomerServiceA?p=-1 HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: ""
Content-Length: 447
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
]", which is more than the configured time (StuckThreadMaxTime) of "600" seconds. Stack trace:
org.apache.commons.pool.impl.GenericObjectPool.getNumIdle(GenericObjectPool.java:911)
org.apache.commons.dbcp.AbandonedObjectPool.borrowObject(AbandonedObjectPool.java:78)
org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:96)
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:113)
org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:79)
org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:923)
org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:964)
com.linkage.crm.csb.util.ContractBean._generateTransactionID(ContractBean.java:144)
com.linkage.crm.csb.util.ContractBean.generateTransactionID(ContractBean.java:120)
com.linkage.crm.csb.exchange.DefaultExchange.exchange(DefaultExchange.java:309)
com.linkage.crm.csb.util.DataExchangeHelper.xfireExchange(DataExchangeHelper.java:144)
crmwsi.crm.CustomerServiceASoapBindingImpl.queryChannels(CustomerServiceASoapBindingImpl.java:368)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.codehaus.xfire.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:59)
org.codehaus.xfire.service.binding.ServiceInvocationHandler.sendMessage(ServiceInvocationHandler.java:320)
org.codehaus.xfire.service.binding.ServiceInvocationHandler$1.run(ServiceInvocationHandler.java:86)
org.codehaus.xfire.service.binding.ServiceInvocationHandler.execute(ServiceInvocationHandler.java:134)
org.codehaus.xfire.service.binding.ServiceInvocationHandler.invoke(ServiceInvocationHandler.java:109)
org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
org.codehaus.xfire.transport.DefaultEndpoint.onReceive(DefaultEndpoint.java:64)
org.codehaus.xfire.transport.AbstractChannel.receive(AbstractChannel.java:38)
org.codehaus.xfire.transport.http.XFireServletController.invoke(XFireServletController.java:304)
org.codehaus.xfire.transport.http.XFireServletController.doService(XFireServletController.java:129)
org.codehaus.xfire.transport.http.XFireServlet.doPost(XFireServlet.java:116)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:184)
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3732)
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696)
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
首先分析产生此错误是由于 WebLogic Server 超过了其“阻塞线程最长时间:”的默认值:600 秒。
考虑将 WebLogic Server 的“阻塞线程最长时间”的值从默认的 600 秒更改为更大的值,例如 1200 秒。
设置方法如下:
但更改后问题依旧存在,考虑是由于没有使用数据源导致
新建数据源,并在应用中使用后,问题解决,已连续运行数天
weblogic 解决线程阻塞