⊙! Below are some java exception sets and Handling Methods

Source: Internet
Author: User
Tags integer division xml parser tld


-------------------------------------------------------------------- Below are some java exception set samples -------------------------------------------------------------------------------------------

Http://www.blogjava.net/freeman1984/archive/2007/09/27/148850.html

Arithmetic exception class: arithmeticexecption

Null Pointer exception class: nullpointerexception

Type forced conversion exception: classcastexception

Array negative subscript exception: negativearrayexception

Array subscript out of bounds exception: arrayindexoutofboundsexception

Security violation exception: secturityexception

File ended exception: eofexception

File not found exception: filenotfoundexception

An error occurred while converting the string to a number: numberformatexception

Database Operation exception: sqlexception

Input and Output exceptions: ioexception

Method not found exception: nosuchmethodexception

Java. Lang. abstractmethoderror

Incorrect abstract method. Thrown when an application tries to call an abstract method.

Java. Lang. assertionerror

Assertion error. Used to indicate an assertion failure.

Java. Lang. classcircularityerror

Class loop dependency error. When initializing a class, if the cyclic dependency between classes is detected, this exception is thrown.

Java. Lang. classformaterror

Class format error. When the Java Virtual Machine attempts to read a Java class from a file and detects that the content of the file does not conform to the valid format of the class, it throws.

Java. Lang. Error

Error. Is the base class for all errors, used to identify serious program running problems. These problems usually describe abnormal situations that should not be captured by the application.

Java. Lang. exceptionininitializererror

Initialization program error. Thrown when an exception occurs during the execution of a class static initialization program. Static initialization programs are static statement segments directly included in the class.

Java. Lang. illegalaccesserror

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

IllegalArgumentException()
The thrown exception indicates that an invalid or incorrect parameter is passed to the method.

Java. Lang. incompatibleclasschangeerror

Incompatible class change error. This exception is thrown when the class definition on which the method being executed depends is incompatible. This error is easily caused when the Declaration definition of some classes in the application is modified without re-compiling the entire application.

Java. Lang. instantiationerror

Instantiation error. This exception is thrown when an application attempts to construct an abstract class or interface using the new operator of Java.

Java. Lang. internalerror

Internal error. Indicates that an internal error has occurred to the Java VM.

Java. Lang. linkageerror

Link error. This error and all its subclasses indicate that a class depends on other classes. After the class is compiled, the dependent class changes its class definition and does not recompile all the classes, in this case, an error occurs.

Java. Lang. noclassdeffounderror

Class Definition error not found. This error is thrown when the Java Virtual Machine or classloader tries to instantiate a class but cannot find the definition of the class.

Java. Lang. nosuchfielderror

Domain does not exist. This error is thrown when an application attempts to access or modify a certain domain without the definition of this domain.

Java. Lang. nosuchmethoderror

The method does not exist. This error is thrown when an application attempts to call a certain method without the definition of this method.

Java. Lang. outofmemoryerror

Memory insufficiency error. This error is thrown when the available memory is insufficient for the Java Virtual Machine to allocate to an object.

Java. Lang. stackoverflowerror

Stack overflow error. This error is thrown when the hierarchy of recursive calls of an application is too deep, resulting in stack overflow.

Java. Lang. threaddeath

The thread ends. This error is thrown when the stop method of the thread class is called to indicate the end of the thread.

Java. Lang. unknownerror

Unknown error. Used to indicate that the Java Virtual Machine has encountered an unknown serious error.

Java. Lang. unsatisfiedlinkerror

A link error is returned. Thrown when the Java Virtual Machine does not find the native language definition of a class declared as the native method.

Java. Lang. unsupportedclassversionerror

Unsupported class version error. This error is thrown when the Java Virtual Machine attempts to read a class file but finds that the main and secondary versions of the file are not supported by the current Java virtual machine.

Java. Lang. verifyerror

Verification error. This error is thrown when the validators detect internal incompatibility or security issues in a class file.

Java. Lang. virtualmachineerror

Virtual Machine error. Indicates that the virtual machine is damaged or the resources required to continue the operation are insufficient.

Java. Lang. arithmeticexception

Arithmetic condition exception. For example, integer division by zero.

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.

Java. Lang. arraystoreexception

An error occurred while storing the array. It is thrown when a non-array declared object is stored in the array.

Java. Lang. classcastexception

Class styling exception. Suppose there are classes A and B (A is not the parent class or subclass of B), and O is the instance of A, then this exception is thrown when an instance of Class B is forcibly constructed by O. This exception is often called a forced type conversion exception.

Java. Lang. classnotfoundexception

Class exception not found. This exception is thrown when the application tries to construct a class based on the class name in the string format and cannot find the class file with the corresponding name after traversing the classpah.

