0

I am trying to avoid a whole bunch of manual inspection to debug my code, even though the error will most likely turn out to be a mistype or something silly like that. I am making an ajax() call to a Struts 2 action using jQuery and the execution is halted. At the Javascript level, I get the very descriptive 500 error indicating "No clue, you are on your own developer". So what I am doing at the action level in Struts2 is putting a log.info line after every command. Here is what I have for demonstration purposes:

       log.info("Trying to process " + entry.trim());
       int noteIndex = Integer.valueOf(entry.trim());
       log.info("Note index is " + noteIndex + " in a list of size " + iss.getNotes().size());
       Integer noteId = iss.getNoteByIndex(noteIndex).getIssueNoteId();
       log.info("Noteid is " + noteId);
       service.deleteNote(noteId);
       log.info("Note " + noteId + " has been deleted");

My tomcat logs give me:

2011-07-08 14:26:54,135  INFO [http-8080-3] (IssueNoteAction.java:54) - Entering delete note with 2,3
2011-07-08 14:26:54,135  INFO [http-8080-3] (IssueNoteAction.java:61) - Trying to process 2
2011-07-08 14:26:54,135  INFO [http-8080-3] (IssueNoteAction.java:63) - Note index is 2 in a list of size 5
2011-07-08 14:26:54,135  INFO [http-8080-3] (IssueNoteAction.java:65) - Noteid is 80686

This indicates that the call to my Struts 2 service, deleteNote which actually does a soft delete (an update statement) through myBatis, is where the problem is. However, the apparent failure is silent. Usually when I make a mistake with myBatis, myBatis lets me know (and the logs are often very useful) and I go about my way fixing my mistake. I have myBatis set at the INFO level.

So what is it that is shutting up Tomcat? Not only for this occasion, but also for future ajax() calls where I need to debug, how do I go about getting more information from Tomcat/Log4J?

4

1 回答 1

1

活动似乎已经死了,所以我会将我的答案从评论移到答案部分。

好的,我解决了具体案例。我的 SqlDeveloper 阻止了 myBatis。我关闭了我的 SqlDeveloper,因为我正计划离开一天,一个多小时后,Tomcat 在无人看管的情况下继续前进,从它停止删除我想要删除的 2 个注释的地方开始。所以我明白为什么在这种情况下不会有 Tomcat 日志,MyBatis 仍在尝试完成原始更新操作。

于 2011-07-11T00:19:32.460 回答