采用jca分析javacore文件示例

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/iteye_12404/article/details/82341861

今天帮助项目组分析websphere 7下的线程挂起问题,现象如下:

 

后台日志抛出类似下面的异常:

线程“WebContainer : 6”(0000001f)已保持活动状态 621077 毫秒,此线程可能已挂起。在服务器中共有 1 个线程可能处于挂起状态。

 

问题分析:

线程或数据库存在锁的现象,决定采用jca分析工具分析javacore文件,看哪个线程有锁。

 

问题排查过程:

websphere服务器端(suse Linux)执行如下命令:

ps -ef|grep java

 

查找webpshere的进程,再调用:

kill -3 pid

 

动态生成一个javacore 文件,比如: /opt/IBM/WebSphere/AppServer1/profiles/AppSrv01目录下的生成了javacore.20120613.084258.15830.0001.txt文件

(此kill命令不会造成在线业务系统停止,应用服务器不需要重新启动)

 

然后采用jca分析工具,我采用的是jca401的版本,进入dos环境,执行:

 java -Xmx200m -jar jca401.jar

 

会打开图形界面,调入javacore文件,进行分析发现有线程处于blocked状态,点击toolbar中的“Thread Detail”图标,能够看到具体的线程状态及明细,定位blocked的线程,查看明细,本例中发现该线程blocked by一个web container线程,该线程的调用堆栈如下: 

 

t oracle/jdbc/driver/OracleStatement.executeQuery(OracleStatement.java:1313(Compiled Code))
at com/ibm/ws/rsadapter/jdbc/WSJdbcStatement.pmiExecuteQuery(WSJdbcStatement.java:1621(Compiled Code))
at com/ibm/ws/rsadapter/jdbc/WSJdbcStatement.executeQuery(WSJdbcStatement.java:925(Compiled Code))
at com/itown/framework/persistence/SingleDBHelper.executeQuery(SingleDBHelper.java:116(Compiled Code))
at com/itown/iesap/dbatch/service/InspFirstTrialSqlSearchService.findExcept(InspFirstTrialSqlSearchService.java:457(Compiled Code))
at com/itown/iesap/dbatch/service/InspFirstTrialSqlSearchService.execute(InspFirstTrialSqlSearchService.java:526(Compiled Code))
at com/itown/iesap/common/BaseService.service(BaseService.java:12(Compiled Code))

 

jca工具截图: 




 
 

 

缩小了问题范围,最终得以排查问题。

 

 

展开阅读全文

请教javacore文件分析.

01-16

