Error general content

java.lang.NullPointerException] with root cause

Writing in the front

Explanation: This is just one of the reasons I have found that yours may be different from mine. If you don’t fix the problem, spray lightly.

Project introduction

SSM project, developed in Eclipse.

The background that

Mall background to add goods. After filling in the relevant information of the product, submit the form and report an error.


The value entered must be of the same type as the property of the POJO entity class, otherwise an error will be reported



Front page and part of the code

The background POJO class

Since the type of price in the POJO class is Double, the item price column should not be entered as a string (I randomly entered some letters at the beginning of the test, the error, changed to a number can be entered).


java.lang.NullPointerException] with root cause