The exceptions that can be thrown are split into user and
system categories.
If your problem is related to the ORB, unless your application
is doing nothing or giving you the wrong result, your log file or
terminal is probably full of exceptions that include the words "CORBA" and "rmi" many
times. All unusual behavior that occurs in a good application is highlighted
by an exception. This principle also applies for the
ORB with its CORBA exceptions. Similarly to Java™,
CORBA divides its exceptions into user exceptions and system exceptions.
User exceptions
User exceptions are
IDL defined and inherit from org.omg.CORBA.UserException. These exceptions
are mapped to checked exceptions in Java;
that is, if a remote method raises one of them, the application that
called that method must catch the exception. User exceptions are usually
not fatal exceptions and should always be handled by the application.
Therefore, if you get one of these user exceptions, you know where
the problem is, because the application developer had to make allowance
for such an exception to occur. In most of these cases, the ORB is
not the source of the problem.
System exceptions
System exceptions
are thrown transparently to the application and represent an unusual
condition in which the ORB cannot recover gracefully, such as when
a connection is dropped. The CORBA 2.6 specification defines 31 system
exceptions and their mapping to Java.
They all belong to the org.omg.CORBA package. The CORBA specification
defines the meaning of these exceptions and describes the conditions
in which they are thrown.
The most common system exceptions
are:
- BAD_OPERATION: This
exception is thrown when an object reference denotes an existing object,
but the object does not support the operation that was called.
- BAD_PARAM: This
exception is thrown when a parameter that is passed to a call is out
of range or otherwise considered not valid. An ORB might raise this
exception if null values or null pointers are passed to an operation.
- COMM_FAILURE: This
exception is raised if communication is lost while an operation is
in progress, after the request was sent by the client, but before
the reply from the server has been returned to the client.
- DATA_CONVERSION: This
exception is raised if an ORB cannot convert the marshaled representation
of data into its native representation, or cannot convert the native
representation of data into its marshaled representation. For example,
this exception can be raised if wide character codeset conversion
fails, or if an ORB cannot convert floating point values between different
representations.
- MARSHAL: This
exception indicates that the request or reply from the network is
structurally not valid. This error typically indicates a bug in either
the client-side or server-side runtime. For example, if a reply from
the server indicates that the message contains 1000 bytes, but the
actual message is shorter or longer than 1000 bytes, the ORB raises
this exception.
- NO_IMPLEMENT: This
exception indicates that although the operation that was called exists
(it has an IDL definition), no implementation exists for that operation.
- UNKNOWN: This
exception is raised if an implementation throws a non-CORBA exception,
such as an exception that is specific to the implementation's programming
language. It is also raised if the server returns a system exception
that is unknown to the client. If the server uses a later version
of CORBA than the version that the client is using, and new system
exceptions have been added to the later version this exception can
happen.