Java. Lang. clonenotsupportedexception

Clone exceptions are not supported. If the cloneable interface is not implemented or the clone method is not supported, this exception is thrown when the clone () method is called.

Java. Lang. enumconstantnotpresentexception

The enumerated constant does not exist. This exception is thrown when an application attempts to access an enumeration object by name or enumeration type, but this enumeration object does not contain constants.

Java. Lang. Exception

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

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.

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.

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.

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.

Java. Lang. indexoutofboundsexception

An exception occurred when the index was out of bounds. This exception is thrown when the index value for accessing a sequence is smaller than 0 or greater than or equal to the sequence size.

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.

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.

Java. Lang. negativearraysizeexception

An error occurred while the array size is negative. This exception is thrown when an array is created with a negative value.

Java. Lang. nosuchfieldexception

The property does not exist. This exception is thrown when you access a non-existent attribute of a class.

Java. Lang. nosuchmethodexception

Method does not have an exception. This exception is thrown when a method that does not exist to access a class.

Java. Lang. nullpointerexception

Null Pointer exception. This exception is thrown when the application tries to use null where the object is required. For example, call the instance method of the null object, access the attribute of the null object, calculate the length of the null object, and throw null using the throw statement.

Java. Lang. numberformatexception

The number format is incorrect. This exception is thrown when you try to convert a string to a specified numeric type that does not meet the numeric type requirements.

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.

Java. Lang. securityexception

Security exception. Thrown by the security manager to indicate exceptions that violate security conditions.

Java. Lang. stringindexoutofboundsexception

An exception occurred when the string index was out of bounds. If the index value is used to access a character in a string and the index value is smaller than 0 or greater than or equal to the sequence size, this exception is thrown.

Java. Lang. typenotpresentexception

Type does not exist. When an application attempts to access a type by using a string expression of a type name, but cannot find the type based on the given name, this exception is thrown. This exception differs from classnotfoundexception because it is an unchecked (not checked) exception, while classnotfoundexception is a checked (checked) exception.

Java. Lang. unsupportedoperationexception

The method is not supported. Exception that indicates that the requested method is not supported.

Exception
Javax. servlet. jsp. jspexception: cannot retrieve mapping for action/login (/login is your action name)

Possible causes
Action is no longer defined in the struts-config.xml, or no matching action is found, for example, using the <HTML: Form Action = "login. do ". submit the form to login. do processing, if the above exception occurs, check the definition section in the struts-config.xml, sometimes it may be a wrong character or some do not comply with the rules, you can use the strutsconsole tool to check.
Bytes -----------------------------------------------------------------------------------------------------------------
Exception
Org. Apache. Jasper. jasperexception: cannot retrieve definition for form bean null

Possible causes

This exception is because struts does not find the form bean that action expects Based on the ing in the struts-config.xml. In most cases, the reason may be that the name attribute set in form-bean does not match the name attribute set in action. In other words, action and form should each have a name attribute and must be exactly matched, including case sensitivity. This error occurs when no name attribute is associated with action. If the name attribute is not specified in action, no name attribute is associated with action. Of course, when an action creates some controls, for example, jump to the corresponding JSP page based on the parameter value, instead of processing form data, this does not require the name attribute, which is also one of the methods to use the action.
Bytes -----------------------------------------------------------------------------------------------------------------
Exception
No action instance for path/xxxx cocould be created

Possible causes
Note: This error may occur in many cases. We recommend that you increase the log/debugging level of your Web server, in this way, we can see the potential errors that occur when trying to create an action class from more information, this action class you have set the Association (that is, adding the <action> tag) in the struts-config.xml ).

The action class specified by the class attribute of the Action tag in the struts-config.xml cannot be found for many reasons, such as locating the compiled. Class file failed. Failure to place compiled. Class file for the action in the classpath (in web development, the class is located in the r WEB-INF/classes, so your action class must be in this directory. For example, if your action class is located in the WEB-INF/classes/Action/login. class, it is action. login when setting the attribute type of action in the struts-config.xml ).
Spelling error. This also occurs from time to time and is not easy to find. Pay special attention to the case of the first letter and the name of the package.
Bytes -----------------------------------------------------------------------------------------------------------------
Exception
Javax. servlet. jsp. jspexception: No getter Method for property username of bean org.apache.struts.taglib.html. Bean

Possible causes
No variable in form bean defines the getter Method

This error occurs mainly in formbean submitted by form. When <HTML: Text property = "username"> is marked with Struts, A GetUserName () method must be provided in formbean. Note the letter "U ".
Bytes -----------------------------------------------------------------------------------------------------------------
Exception
Java. Lang. noclassdeffounderror: ORG/Apache/struts/Action/actionform

