Problem Resolution--http Status 500

Source: Internet
Author: User

This error often occurs during the completion of the Javaweb project.

500: Refers to server internal error

I usually encounter this situation, I will go to see the console information, there will certainly be hints, null pointers (values are not passed), or java.sql.SQLException, in the interface and DAO

Check it out and you'll find out where the problem lies.

You can insert some test statements in the middle, gradually narrowing down the scope, you can find out where the error occurred in the step.

The possibility of an error

    1. Use for loop to make objects cross-border access

      For example:
      //若只有5个元素,当访问到第6个了,就属于越界访问,就会报错 
      for(i = 0;i<10;i++) 
      Student stu = dao.load(i); 

    2. Database problems, no connection, or unreadable data, causing some variables to be empty
    3. The name of the variable being sent is inconsistent with the variable name received

Problem Resolution--http Status 500

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.