Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Please help me summarize the types of exception handling in java.
Please help me summarize the types of exception handling in java.
Arithmetic exception class: arithmetic exception

Nullpointerexception class: NullPointerException

Type conversion exception: ClassCastException

Array negative subscript exception: NegativeArrayException

Array subscript out-of-bounds exception: ArrayIndexOutOfBoundsException

Exception that violates security principle: SecturityException

End of file exception: EOFException

No exception found in the file: FileNotFoundException.

String conversion to number exception: NumberFormatException

Operation database exception: SQLException

Input/output exception: IOException

No exception was found in this method: NoSuchMethodException.

java.lang.AbstractMethodError

Errors in abstract methods. Thrown when an application attempts to call an abstract method.

java.lang.AssertionError

The assertion is wrong. Used to indicate the failure of assertion.

Java . lang . class circularity error

Class circular dependency error. When initializing classes, this exception will be thrown if circular dependencies between classes are detected.

java.lang.ClassFormatError

The category format is wrong. Thrown when a Java virtual machine tries to read a Java class from a file and detects that the contents of the file do not conform to the valid format of the class.

Java.lang error

Mistake. Is the base class for all errors and is used to identify serious program running problems. These problems usually describe some exceptions that should not be caught by the application.

Java . lang . exceptioniniinitializererror

Initialization program error. Thrown when an exception occurs during the execution of a static initializer of a class. A static initializer refers to a static statement segment directly contained in a class.

java.lang.IllegalAccessError

Illegal access error. This exception is thrown when an application attempts to access, modify a field of a class or call its method, but it violates the visibility declaration of the field or method.

Java . lang . incompatilleclasschangeerror

Incompatible class change error. This exception is thrown when an incompatible change occurs to the class definition on which the execution method depends. Generally speaking, it is easy to cause this error by modifying the declaration definitions of some classes in the application without recompiling the whole application and running it directly.

java.lang.InstantiationError

Instantiation error. This exception is thrown when an application tries to construct an abstract class or interface through a new operator in Java.

java.lang.InternalError

Internal error. Used to indicate that an internal error has occurred in the Java virtual machine.

java.lang.LinkageError

Link error. This error and all its subclasses indicate that one class depends on other classes. After compiling this class, the dependent class changed its class definition without recompiling all classes, which led to an error.

java.lang.NoClassDefFoundError

Class definition error not found. This error is raised when a Java virtual machine or class loader attempts to instantiate a class, but the definition of the class cannot be found.

java.lang.NoSuchFieldError

There are no errors in the domain. This error is raised when an application tries to access or modify a domain of a class, but there is no definition of the domain in the definition of the class.

java.lang.NoSuchMethodError

There is no error in the method. This error is raised when an application attempts to call a method of a class, but there is no definition of the method in the definition of the class.

java.lang.OutOfMemoryError

Out of memory error. This error is raised when the Java virtual machine does not have enough available memory to allocate to the object.

java.lang.StackOverflowError

Stack overflow error. This error is raised when the application recursively calls too deep and the stack overflows.

java.lang.ThreadDeath

End of thread. This error is raised when the stop method of the Thread class is called to indicate the end of the thread.

Java. lang. unknown error

Unknown error. Used to indicate that the Java virtual machine has an unknown serious error.

java.lang.UnsatisfiedLinkError

Unsatisfied link error. Thrown when a Java virtual machine cannot find the native language definition of a class declared as a native method.

Java . lang . unsupportedclassversionerror

Wrong version of unsupported class. This error occurs when a Java virtual machine attempts to read a class file from, but finds that the current Java virtual machine does not support the major and minor version numbers of the file.

java.lang.VerifyError

Validation error. This error is raised when the validator detects an internal incompatibility or security problem in the class file.

java.lang.VirtualMachineError

Virtual machine error. Used to indicate that the virtual machine is damaged or insufficient resources are needed to continue operation.

java.lang.ArithmeticException

The arithmetic condition is abnormal. For example: integer divided by zero, etc.

Java . lang . arrayindexoutofboundsexception

Array index out of bounds exception. Thrown when the index value of the array is negative or greater than or equal to the array size.

java.lang.ArrayStoreException

Array storage exception. Raised when an object of a non-array declaration type is stored in an array.

java.lang.ClassCastException

Class modeling is not normal. Suppose there are classes A and B(A is not the parent or subclass of B), and O is an instance of A. When O is forcibly constructed as an instance of class B, this exception will be thrown ... This exception is usually called a cast exception.

Java . lang . classnotfoundexception

Class exception not found. This exception is thrown when an application tries to construct a class based on the class name in the form of a string, but it cannot find a class file with the corresponding name after traversing the CLASSPAH.