Possible causes
This error mainly occurs when the corresponding java. Class file cannot be found in classpath. If this error occurs when the web application is running, it is primarily 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 cause is that the actionform class cannot be found.
Bytes -----------------------------------------------------------------------------------------------------------------
Exception
Javax. servlet. jsp. jspexception: exception creating bean of class org. Apache. Struts. Action. actionform: {1}

Possible causes
Instantiating Struts-provided actionform class directly instead of instantiating a class derived off actionform. this mightoccur implicitly if you specify that a form-bean is this struts actionform class rather than specifying a child of this classfor the form-bean.

Not associating an actionform-descended class with an action can also lead to this error.
Bytes -----------------------------------------------------------------------------------------------------------------
Exception
Javax. servlet. jsp. jspexception: cannot find actionmappings or actionformbeans collection

Possible causes
The <servlet> tag that does not identify struts actionservlet is the <sevlet-mapping> tag mapped to the. Do extension, or neither of them is declared in Web. xml.

Typing or spelling errors in the struts-config.xml can also lead to this exception. For example, a flag of the close symbol/> is missing. It is best to use the struts console tool to check.

In addition, load-on-startup must be in the web. declared in XML, this is either an empty tag or a value, which is used to indicate the priority of the servlet operation. The higher the value, the lower the priority.

Another issue related to the use of load-on-startup is that this exception may also occur when JSP files are pre-compiled using struts.
Bytes -----------------------------------------------------------------------------------------------------------------
Exception
Java. Lang. nullpointerexception at org. Apache. Struts. util. requestutils. forwardurl (requestutils. Java: 1223)

Possible causes
The forward element in the struts-config.xml lacks the path property. For example, the format is as follows:
<Forward name = "userhome" Path = "/user/userhome. jsp"/>
Bytes -----------------------------------------------------------------------------------------------------------------
Exception
Javax. servlet. jsp. jspexception: cannot find bean org.apache.struts.taglib.html. Bean in any scope

Probable causes
Try to use the child element of form outside the form tag of struts. This often happens when you use the HTML Tag of struts after Bytes -----------------------------------------------------------------------------------------------------------------
Exception
Javax. servlet. jsp. jspexception: Missing message for key xx. xx. xx

Probable causes
The value pair of this key is not defined in the resource file applicationresources. properties. If you often encounter this situation when using eclipse, eclipse will automatically delete the resource files under the classes directory when the project is re-compiled.

The resource file applicationresources. properties should not put the resource file in the WEB-INF/classes directory in classpath, of course it should be defined in the struts-config.xml)
Bytes -----------------------------------------------------------------------------------------------------------------
Exception
Cannot find Message Resources under key org. Apache. Struts. Action. Message

Possible causes
Obviously, this error occurs when the resource file is used, and struts does not find the resource file.

Implicitly trying to use message resources that are not available (such as using empty HTML: Options tag instead of specifyingthe options in its body -- This assumes options are specified in applicationresources. properties file)

XML Parser issues -- too records, too few, incorrect/incompatible versions
Bytes -----------------------------------------------------------------------------------------------------------------
Exception
Strange and seemingly random characters in HTML and on screen, but not in original JSP or servlet.

Possible causes
The HTML: Form tag and standard HTML tag used in combination with struts are incorrect.

The encoding style used is not supported on this page.
Bytes -----------------------------------------------------------------------------------------------------------------
Exception
"Document contained no data" in Netscape

No data rendered (completely empty) page in Microsoft Internet Explorer

Possible causes
Use a derived class of an action without implementing the perform () method or the execute () method. In struts1.0, The perform () method is implemented. In struts1.1, The execute () method is implemented, but struts1.1 is backward compatible with the perform () method. However, you use struts1.1 to create an action derived class and implement the execute () method. If you run it in struts1.0, you will get the "document contained nodata" error message in Netscape or a completely
Error message for empty (no HTML whatsoever) page rendered in Microsoft Internet Explorer.

