JAVA common exception summary, JAVA common Summary
1. java. lang. ArithmeticException
An Arithmetic Operation exception occurs. For example, if the divisor is 0, an arithmetic exception is thrown.
2. Java. lang. StringIndexOutOfBoundsException:
This is an out-of-bounds subscript exception generated by intercepting the string substring. The reason may be that the string is null or the length is less than 1
3. Java. lang. NullPointerException NULL pointer exception
This exception occurs because a reference is null, but a method is called.
4. ClassCastException
Type forced conversion exception, for example: String str = "a"; Integer num = (Integer) str;
5. IllegalArgumentException
An error occurred while passing invalid parameters. This error indicates that an invalid or incorrect parameter was passed to the method. Check whether the parameter of the value passing method is incorrect.
6. NumberFormatException
Number Format exception, for example: String str = "a"; Integer. parseInt (str );
7. ClientAbortException: java. io. IOException
The reason is that when the server is processing an http request and outputting content, the user closes the browser, causing a ClientAbortException exception. It is a common type of I/O exceptions.
8. java. lang. classnotfoundexception
This exception is a problem that occurs frequently when many programmers originally developed in development environments such as jb compile the packages under jb in wtk. The exception is interpreted as "the specified class does not exist ", check whether the class name and path are correct,
If the package is made under jb, the package is usually added by default. Therefore, you must add the package path after you go to wtk.
9,ClientAbortException Caused by: java. NET. SocketException: Connection reset by peer: socket write error
This type of exception is already common and generally involves the following situations:
When the number of concurrent connections on the server exceeds its capacity, the server will shut Down some of the connections. The client closes the browser, and the server is still sending data to the client.
10,ArrayStoreException
An error occurred while saving the incompatible objects to the array with the declared type. For example, Object x [] = new String [3]; x [0] = new Integer (0 );
11, NegativeArraySizeException
An error occurred while creating an array of negative values. For example, int [] arr = new int [10]; int I = arr [-1];
12. SecurityException
Security exception, for example, Android permission exception. If a program running java prompts Missing requited Permissions manifest attribute in main jar
13. EOFException
An error occurred while the file has ended.
14,FileNotFoundException
File not found exception
15,SQLException
Database Operation exception
16,NoSuchMethodException
Method not found exception
17,Java. lang. ArrayIndexOutOfBoundsException
An error occurred while exiting the array index. If the index value of the array is negative or greater than or equal to the size of the array, throw.
18,Java. lang. IllegalAccessException
Illegal access exception. When an application tries to create an instance of a class, access this class attribute, and call this class method through reflection, at that time, the exception could not be thrown when defining the category, attribute, method, or constructor.
19,Java. lang. IllegalMonitorStateException
Illegal monitoring status exception. This exception is thrown when a thread tries to wait for a monitor of an object (O) that it does not own or notifies other threads to wait for the monitor of this object (O.
20. java. lang. IllegalStateException
Illegal status exception. If a method is called while the Java environment and application are not in the valid call state of a method, this exception is thrown.
21,Java. lang. IllegalThreadStateException
The invalid thread status is abnormal. When the county seat is not in the valid call status of a method and the method is called, an exception is thrown.
22,Java. lang. InstantiationException
Instantiation exception. This exception is thrown when an instance of a class is created using the newInstance () method and the class is an abstract class or interface.
23,Java. lang. InterruptedException
Aborted exception. This exception is thrown when a Thread is in a long wait, sleep, or other pause State and other threads terminate the Thread through the interrupt method of the Thread.
24,Java. lang. NoSuchFieldException
The property does not exist. This exception is thrown when you access a non-existent attribute of a class.
25,Java. lang. RuntimeException
Exception during running. It is the parent class of all exceptions that can be thrown during normal operations of Java virtual machines.
26,Java. lang. TypeNotPresentException
Type does not exist.
27. com. mysql. jdbc. exceptions. jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails ('mydb '. 'tb _ room', CONSTRAINT 'room _ comment _id 'foreign key ('room _ comment _id') REFERENCES 'tb _ directory' ('Hotel _ id ') on delete no action on update no action)
Cascade operations are not allowed for external associations. cascade = "all" allows cascade operations.
28. org. springframework. beans. factory. UnsatisfiedDependencyException: Error creating bean with name 'studentservice' defined in file
Cause: StudentService is not marked as @ component. The object cannot be found.
29. org. hibernate. engine. jndi. JndiException: Error parsing JNDI name []
Cause 1: <session-factory name = ""> by default, the name attribute is set to null.
30. xml. sax. SAXParseException
The header file configuration syntax is generally incorrect.
31. java. io. NotSerializableException
Generally, the bean has no serialization exception.