Java . lang . clonenotsupportedexception

Clone exception is not supported. When the Cloneable interface is not implemented or does not support the clone method, calling its clone () method will throw this exception.

Java . lang . enumconstantnotpresentexception

Enumeration constants have no exceptions. This exception is thrown when an application attempts to access an enumerated object by name and enumeration type, but the enumerated object does not contain constants.

abnormal

Root anomaly. Used to describe what the application wants to capture.

Java . lang . illegalaccessexception

Illegal access exception. This exception is thrown when an application attempts to create an instance of a class through reflection, access its properties, and call its methods, but the definition of the class, property, method, or constructor cannot be accessed at this time.

Java . lang . illegalmonitorstateexception

Illegal monitoring status is abnormal. This exception is thrown when a thread tries to wait for the monitor of an object (O) that does not belong to it or notifies other threads to wait for the monitor of the object (O).

Java . lang . illegalstateexception

Illegal state is abnormal. This exception is thrown when the Java environment and applications are not calling methods in a legal calling state.

Java . lang . illegalthreadstateexception

Illegal thread status is abnormal. When the county is not in the legal calling state of the method and the method is called, an exception will be thrown.

Java . lang . indexoutofboundsexception

Index out of bounds exception. This exception is thrown when the index value of the access sequence is less than 0 or greater than or equal to the sequence size.

Java . lang . instantiation exception

Instantiate an exception. This exception is thrown when you try to create an instance of a class through the newInstance () method, and the class is an abstract class or interface.

Java. lang. interrupted exception

Abort abnormally. This exception is thrown when a Thread is in a long waiting, sleeping or other suspended state, and other threads terminate the thread through the interrupt method of Thread.

Java . lang . negative arraysizeexception

Negative array size is abnormal. This exception is thrown when an array is created with a negative size value.

java.lang.NoSuchFieldException

There are no exceptions in the property. This exception is thrown when a nonexistent class property is accessed.

Java . lang . nosuchmethodexception

There are no exceptions in the method. This exception is thrown when accessing a nonexistent class method.

java.lang.NullPointerException

Null pointer exception. This exception is thrown when an application attempts to use null where an object is expected. For example, call the instance method of null object, access the properties of null object, calculate the length of null object, throw null with throw statement and so on.

Java . lang . numberformatexception

The number format is not normal. This exception is thrown when an attempt is made to convert a string to the specified numeric type, but the string does not conform to the format required by the numeric value type.

java.lang.RuntimeException

Runtime exception. Is the parent class of exceptions that can be thrown during the normal operation of all Java virtual machines.

Exception in java.lang.security.

Security anomaly. An exception thrown by the security manager to indicate a security violation.

Java . lang . stringindexoutofboundsexception

Exception in string index out of bounds. This exception is thrown when characters in a string are accessed with an index value less than 0 or greater than or equal to the sequence size.

Java . lang . typenotpresentexception

There are no exceptions to types. This exception is thrown when an application tries to access a type through a string expression of its name, but the type cannot be found based on the given name. The difference between this exception and ClassNotFoundException is that this exception is unchecked, while ClassNotFoundException is checked.

Java . lang . unsupportedoperationexception

Unsupported method exception. An exception indicating that the requested method is not supported.

abnormal

Javax. servlet. JSP. JSP exception: CannotRetrieve mapping of operation /login (/login is your operation name).

probable cause

No operation is defined in struts-config.xml, or no matching operation can be found, such as using.

-

abnormal

Exception of org. Apache. jasper. jasper: unable to retrieve the definition of form bean null.

probable cause

This exception is because Struts did not find the expected action form bean according to the mapping in struts-config.xml. In most cases, this may be caused by the mismatch between the name attribute set in the form bean and the name attribute set in the operation. In other words, both the action and the form should have a name attribute, and they should match exactly, including case. This error also occurs when there is no name attribute associated with the operation. If no name attribute is specified in an operation, there is no name attribute associated with the operation. Of course, when action does some control, such as jumping to the corresponding jsp page according to the parameter value, instead of processing the form data, it does not use the name attribute, which is also one of the usage methods of action.

-

abnormal

Unable to create operation instance of path /xxxx.

probable cause

