Type abnormality report
Description the server encountered an unexpected situation, prevent it to complete the request,
The Exception
Java. Lang. NullPointerException
Com. Hr. Dao. EASYBUY_PRODUCT_CATEGORYDao. SelectFather (EASYBUY_PRODUCT_CATEGORYDao. Java: 108)
Com. Hr. Servlet. IndexSelectServlet. Service (IndexSelectServlet. Java: 26)
Javax.mail. Servlet. HTTP. HttpServlet. Service (HttpServlet. Java: 728)
Org, apache tomcat, websocket server. WsFilter. DoFilter (WsFilter. Java: 52)
) : the whole stack information can pay attention to the main problem in the server logs view
Apache Tomcat/7.0.103
CodePudding user response:
How to solve theCodePudding user response:
Null pointer, IndexSelectServlet. Java 26 lines of this file, you see if you object to nullMake a judgment
CodePudding user response:
This is a null pointer1. Check the front end, open the browser console network view request to see if the request body data sent (send out, prove that the front-end request normal)
2. Check the backend, controller, see if you accept the request of data processing (mainly to the request of the front end, to determine the way you take data is correct, such as your front request params are used, the backend is accept requrstBody, then get the data, check to see, if no problem, it is proved that the request to the back end, to the position, namely the whole front end with normal communication, also complete to the back-end data)
More than 3. If there is still no problem, take a look at your back-end service to the operation of the database, you back after the database operations such as data processing problems, and according to the library to serialize the front end of the request is that all are correct, after receiving, the controller to invoke the service interface database operations are no problem, then in the data processing of return out of the question,
I met, for example, redis serialize the sequence of words, redis back bai redis automatic sequence before put into words, take out the data need by the line after deserialization, this time the bug is deserialized problem, use the tostring (), that is the problem, then find for a long time to solve the deserialization of redis data has its own way, you can go to baidu this knowledge, this example is to tell you a direction, you can be in the front two are no problem, in this direction to find problems
Development in conclusion, we all do, you don't give a specific code, we also can't type more code breakpoints, at most is to put the debug debugging of ideas and experience to tell you, because I also ask myself, what I would if I met the exception handling, may not be what actually help (after all you just gave an error, and give no professional you need to read the newspaper in the wrong color deepening section), the last hope I can give you some idea of this passage, programmers are specific issue concrete analysis, can give the train of thought, hands-on debugging ability is your own, you need to bit by bit more code, this is a process, the process is there are a lot of nutrients, growth, and (finally, abnormal actually you can go to baidu search, the error, and see what others in the same error, and then see how they solve, you can see them, but you are such an error to stick out (to help also can't help you to an error doesn't offer much in the way of information) for others to solve, to tell the truth about their bad ~ ~ come on,,)