You are on page 1of 10

Explanations of common Java exceptions

http://rymden.nu/exceptions.html#IndexOut
OfBoundsException
java.lang
You are trying to use your computer to solve a
ArithmeticException mathematical problem that you cannot solve yourself.
Read up on your arithmetics and try again.
See IndexOutOfBoundsException. The difference is that
ArrayIndexOutOfBoundsException
this exception refers to more than one finger.
You have used all your arrays and need to buy more from
ArrayStoreException
the array store.
You need to stay in the class or caste you were born into.
Java will not accept dailits acting as kshatriyas or
noblemen pretending to be working class. Note the
ClassCastException
spelling mistake (of caste) that was introduced in Java
1.0 and has not been corrected for backwards
compatability reasons.
You seem to have invented your own class. There are
also caste systems that are not yet implemented in Java,
ClassNotFoundException
most notibly the balinese caste system. For example, if
you are a wesia, use the indian counterpart vaishya.
You are a clone. Find the original you, tell him what you
CloneNotSupportedException
want to do and then kill yourself.
You are a burgler that are running a Java program during
IllegalAccessException a burglery. Please finish stealing the computer, leave the
premises and try again.
IllegalArgumentException You have tried to protest against a previous exception.
IllegalMonitorStateException Please turn your computer screen back on.
You come from a state that is not yet recognized by the
IllegalStateException UN, possibly Kurdistan or Palestine. Get a real
citizenship, recompile your java code and try again.
One of the screws in your computer is threaded the
IllegalThreadStateException
wrong way. Please contact your hardware vendor.
You have put your index finger in an unacceptable place.
IndexOutOfBoundsException
Reposition it and try again.
Not everything can happen instantly. Please be more
InstantiationException
patient.
Tell your colleagues, room-mates etc. to leave you alone
InterruptedException
while you are working.
You have created an array with negative size. This can
cause information to be lost and in the long run the
NegativeArraySizeException
Universe will be destroyed. Be happy that Java noticed
what you were doing and DON'T DO IT AGAIN.
You are trying to have a picknick on a field that does not
exist. You can also get this exception if you try to visit an
NoSuchFieldException airfield that in fact does exist, but has been classified as
top-secret. I'd give you examples, but then I'd have to kill
you.
Don't use that method! Please, do things like we have
NoSuchMethodException
always done.
You do not own a dog. Get one, for example a brittany
NullPointerException
spaniel, and try again.
You are using outdated units of measurement, for
example inches or pints. Convert to SI. There is a known
NumberFormatException
bug that causes this exception to be thrown if you are
very short or tall.
You cannot run fast enough, possibly due to obesity.
RuntimeException
Turn off your computer and go out and get som exercise.
You have been deemed a threat to nationaly security.
SecurityException Please sit still and wait for the authorities to come and
get you.
Your panties have shiften out of place. Adjust them and
StringIndexOutOfBoundsException try again. You can also get this exception if you are not
wearing any panties at all.
You are trying to have an operation that for som reason,
ethical or otherwise, is not supported by Java. Examples
UnsupportedOperationException of this include unneeded amputations, for example
circumcisions. Please stop abusing your body and do not
remove pieces of you child, damn it!

