Java Exception Handling 01

Source: Internet
Author: User

When we do the Java project, there are some anomalies, how to quickly handle the exception will also affect the progress of a project development.

The following will be the faces of some of the exceptions that will be handled:

1. Database does not start

WORKAROUND: Computer--manage apps and services---->mysql--> boot

2. Project Start exception

Workaround: Url-pattern inside the web. XML has no home plus slash/

3. Class path Error

Workaround: The path to the Java class in SRC is inconsistent with the Servlet-class path in Web. xml

4. The access path is inconsistent with the Url-pattern path in Web. XML, that is, the access path is not found

Workaround: Go to Web. Xml to view the path of the initial setup and change it to the path you want.

5.tomcat7.0 or later, missing a Jstl.jar package

Workaround: Place the Jstl.jar under tomcat/lib/

6. Data connection failure, indicating database connection configuration error, URL configuration error

7. Incorrect user name or password to connect to the database

8. Data format exception, indicating that the object is converted to data when the exception, generally appear in the Integer.parseint (object) method

9. Garbled problem, when the data stored in the database is garbled, the description of processing in the back to the entrance data is garbled.

Workaround: The Encoding Method request.setcharacterencoding ("UTF-8") needs to be prepended to the process. Note that the servlet adds

Java Exception Handling 01

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.