Bytes ---------------------------------------------------------------------------------------------------------------------------
Exception
Servletexception: beanutils. populate
Solution
When uploading files with Struts, A javax. servlet. servletexception: beanutils. populate exception occurs.
Beanutils is not used in my actionservlet. Later, I checked the code and found that the form in the JSP file forgot to add enctype = & amp; quot; multipart/form-Data & quot. Therefore, when a program encounters an error or exception, you should consider the possibility of the problem from many aspects and think of something other than the system prompts.
Bytes ----------------------------------------------------------------------------------------------------------------------------
1. after an action is defined, if the name is specified, a formbean with the same name must be defined before form ing can be performed. 2. if "No INPUT attribute for mapping path... "error, You need to define the page for turning in its INPUT attribute. 3. if "batch update row count wrong :... "error, indicating XXX. HBM. the type of the key specified in XML is the original type (INT, long), because the value is automatically assigned for this type,
This value often makes the system think that the record already exists. The correct method is to use Java. lang. integer or Java. lang. long object. 4. if the "argument Type mismatch" error occurs during data insertion, you may have used special objects such as date, because struts cannot automatically convert the string type to the date type, you need to manually convert string type to date type in action. 5. in hibernate, The iterator () of query is much faster than the list () method. 6. if "equal symbol expected" is displayed"
The strtus tag contains another tag or variable, for example:
<HTML: Select Property = "test" onchange = "<% = test %>"/>
Or
<HTML: hidden property = "test" value = "<Bean: write name =" T "property =" p "/>"/>
This situation...
Bytes ---------------------------------------------------------------------------------------------------------------------------
Error: exception in thread "Main" org. hibernate. exception. sqlgrammarexception: Cause and solution of cocould not execute JDBC batch update: it is generated by hibernate tools (or the Database Explorer of eclipse *. hbn. the XML tool contains an attribute such as catalog = "***" (* indicates the database name). You can delete this attribute.
Bytes ---------------------------------------------------------------------------------------------------------------------------
Error: org. hibernate. objectdeletedexception: Deleted Object wocould be re-Saved by cascade (remove deleted object from associations)
Cause and solution:
Method 1 Delete the cascade of the set side
Method 2 Delete the link after it is resolved
Method 3: Add cascade in sequence-to-one, but the value cannot be none.
Last move:
Check if hashcode equals uses ID as the unique identifier. I use UUID. HEX, but native is not used. What should I do? Delete!
Bytes ----------------------------------------------------------------------------------------------------------------------------
Problem: Tomcat 5.5.12 is used today, and it is found that a very useful system is unavailable. repeated tests show that the page cannot contain taglib. Otherwise, the following prompt is displayed: HTTP status 500-type exception reportmessage description the server encountered an internal error () that prevented it from fulfilling this request. predictionorg. apache. jasper. jasperexception:
/Index. JSP (1, 1) unable to read TLD "META-INF/TLDs/struts-bean.tld" from JAR file "file: ***/WEB-INF/lib/struts. jar ": cause: the jar in the Lib folder of the Project is updated, and the servlet is also released at the time of release. jar and jsp-api.jar. Solution: remove the jsp-api.jar to solve this problem. Bytes -----------------------------------------------------------------------------------------------------------------------------
Error: Java. Lang. nullpointerexception
Cause: the DaO instance, manage instance, and other things to be injected have not been injected (commonly known as a null pointer exception) solved: at this time, you should view the log file; the default is the log file of the application server. For example, Tomcat is the [tomcat installation directory]/logs. You will find the prompt: Org. springframework. beans. factory. beancreationexception: Error creating bean with name 'sf 'defined in servletcontextresource [/WEB-INF/applicationcontext. XML]:
Initialization of bean failed; Nested exception isorg. hibernate. hibernateexception: cocould not configure from URL: file: src/hibernate. cfg. xmlorg. hibernate. hibernateexception: cocould not configure from URL: file: src/hibernate. cfg. XML ............................ Caused by: Java. Io. filenotfoundexception:
SRC \ hibernate. cfg. XML may be: Org. springframework. beans. factory. beancreationexception: Error creating bean with name 'sessionfactory 'defined inservletcontext resource [/WEB-INF/applicationcontext. XML]: initialization of bean failed; Nested exception isorg. hibernate. mappingexception:
Resource: COM/MCC/coupon/model/userrole. HBM. XML not foundorg. hibernate. mappingexception: Resource: COM/MCC/coupon/model/userrole. HBM. XML not found then you will know the reason is that the parsing of the configuration file is incorrect, which cannot be seen through the web page. What's more is the error of the persistent shadow file, which causes the file to be not parsed. Of course, the functions you need cannot be used.
Bytes ----------------------------------------------------------------------------------------------------------------------------
Error: standardwrappervalve [action]: servlet. Service () for servlet action threw exception
Javax. servlet. jsp. jspexception: cannot retrieve mapping for action/settlementtypemanage
Or: Type Status Report Message servlet action is not available description the requested resource (servlet action is not available) is not available.
Cause: Same as above
Bytes ----------------------------------------------------------------------------------------------------------------------------
Error standardwrappervalve [JSP]: servlet. Service () for servlet JSP threw exceptionjava. Lang. classnotfoundexception: org. Apache. Struts. taglib. Bean. cookietei interface error details:
Org. Apache. Jasper. jasperexception: failed to load or instantiate tagextrainfo class: org. Apache. Struts. taglib. Bean. cookietei
Cause and solution: <solution 1> the tag starting with "HTML:" is not placed in <HTML: Form> <solution 2> restart your application server, no such problem automatically

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.