Java Common exception Finishing

Source: Internet
Author: User

Preface:

Technology development into the pit nearly 1 years, touch roll climb, all kinds of upgrade play strange. Because currently engaged in Java-related, so tidy up and the common anomalies (Exception) posted out, one for follow-up remind yourself, and second for the coming into the pit of friends to fight a preventive needle!
Class A (Code logic error, run error)
1) null pointer Java.lang. NullPointerException

2) array out-of-bounds Java.lang. arrayindexoutofboundsexception: 1

3) Cast error

Or

4) string comparison ' B.equlas (A) ', not ' a==b '

B-level (text dependency related)

1) file java.io cannot be found under the current class path. FileNotFoundException

2) Jar dependency missing or version conflict Noclassreffounderror

C-level (compile-build-related)

1) Tomcat terminal share population with Address already in Use:bind

Workaround:

See which Tomcat projects have been started, if the service is started, stop the service and restart it, if you need to start multiple Web services at the same time and the port is occupied modify the new port!

2) Tomcat garbled

Workaround:

Modified $CATALINA _home/conf/server.xml, new uriencoding= "UTF-8"

Service-connector Before modification:

Service-connector Modified:

(change, save and restart Tomcat)

Class D (Machine hardware related)

1) Java overflow 1

2) Java content overflow 2 OutOfMemory

Post-language:
When you think "we never produce code, we just code the porter!" "Maybe you've come across a technical bottleneck nowadays!"

Java Common exception Finishing

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.