Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Java Stack Traces

3,282 views

Published on

Published in: Technology
  • Be the first to comment

Java Stack Traces

  1. 1. Debugging with Java Stack Traces Daryl Banttari Analytics, Inc.
  2. 2. About Daryl <ul><ul><li>IT Professional since 1986 </li></ul></ul><ul><ul><li>ColdFusion since 1997 </li></ul></ul><ul><ul><li>Java since 2003 </li></ul></ul><ul><ul><li>Allaire/Macromedia Consulting 2000-2005 </li></ul></ul><ul><ul><li>Webapper (SeeFusion!) </li></ul></ul><ul><ul><li>Current: Analytics, Inc. </li></ul></ul>
  3. 3. Agenda <ul><ul><li>Java and ColdFusion </li></ul></ul><ul><ul><li>What is a &quot;Stack Trace&quot;? </li></ul></ul><ul><ul><li>Reading a Stack Trace </li></ul></ul><ul><ul><li>Debugging with Stack Traces </li></ul></ul><ul><ul><li>Gathering Stack Traces </li></ul></ul>
  4. 4. Java and ColdFusion <ul><ul><li>ColdFusion is a Java J2EE Application </li></ul></ul><ul><ul><li>Servlet Engine (JRun) </li></ul></ul><ul><ul><li>ColdFusion (cfmservlet) </li></ul></ul><ul><ul><li>Request Threads (your application) </li></ul></ul>
  5. 5. Java Stack Traces <ul><ul><li>Snapshot in Time </li></ul></ul><ul><ul><li>Shows Calls, Not Data </li></ul></ul><ul><ul><li>Multiple Needed to Show Motion </li></ul></ul>
  6. 6. <ul><li>&quot;jrpp-352&quot; runnable </li></ul><ul><li>at java.lang.Double.parseDouble(Double.java:220)? </li></ul><ul><li>at coldfusion.runtime.CFDouble.parseDouble(CFDouble.java:23)? </li></ul><ul><li>at coldfusion.runtime.CfJspPage.internalIsBoolean(CfJspPage.java:707)? </li></ul><ul><li>at coldfusion.runtime.CfJspPage._compare(CfJspPage.java:273)? </li></ul><ul><li>at cfApplication2ecfm726408707._factor5(D:Websites edacted.comApplication.cfm:3)? </li></ul><ul><li>at cfApplication2ecfm726408707.runPage(D:Websites edacted.comApplication.cfm:521)? </li></ul><ul><li>at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:147)? </li></ul><ul><li>at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:357)? </li></ul><ul><li>at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:62)? </li></ul><ul><li>at coldfusion.filter.CfincludeFilter.include(CfincludeFilter.java:30)? </li></ul><ul><li>at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:93)? </li></ul><ul><li>at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)? </li></ul><ul><li>at coldfusion.filter.PathFilter.invoke(PathFilter.java:80)? </li></ul><ul><li>at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:47)? </li></ul><ul><li>at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)? </li></ul><ul><li>at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:35)? </li></ul><ul><li>at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:43)? </li></ul><ul><li>at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)? </li></ul><ul><li>at coldfusion.CfmServlet.service(CfmServlet.java:105)? </li></ul><ul><li>at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)? </li></ul><ul><li>at com.seefusion.Filter.doFilter(Filter.java:49)? </li></ul><ul><li>at com.seefusion.SeeFusion.doFilter(SeeFusion.java:1494)? </li></ul><ul><li>at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)? </li></ul><ul><li>at jrun.servlet.FilterChain.service(FilterChain.java:101)? </li></ul><ul><li>at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)? </li></ul><ul><li>at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)? </li></ul><ul><li>at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:249)? </li></ul><ul><li>at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527)? </li></ul><ul><li>at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:192)? </li></ul><ul><li>at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:348)? </li></ul><ul><li>at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:451)? </li></ul><ul><li>at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:294)? </li></ul><ul><li>at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)? </li></ul>
  7. 7. Debugging with Stack Traces <ul><li>Examples </li></ul>
  8. 8. Recognizing Stack Elements <ul><ul><li>Jrun.* - Jrun </li></ul></ul><ul><ul><ul><li>Ignore: jrun.servlet.jrpp.ProxyEndpoint.readFully </li></ul></ul></ul><ul><ul><ul><li>Suspect: jrun.servlet.jrpp.JrppOutputStream$SpillStream.write </li></ul></ul></ul><ul><ul><li>Coldfusion.* </li></ul></ul><ul><ul><ul><li>Functions: coldfusion.runtime.CfJspPage.* </li></ul></ul></ul><ul><ul><ul><li>Tags: coldfusion.tagext.sql.QueryTag </li></ul></ul></ul><ul><ul><li>Probably Innocent Java </li></ul></ul><ul><ul><ul><li>java.util.* </li></ul></ul></ul><ul><ul><ul><li>java.lang.* </li></ul></ul></ul><ul><ul><li>Suspicious Java </li></ul></ul><ul><ul><ul><li>java.net.* </li></ul></ul></ul><ul><ul><ul><li>java.io.* </li></ul></ul></ul><ul><ul><li>Your Code! </li></ul></ul><ul><ul><ul><li>cfApplication2ecfm726408707.runPage(D:Websites edacted.comApplication.cfm:577)? </li></ul></ul></ul>
  9. 9. Gathering Stack Traces <ul><ul><li>SeeFusion / SeeStack </li></ul></ul><ul><ul><li>CF8 Enterprise Server Monitor </li></ul></ul><ul><ul><li>jstack </li></ul></ul>
  10. 10. Summary <ul><ul><li>Stack Traces are snapshots of threads </li></ul></ul><ul><ul><li>Multiple traces may be needed to diagnose slow/hung threads </li></ul></ul><ul><ul><li>Read thread stacks from bottom to top </li></ul></ul><ul><ul><li>Look for code line numbers and keywords </li></ul></ul>
  11. 11. Q&A <ul><li>Daryl Banttari </li></ul><ul><li>Analytics, Inc. </li></ul>

×