java.util
Someone else has modified your Java code. You
ConcurrentModificationException
should probably change your password.
EmptyStackException In order for Java to work, you must have a stack
of Java books on your desk. Actually, one is
enough if it is really thick.
You are too poor to be using Java. Switch to a
MissingResourceException cheaper language (such as Whitespace,
Shakespeare, Cow, Spaghetti or C#).
There are only four elements (earth, water, air,
NoSuchElementException
fire). The Fifth Element is just a movie.
You are bugged by too many secret
TooManyListenersException
organizations. Expect a SecurityException soon.

java.awt
You are using AWT, which means your GUI will
AWTException be ugly. This exception is only a warning and can
be ignored.
Your layout is ugly, or you have selected a bad
FontFormatException font, or too many fonts. Please consult a
professional designer.
Java thinks you are too stupid to be a
HeadlessException
programmer.
One of your hardware components (e.g.
IllegalComponentStateException harddrive, CPU, RAM) is broken. Please contact
your hardware vendor.

java.awt.color
Your CMM is broken. What ever the hell that is. I usually
CMMException
burn my house down and move to a new city to start over.
Your personal profile contains suspicious information. If you
ProfileDataException are not a communist, terrorist, atheist etc., please contact the
CIA to correct the mistake.

java.awt.datatransfer
You are a bad mime. Noone can understand what you
MimeTypeParseException are trying to express. Try something simpler, like
walking-against-the-wind och being-trapped-in-an-
invisible-box.
You are trying to use a flavor that is unknown to
UnsupportedFlavorException Java. Most people seem to get by using only vanilla
and cherry.

java.beans
You are too introverted. Be more extroverted. Stop being
IntrospectionException
such a nerd and go out and meet some people!
One of your properties has been vetoed. The message
PropertyVetoException should inform you of who did it and why. If it does not, you
probably shouldn't ask.

java.io
You have been trying to incinerate something
CharConversionException noncombustible. It is also possible that you have
tried turning yourself into a fish, but that's rare.
You get this exception because you don't know
EOFException what EOF stands for. Well, I'm not going to tell
you, Mr Ignoramus.
A carpenter should always know where his tools
FileNotFoundException
are.
You have been using IO despite of an
InterruptedIOException earlier IOException and your activities have been
interrupted.
InvalidClassException See ClassNotFoundException.
InvalidObjectException Objection overruled, as they say in court.
IO stands for input/output and has to do with
IOException sending and recieving data. IO is a security
problem and should not be used.
This can mean two things. Either something is
inactive and needs to be active, or something is
NotActiveException
active and needs to be inactive. Activate and
inactivate things randomly until things work.
NotSerializableException You are trying to make a TV series based on a
movie.
You have issued a stream of objections. Please
limit yourself to one at a time and wait for the
ObjectStreamException
judge to make a ruling before issuing a new one.
See InvalidObjectException.
You seem to think that some optional data is
OptionalDataException
required. Don't make things harder than they are.
Your data stream is corrupted, which means that it
StreamCorruptedException has been stealing packages and selling them on
the black market.
You have tried to synchronize your failures with
someone else and you have turned out to be a
SyncFailedException
bigger failure that that person. Try to find
someone on your own level.
If you want to send something coded over the
network, you have to file your encryption key
with the NSA. If you don't, you will be regarded
UnsupportedEncodingException
as a terrorist and dealt with in the appropriate
way. If you get this exception, you should run
away very fast indeed.
UTF stands for Universal Transmission Format
and is a way of transmitting data that works
UTFDataFormatException regardless of which format you use. You have
tried to transmit data over UTF using the wrong
format.
You need to write the word "aborted" somewhere
WriteAbortedException in your program. It usually doesn't matter where,
you just have to do it.

java.net
BindException Java programming and bondage don't mix.
You are trying to connect something to something it
cannot be connected to. Try to connect it to something
ConnectException else. Perhaps it is possible to connect your things to
eachother via a special connection object that connects
to both ends of your desired connection.
You are making an urn and either it has the wrong
MalformedURLException shape (e.g. an "L" shape) or you have misspelled the
word "urn" (e.g. "url").
There is no route to the host. Contact the Road
NoRouteToHostException
Administration.
Ports and harbors must be placed right next to a water
PortUnreachableException
body. If placed inland, they will be unreachable.
This is the result of a serious breach of etiquette (such
ProtocolException as pukíng on your host). The solution is simple: Don't
do that!
You have connected your computer to a power outlet of
the wrong kind. Most of the times you have to find
SocketException
another outlet, but some computers have a switch on the
back where you can set the power outlet type.
You have connected your computer a power outlet with
SocketTimeoutException a timer and the time has run out. Such outlets should
only be used for flat-irons and similar things.
UnknownHostException Didn't your parents teach you to not talk to strangers?
You are trying to access an unknown service. The most
UnknownServiceException
known unknown service is perhaps Secret Service.
The sentence "You are I" is not syntactically correct.
URISyntaxException Change it to "You are me". What ever the hell that
means.

java.rmi
AccessException You are using Microsoft Access. Please don't.
Despite what is stated in the description of
java.net.BindException, RMI does support bondage.
AlreadyBoundException
However, you cannot tie up someone that is already
bound.
You are trying to connect something to something it
cannot be connected to. Try to connect it to something
ConnectException else. Perhaps it is possible to connect your things to
eachother via a special connection object that connects to
both ends of your desired connection.
You are trying to connect something that has to do with
IO to something it cannot be connected to. Try to connect
ConnectIOException it to something else. Perhaps it is possible to connect your
things to eachother via a special connection object that
connects to both ends of your desired connection.
Something is wrong with your marshal. What you should
do depends on what kind of marshal we are talking about.
It can be a field marshal, police, firefighter or just your
MarshalException
ordinary basic marshal. Note that this exception has
nothing to do with the Republic of the Marshall Islands,
a.k.a. RMI.
You are trying to use an object that does not exist. Create
NoSuchObjectException
it or don't use it, Einstein!
If you are using bondage, please make sure that at least
NotBoundException
one person is tied up.
This is a special exception that is thrown remotely. If
someone else's application has become so instable that it
RemoteException can't even produce an exception, then you may get the
exception instead. Please find the source and inform that
programmer of the error.
The Republic of the Marshall Islands has become
instable. If you live there, you should probably leave and
RMISecurityException
don't come back until your security can be guaranteed. If
you live elsewhere, you can ignore this exception.
ServerException Second serve. (Or double fault if applicable.)
Tennis matches are long enough as it is. You will get this
ServerRuntimeException
exception if you take too long to serve.
When you go to the movies, you should always keep your
stub. If you don't, and also leave the theater, you will not
StubNotFoundException
be let back in and you may have to buy a new ticket. So,
KEEP YOUR STUB!
This exception should come as a total surprise to you. If it
UnexpectedException
did, everything is as it should be.
UnknownHostException Didn't your parents teach you to not talk to strangers?
You have not fullfilled your duties as an officer of the law
UnmarshalException (or whatever marshal you used to work as). Note that the
correct term is "used to". You have been fired (which is
really ironic if you were a firefighter).

java.security
You have lost control of Microsoft Access.
If you cannot regain control or stop the
AccessControlException program in some other way, you should cut
the power to your computer as fast as
possible.
You should be careful with what you eat.
DigestException
Indigestion can be a serious problem.
Something somewhere appears to be unsafe.
If you have the power to do so, you should
GeneralSecurityException invade a random country (preferably in the
middle east). If you do not have such power,
you should at least get a gun.
You have explained your algorithm to a
disabled person in a way that is not suited to
InvalidAlgorithmParameterException
that person's level of understanding. Keep it
simple!
There are two rather different reasons for
this exception: 1. You are using the wrong
key. My advice is to paint small dots in
different colors on your keys to help you
InvalidKeyException remember which one is for which lock. 2.
You are not allowed to lock up disabled
people without giving them a key. If they
are smart enough to figure out how to use it,
they have a right to move freely.
You have used a disparaging term to
InvalidParameterException
describe a disabled person.
KeyException Do not try to unlock locks without a key.
You have lost your key. Most likely you left
it at the office (if you're trying to enter your
KeyManagementException
home) or at home (if you're trying to enter
the office).
KeyStoreException The explanation for the
previous KeyManagementException is that
there is a hole in your pocket.
You are trying to solve a problem in a
previously unknown way. Stop being so
damn creative and rewrite your program
NoSuchAlgorithmException
using old algorithms. You can also patent
your idea and wait for it to be incorporated
into a future Java release.
If you are a single mom, you cannot be a
NoSuchProviderException housewife. First, you need to get a provider
for your family.
You have tried to take an action that you do
not have the privilege to take. For example,
getting away with murder is something that
only famous people can do, child
PrivilegedActionException
molestation is only for catholic priests and
high ranking jehova's witnesses, and only
people with managerial positions in private
corporations are allowed to steal money.
You are a woman and are trying to be the
provider of a family. Obviously, your
husband cannot be a housewife, so you need
ProviderException to let him do the providing. Thinking that
Java is old-fashioned will not change
reality. This is how things work. Deal with
it.
Either you have forged someone else's
signature, or your signature unacceptable. A
SignatureException
signature cannot be too ugly, too readable or
too large.
Damn. You dropped your key down a drain.
The only comfort I can offer is that the key
UnrecoverableKeyException should be unrecoverable for other people as
well, so it may not be necessary to change
your locks.

java.text
ParseException You are not making any sense. Calm down and try again.

You might also like