Home > Java > javaTutorial > body text

Solutions to common runtime exceptions in Java

黄舟
Release: 2017-09-29 10:35:25
Original
3737 people have browsed it

ArithmeticException,: Arithmetic exception
ArrayStoreException, array storage exception
BufferOverflowException, coding error exception

Solution:

Use Eclipse to develop a java project, java.nio appears .BufferOverflowException error, I saw the solution to this method on the Internet at that time:

1. In eclipse, go to the project->Generate javadoc menu, and add in the Extra Javadoc options text box in the third dialog box -encoding UTF-8 parameter, this phenomenon disappears

2. Temporarily) In the regional and language options in the control panel, set the local language to English

3. Will enter Regarding the file, changing the data input into the background to all English can also be solved.


BufferUnderflowException, encoding problem
CannotRedoException,
CannotUndoException,
ClassCastException,: It is a runtime exception caused by the JVM when it detects that the conversion between two types is incompatible
CMMException, if the native CMM returns an error, this exception will be thrown
ConcurrentModificationException, if Vector and ArrayList are modified at the same time during iteration, an exception will be thrown
DOMException, the interface represents a handled error , when an operation is impossible to execute, an exception will be thrown
EmptyStackException, Empty stack exception
IllegalArgumentException, The location file cannot be found. And this was reported when the project started. So you need to check the tomcat configuration file
IllegalMonitorStateException. The exception occurs because the programmer did not pay attention to the usage conditions of notify(), notify(), and wait() methods, and did not truly understand the thread synchronization mechanism. This exception is thrown if the current thread is not the owner of this object's lock but calls the object's notify(), notify(), and wait() methods.
IllegalPathStateException,
IllegalStateException,

This exception indicates that the current response to the client has ended, and you cannot send another message to the

client after the response has ended (or died). Actually the buffer) outputs anything


ImagingOpException,

IndexOutOfBoundsException,array out-of-bounds exception
MissingResourceException,
NegativeArraySizeException,

usually because There is an error in form writing

The method should be post

and add ENCTYPE="multipart/form-data"

<form name="myForm" method="post" ENCTYPE="multipart/form-data" >
Copy after login

NoSuchElementException, iterator error
NullPointerException, empty Pointer exception
ProfileDataException,
ProviderException,
RasterFormatException,
SecurityException, insufficient permission

The above is the detailed content of Solutions to common runtime exceptions in Java. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template