A bug that handles exceptions in Catalina-tomcat?

Source: Internet
Author: User
Tags exit log tomcat
Bea uses Catalina, or Tomcat, to accidentally find a very hidden, perhaps not fatal bug, in the JSP somewhere in the tag if the error, will be in front of the output buffer without an exception exit, rather than in the real wrong place to emit error exception.
10:45 points: But found Formtag to perform an exception exit, and the error log has no output; So decide to turn around and see what's going on first. Oddly enough, the error log does not output even after the breakpoint has been entered in the Doendtag. The final check result, not the procedure is wrong, but under certain condition, the tag has no response to output, the request output Vaildatorscript output only half.

This tag integrated struts.validator Javascriptstatictag, I do not know if anyone does: I do not want to spend time to rebuild the code of its anatomy out, also do not want to let the front page more than a few need to configure the tag; So directly with the superior's formtag to it, and then directly call its doStartTag ()-Actually, in the JSP container is not the way to call it by registered record? I've seen this mistake before, but I'm back to normal in an instant. Since the exception disappears and the error log is not logged, it is impossible to discover its source of error. This time back, it caught my attention, and the error lasted longer, so you can set breakpoints in your program to track where its errors occurred.

As a result, the source of the error is focused on the label that was not written by me, from the validator of struts. For the middle widget such as struts, my attitude now is that if I can't finish reading the code, I can set the breakpoint record output to the error log degbug, and I don't use it, so now struts in my hand just has its component function, The way it is used is completely different from what is generally seen in struts, which includes this javascripstatictag. For its usage, I want it to be part of the program, and when I choose to validate the client for a form, it automatically completes the necessary code output, without having to set the tag on my site and match its calling function name. This integration is successful, has been running for a long time, often a certain intensity of testing, but in all fairness, for the code I still do not go deep.

After the error is generated I intend to output the breakpoint to the buffer, This is because this program is to output validator-rules.xml JavaScript code in the page, but found that no success, many breakpoints are not output, indicating that the program output is interrupted, but the output process is normal, otherwise the error log will be recorded. Further verification shows that the the program runs and the JavaScript obtained from the memory record is complete, eliminating the possibility of error reading XML, and proving that the Java program is running completely normal, the error is not in the developer program, but the platform itself, in the output buffer without exception out of the!!! Because the Javascripttag is using StringBuffer last ToString to output to the buffer, or, because this amount is too large, so overflow?? So I divided it into segments and output, but the results were exactly the same. Perhaps because of my call to it is not done by the container, directly by the Parent-tag call method caused a small buffer allocation?? It was changed to GetString method, and the output was finished by the parent, but the result was still the same.

Finally, I intend to go over this step first, to see how the results of the implementation, found that the page due to Bselecttag due to the tune associated with the Baseif interface last night mistakenly deleted a method of an exception, and then recompile, then executed, the results found above the error disappeared. Re-restore this error and the exception appears again. That's why they found it. In fact, BEA uses the catlinajsp container, which is a unified process for interpreting a JSP page. This anomaly indicates that the output text generation before and after the JSP is associated, and that the program running in the following error, like here, is methodnofound at the back of the run (I estimate that, since even the server log did not find an error record), the interpretation execution process was interrupted, Causes the output of the buffer text to exit half without exception.

I rarely handle JSP, this is an experience, if this buffer exception output and the program can not capture any error log, first of all the relevant program to compile the page, to exclude this may be said.

This question took me two hours to find the reason, indeed concealed, Some side effects are so familiar with the Validator.javascript code, the project after a bit of time, it will be modified, only output this time the required authentication method script: I always think it output too much stuff, put the validator_ All the script methods in the Rules.xml are all sent out.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.