Special note: Because there are many situations that can lead to this error, it is recommended that you improve the logging/debugging level of the web server so that you can see the potential error when trying to create an action class from more information. You have set the association in struts-config.xml (that is, added the.

There are many reasons why the action class specified by the class attribute of the action tag in struts-config.xml cannot be found, for example, the compiled class cannot be found. Class file. Unable to place the compiled. Class files for operations in the classpath (in web development, the location of classes is in r WEB-INF/classes, so your operation classes must be in this directory. For example, if your operation class is located in web-INF/classes/action/login.class, the property type of the operation set in struts-config.xml is action. Login).

Spelling mistakes also occur from time to time and are not easy to find. Pay special attention to the case of the first letter and the name of the package.

-

abnormal

Javax. servlet. JSP. JSP exception: the property username of beanerg.apache.struts.taglib.html.bean has no getter method.

probable cause

Variables in a bitless form bean define a getter method.

This error mainly occurs in the FormBean submitted by the form, marked with struts.

-

abnormal

Java . lang . noclassdeffounderror:org/Apache/struts/action/ActionForm

probable cause

This error mainly occurs in the corresponding Java. The class file was not found in the class path. If this error occurs when the web application is running, it is mainly because the specified class file is not in the classpath of the web server (/WEB-INF/classes and /WEB-INF/lib). In the above error, the reason is that the ActionForm class cannot be found.

-

abnormal

Javax. servlet. JSP. JSP exception: Exception occurred when creating bean of class org.apache.struts.action.actionform: {1}

probable cause

Instantiate the ActionForm class provided by Struts directly, instead of instantiating the class derived from ActionForm. This may happen implicitly if you specify that the form-bean is this Struts ActionForm class instead of specifying a subclass of this class for the form-bean.

Not associating a class derived from ActionForm with an operation can also cause this error.

-

abnormal

Javax. servlet. JSP. JSP exception: ActionMappings or ActionFormBeans collection not found.

probable cause

fault

Typing or spelling mistakes in struts-config.xml can also cause this exception. For example, the closing symbol/>; . You'd better check it with struts console tool.

In addition, load-on-startup must be declared in web.xml, which is either an empty label or a numerical value to indicate the priority of servlet operation. The higher the number, the lower the priority.

Another thing related to using load-on-startup is that this exception may also be caused when using Struts to precompile JSP files.

-

abnormal

Java.lang.nullpointerexception (requestutils.java:1223) at org.apache.struts.util.requestutils.forward URL.

probable cause

The forward element in struts-config.xml is missing the path attribute. For example, it should take the following form:

& ltforward name = " user home " path = "/user/user home . JSP "/& gt;

-

abnormal

Javax. servlet. JSP. JSP exception: beanerg.apache.struts.taglib.html.bean cannot be found in any scope.

probable cause

An attempt was made to use a child element of a form outside the form tag of Struts. This often happens when you are around.

-

abnormal

Javax. servlet. JSP. JSP exception: message with missing key xx.xx.xx

probable cause

The value pair of this key is not defined in the resource file applicationresources.properties. If this happens frequently when using eclipse, eclipse will automatically delete the resource file in the classes directory when the project is recompiled.

The resource file applicationresources.properties is not in the classpath. The resource file should be placed in the WEB-INF/classes directory, and of course it should be defined in struts-config.xml)

-

abnormal

The message resource cannot be found under the item of org.apache.struts.action.message.

probable cause

Obviously, this error occurred when using the resource file, and Struts did not find the resource file.

Implicit attempt to use an unavailable message resource (for example, use an empty html:options tag instead of specifying an option in its body-this assumes that the option is specified in the applicationresources.properties file).

XML Parser Problem-Too many, too few, incorrect/incompatible versions

-

abnormal

Strange and seemingly random characters appear in HTML and on the screen, but not in the original JSP or servlet.

probable cause

It is incorrect to mix Struts html:form tag with standard html tag.

The encoding style used is not supported on this page.

-

abnormal

"Document contains no data" in Netscape

There is no render data (completely empty) page in Microsoft Internet Explorer.

probable cause

Use a derived class of Action without implementing the perform () method or the execute () method. The perform () method is implemented in Struts 1.0 and the execute () method is implemented in Struts 1. 1, but Struts 1. 1 is backward compatible with the perform () method. But if you use Struts 1. 1 to create a derived class of Action and implement the execute () method, if you run it in Struts 1.0, you will get the error message "document contained no data" in Netscape or present a completely empty page (without HTML, etc.) in Microsoft Internet Explorer. ".

-

abnormal

servlet exception:bean utils . populate

solution

When uploading a file with Struts, I encountered javax.servlet.servletException: beautils.populate exception.

My ActionServlet doesn't use these tool classes BeanUtils. Later, I carefully checked the code and found that the form in jsp file forgot to add enctype="multipart/form-data ". Therefore, when writing a program, we should consider the possibility of the problem from many aspects and think of something other than the system prompt information.

-

