No developer dares to say that there is no problem with the program they are developing, and no one dares to say that they are not experiencing problems during the development process. When a problem is encountered, the problem is usually fixed by debugging according to the exception, error, or message in the log.
Of course, some common problems, or need to summarize, once again encountered such a problem, we know how to deal with it, the following list some of the problems encountered during the development process.
Nullponitexception
This anomaly can be said to be the most common anomaly. When this problem is encountered, most of the time is due to the absence of a null value to judge, in this case, you have to add a null value processing.
However, when we are looking at the problem, it is important not only to deal with the null value, but also to investigate why the data is empty. I've dealt with a problem that occurs when the console accesses a JMS resource, and when the nullpointexception is found, the data obtained is NULL. However, this value is not expected to be null in the actual case. This means that there are other potential problems that exist.
ClassNotFoundException
This class is also better understood. But finding the cause of the problem is not easy. If you want to easily find out the cause of this problem, you need to know something about ClassLoader's knowledge. This error occurs when the class is loaded, loaded with the string name of the class, and looks for the class from the ClassLoader search.
When this problem occurs, you may have the following reasons:
1) Under the search path, there should be a class or a jar, but not.
2) Search path error, this corresponds to ClassLoader use error or classloader the search path is not set correctly.
3) for applications that use OSGi, the search path has this class, but it is not found, it is necessary to check from the Manfist file whether the package is located in the Export-package.
Java Se: Summary of common exceptions