开发者

Using Jquery ajax() call, Tomcat logs fall silent

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?


Activity seems pretty dead, so I will move my answer from comments to the answer section.

Ok, I got the specific case solved. My SqlDeveloper was blocking the myBatis. I shut down my SqlDeveloper because I was planning on leaving for the day, and there goes Tomcat marching on unattended over an hour later from where it had left off deleting the 2 notes I wanted deleted. So I understand why there would be not Tomcat logs in this case, MyBatis was still trying to accomplish the original update action.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