ログファイル
StdOutとかStdErrへの出力がどのログファイルに記録されるのかが分からず,代替手段としてHttpResponse.getWriterにwriteしてブラウザで見るという方法をやっていたのだが,いかんせん効率が悪い.悪いだけでなくException発生時の様子がまるで分からない.Status500だけじゃ分からん.
そこでちょっとWebSphereのログファイルについて調べてみた….あるじゃん.例えば"G:\IBM\WebSphere\AppServer\profiles\default\logs\server1"みたいなディレクトリに(環境によって変わる)Traceログとかがある.ここにStackTraceも出ていた.
[05/08/09 9:50:03:275 PDT] 0000004f WebApp E SRVE0026E: [サーブレット・エラー]-[testServlet]: java.lang.NoClassDefFoundError: testsuite.integration.xa.simple.websphere.GroupCommitHome at testsuite.integration.xa.simple.websphere.TestServlet.testGroupCommit(TestServlet.java:140) at testsuite.integration.xa.simple.websphere.TestServlet.doPost(TestServlet.java:93) at testsuite.integration.xa.simple.websphere.TestServlet.doGet(TestServlet.java:121) at javax.servlet.http.HttpServlet.service(HttpServlet.java:743) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:629) at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:2841) at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:220) at com.ibm.ws.webcontainer.VirtualHost.handleRequest(VirtualHost.java:204) at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1681) at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:77) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:421) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:367) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:276) at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminaters(NewConnectionInitialReadCallback.java:201) at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:103) at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:548) at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:601) at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:934) at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1021) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1332)
やっとこさまともにデバッグできる.