1. After defining the operation, if a name is specified, a FormBean with the same name must be defined for the form mapping. 2. If there is an error in submitting the page after the "mapping path has no input attribute ..." definition operation, you need to define the redirection page in its input attribute. 3. If there is an error when inserting new data, it means that the type of the key specified in XXX.hbm.xml is the original type (int, long) because it will be assigned automatically. And this value often makes the system think that the record already exists. The correct way is to use java.lang.Integer or java.lang.Long objects. 4. If there is a "parameter type mismatch" error when inserting data, it may be because you used a special object, such as Date. Because struts cannot automatically convert from string type to date type, you need to manually convert string type to date type in Action. 5. In hibernate, the iterator () method of Query is much faster than the list () method. 6. If an "expected equal sign" error occurs, it means that the strtus tag contains another tag or variable, such as:

& lthtml:select property = " test " onchange = " & lt; % = test% >/& gt;;

or

& lthtml:hidden property = " test " value = " & lt; bean:write name = " t " property = " p "/>/& gt;

Such a situation ...

-

Error: An exception occurred in the thread "master" organization. Hibernate. exception. sqlgrammarexception: Unable to perform JDBC batch update Reason and solution: Hibernate tool (or Eclipse itself. Database Explorer) The tool for generating *.hbn.xml contains the attribute catalog = "* * * * "(* "(* stands for database name). Just delete this attribute.

-

Error: org.hibernate.objectdeleted exception: cascade will re-save the deleted object (delete the deleted object from the association).

Cause and solution:

Method 1 deletes the cascade at the collection end.

Method 2: After resolving the relationship, delete it.

Method 3 adds the cascade to many-to-one, but the value cannot be none.

Last resort:

Option to check whether hashCode equals uses id as the unique tag; There is no problem when I use uuid.hex; But not with native. What should I do? Delete it!

-

Question: Today, I used Tomcat 5.5. 12, and found that the original easy-to-use system could not be used. After repeated testing, I found that the page cannot contain taglib. Otherwise, the following prompt will appear: The http status 500-type exception report message indicates that the server has encountered an internal error (). Which prevents it from completing the request. exception org . Apache . jasper . jasper exception:/index . JSP( 1, 1) cannot read the TLD "meta-INF/tlds/struts-bean.tld" from the jar file "file: * * */web-INF/lib/struts.jar": Reason: The jar in the lib folder of the project was updated, and the servlet.jar and JSP-API were also published when it was published. Solution: deleting jsp-api.jar will solve this problem. -

Error: java.lang.NullPointerException

Reason: I found that things that need to be injected, such as dao instance and manage instance, were not injected (commonly known as null pointer exception). Solution: At this point, you should check the log file; The default value is the log file of the application server. For example, Tomcat is [Tomcat installation directory]/logs; You will find a prompt: it may be: org.springframework.beans.factory.bean createexception: Error in creating a bean named' SF' defined in servletcontextresource [/web-INF/applicationcontext.xml]: bean initialization failed; Nested exception isorg. hibernate. hibernate exception: cannot be configured from the URL: file: src/hibernate.cfg.xmlorg.hibernate.hibernate exception: cannot be configured from the URL: file: src/hibernate.cfg.xml.............. Reason: java.io.file notfoundexception: src \ Hibernate. CFG. XML may be: org.springframework.beans.factory.beancreateexception: An error occurred while creating a bean named "session factory"; the inserted context was defined; r.esource [/web-INF/applicationcontext.xml]: The initialization of the bean failed; Nested exception isorg.hibernate.mappingexception: resource: com/MCC/coupon/model/userrole. Hbm.xmlnotfound org.hibernate.mappingexception: resource: com/MCC/coupon/model/userrole.hbm.xmlnotfound Then you will know that the reason is that there is an error in parsing the configuration file, which cannot be seen through the web page. More is persistent innuendo file errors; Resulting in not being parsed; Of course, the function you need cannot be used.

-

Error: StandardWraperValve [action]: servlet.service () of servlet operation threw an exception.

Javax. servlet. JSP. JSP exception: unable to retrieve the mapping of action /settlementTypeManage.

Or: Type Status Report Message servlet Operation Unavailable Describes that the requested resource (servlet Operation Unavailable) is unavailable.

Reason: Same as above.

-

Error StandardWrappervalve [JSP]: Servlet.service () threexception java.lang.classnotfoundexception: org.apache.struts.taglib.bean.cookie tei interface error description:

Exception of org. Apache. jasper. jasper: unable to load or instantiate the TagExtraInfo class: org.apache.struts.taglib.bean.cookie tei.

Cause and solution: The tag at the beginning of your "html:" is not placed in the