我的websphere这段时间会出现进程莫名消失的问题,OS是redhat的.rn用jca工具分析了下,觉得主要问题如下,但不太能看的懂,请各位指教应该如何处理:rnrn1XMCURTHDINFO Current Thread DetailsrnNULL ----------------------rn3XMTHREADINFO "WebContainer : 16" (TID:102863A0, sys_thread_t:9FE6690, state:R, native ID:AF1CDBB0) prio=5rn4XESTACKTRACE at java.lang.Throwable.fillInStackTrace(Native Method)rn4XESTACKTRACE at java.lang.Throwable.(Throwable.java(Compiled Code))rn4XESTACKTRACE at java.lang.Exception.(Exception.java(Compiled Code))rn4XESTACKTRACE at java.io.IOException.(IOException.java(Compiled Code))rn4XESTACKTRACE at sun.nio.ch.FileDispatcher.writev0(Native Method)rn4XESTACKTRACE at sun.nio.ch.SocketDispatcher.writev(SocketDispatcher.java(Compiled Code))rn4XESTACKTRACE at sun.nio.ch.IOUtil.write(IOUtil.java(Compiled Code))rn4XESTACKTRACE at sun.nio.ch.SocketChannelImpl.write0(SocketChannelImpl.java(Compiled Code))rn4XESTACKTRACE at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java(Compiled Code))rn4XESTACKTRACE at java.nio.channels.SocketChannel.write(SocketChannel.java(Compiled Code))rn4XESTACKTRACE at com.ibm.ws.tcp.channel.impl.SocketIOChannel.write(SocketIOChannel.java(Compiled Code))rn4XESTACKTRACE at com.ibm.ws.tcp.channel.impl.SocketIOChannel.attemptWriteToSocket(SocketIOChannel.java(Compiled Code))rn4XESTACKTRACE at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java(Compiled Code))rn4XESTACKTRACE at com.ibm.ws.tcp.channel.impl.WorkQueueManager.processWork(WorkQueueManager.java(Compiled Code))rn4XESTACKTRACE at com.ibm.ws.tcp.channel.impl.TCPWriteRequestContextImpl.write(TCPWriteRequestContextImpl.java(Compiled Code))rn4XESTACKTRACE at com.ibm.ws.tcp.channel.impl.TCPWriteRequestContextImpl.write(TCPWriteRequestContextImpl.java(Compiled Code))rn4XESTACKTRACE at com.ibm.ws.http.channel.impl.HttpServiceContextImpl.asynchWrite(HttpServiceContextImpl.java(Compiled Code))rn4XESTACKTRACE at com.ibm.ws.http.channel.impl.HttpServiceContextImpl.sendOutgoing(HttpServiceContextImpl.java(Compiled Code))rn4XESTACKTRACE at com.ibm.ws.http.channel.inbound.impl.HttpInboundServiceContextImpl.sendResponseBody(HttpInboundServiceContextImpl.java(Compiled Code))rn4XESTACKTRACE at com.ibm.ws.webcontainer.channel.WCChannelLink.writeBufferAsynch(WCChannelLink.java(Compiled Code))rn4XESTACKTRACE at com.ibm.ws.webcontainer.channel.WCChannelLink.complete(WCChannelLink.java(Compiled Code))rn4XESTACKTRACE at com.ibm.ws.webcontainer.channel.WCChannelLink.writeBuffer(WCChannelLink.java(Compiled Code))rn4XESTACKTRACE at com.ibm.ws.webcontainer.channel.WCCByteBufferOutputStream.flushWriteBuffer(WCCByteBufferOutputStream.java(Compiled Code))rn4XESTACKTRACE at com.ibm.ws.webcontainer.channel.WCCResponseImpl.flushBufferedContent(WCCResponseImpl.java(Compiled Code))rn4XESTACKTRACE at com.ibm.ws.webcontainer.channel.WCChannelLink.error(WCChannelLink.java(Compiled Code))rn4XESTACKTRACE at com.ibm.ws.http.channel.inbound.impl.HttpISCWriteCallback.error(HttpISCWriteCallback.java:182)rn4XESTACKTRACE at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java(Compiled Code))rn4XESTACKTRACE at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java(Compiled Code))rn4XESTACKTRACE at com.ibm.ws.tcp.channel.impl.WorkQueueManager.processWork(WorkQueueManager.java(Compiled Code))rn4XESTACKTRACE at com.ibm.ws.tcp.channel.impl.TCPWriteRequestContextImpl.write(TCPWriteRequestContextImpl.java(Compiled Code))rn......rn......rn4XESTACKTRACE at com.ibm.ws.webcontainer.channel.WCChannelLink.writeBufferAsynch(WCChannelLink.java(Compiled Code))rn4XESTACKTRACE at com.ibm.ws.webcontainer.channel.WCChannelLink.complete(WCChannelLink.java(Compiled Code))rn4XESTACKTRACE at com.ibm.ws.webcontainer.channel.WCChannelLink.writeBuffer(WCChannelLink.java(Compiled Code))rn4XESTACKTRACE at com.ibm.ws.webcontainer.channel.WCCByteBufferOutputStream.flushWriteBuffer(WCCByteBufferOutputStream.java(Compiled Code))rn4XESTACKTRACE at com.ibm.ws.webcontainer.channel.WCCResponseImpl.flushBufferedContent(WCCResponseImpl.java(Compiled Code))rn4XESTACKTRACE at com.ibm.ws.webcontainer.channel.WCChannelLink.error(WCChannelLink.java(Compiled Code))rn4XEMORENOTSHOWN ... (more frames not shown)rnNULL rn3HPREGISTERS Register ValuesrnNULL ---------------rn3HPREGVALUES EAX : B306C468, EBX : AF1973C8, ECX : 09FE64B8rn3HPREGVALUES EDX : 1A2169F8, ESI : B3901EA6, EDI : B7FBD4D7rn3HPREGVALUES EBP : AF197014, ESP : AF196FF8, EIP : B306C46Ern3HPREGVALUES EFLAGS : 00010292rnNULL rn3HPNATIVESTACK Native Stack of "WebContainer : 16" PID 5872rnNULL -------------------------rn3HPSTACKLINE ?? at B306C46E in libjitc.sorn3HPSTACKLINE xeFillStackTrace at B7F5606B in libjvm.sorn3HPSTACKLINE JVM_FillInStackTrace at B7EA3BFB in libjvm.sorn3HPSTACKLINE Java_java_lang_Throwable_fillInStackTrace at B3919B07 in libcore.sorn3HPSTACKLINE B2D2E994rn3HPSTACKLINE 1A2169F8rnNULL rn1XMTHDINFO All Thread DetailsrnNULL ------------------ 论坛

没有更多推荐了,返回首页