Monday, November 26, 2012

CORBA exceptions for normal people :-)


information collect from http://techpubs.borland.com/am/bes/v6/en/updates/except_cpp.html

CORBA exceptions

This section provides information about CORBA exceptions that can be thrown by the VisiBroker ORB, and explains possible causes for VisiBroker throwing them.

CORBA exception descriptions

The following table lists CORBA exceptions, and explains reasons why the VisiBroker ORB might throw them.
Exception Explanation Possible causes
CORBA::BAD_CONTEXT An invalid context has been passed to the server. An operation may raise this exception if a client invokes the operation, but the passed context does not contain the context values required by the operation.
CORBA::BAD_INV_ORDER The necessary prerequisite operations have not been called prior to the offending operation request. An attempt to call theCORBA::Request::get_response() orCORBA::Request::poll_response() methods may have occurred prior to actually sending the request. An attempt to call theexception::get_client_info() method may have occurred outside of the implementation of a remote method invocation. This function is only valid within the implementation of a remote invocation. An operation was called on the VisiBroker ORB that was already shut down.
CORBA::BAD_OPERATION An invalid operation has been performed. A server throws this exception if a request is received for an operation that is not defined on that implementation's interface. Ensure that the client and server were compiled from the same IDL. The CORBA::Request::return_value() method throws this exception if the request was not set to have a return value. If a return value is expected when making a DII call, be sure to set the return value type by calling the CORBA::Request::set_return_type() method.
CORBA::BAD_PARAM A parameter passed to the VisiBroker ORB is invalid. Sequences throw CORBA::BAD_PARAM if an access is attempted to an invalid index. Make sure you use the length() method to set the length of the sequence before storing or retrieving elements of the sequence.
The VisiBroker ORB throws this exception if an invalid Object_ptr is passed as an in argument; for example, if a nil reference is passed.
An attempt may have been made to send a NULL pointer where the IDL to C++ language mapping requires an initialized C++ object to be sent. For example, attempting to return NULL as a return value or out parameter from a method that should be returning a sequence will throw this exception. In this case a new sequence (probably of length 0) should be returned instead. The types which cannot be sent with the C++ NULL value include Any, Context, struct, or sequence.
An attempt may have been made to insert a nil object reference into an Any.
An attempt was made to send a value that is out of range for an enumerated data type.
An attempt may have been made to construct a TypeCode with an invalid kind value.
Using the DII and one way method invocations, an OUT argument may have been specified. An interface repository throws this exception if an argument passed into an IR object's operation conflicts with its existing settings. See the compiler errors for more information.
CORBA::BAD_QOS Quality of service cannot be supported. Can be raised whenever an object cannot support the quality of service required by an invocation parameter that has a quality of service semantics associated with it.
CORBA::BAD_TYPECODE The ORB has encountered a malformed type code.
CORBA::CODESET_INCOMPATIBLE Communication between client and server native code sets fails because the code sets are incompatible. The code sets used by the client and server cannot work together. For instance, the client uses ISO 8859-1 and the server uses the Japanese code set.
CORBA::COMM_FAILURE Communication is lost while an operation is in progress, after the request was sent by the client, but before the reply has been returned. An existing connection may have closed due to failure at the other end of the connection.
A new connection request may have failed due to resource limits on the client or server machine (the maximum number of connections has been reached).
When COMM_FAILURES occur due to system exceptions, the system error number is set in the minor code of the COMM_FAILURE. Check the minor code against the system-specific error numbers (for example, in the include/sys/errno.h or msdev\include\winerror.h files).
CORBA::DATA_CONVERSION The VisiBroker ORB cannot convert the representation of marshaled data into its native representation or vice-versa. An attempt to marshal Unicode characters withOutput.write_char() or Output.write_stringfails.
CORBA::FREE_MEM The VisiBroker ORB failed to free dynamic memory. The memory segments that the VisiBroker ORB is trying to free may be locked. The heap could be corrupt.
CORBA::IMP_LIMIT An implementation limit was exceeded in the VisiBroker ORB run time. The VisiBroker ORB may have reached the maximum number of references it can hold simultaneously in an address space. The size of the parameter may have exceeded the allowed maximum. The maximum number of running clients and servers has been exceeded.
CORBA::INITIALIZE A necessary initialization has not been performed. The ORB_init() method may not have been called. All clients must call the ORB_init() method prior to performing any VisiBroker ORB-related operations. This call is typically made immediately upon program startup at the top of the main routine.
CORBA::INTERNAL An internal VisiBroker ORB error has occurred. An internal VisiBroker ORB error may have occurred. For instance, the internal data structures of the VisiBroker ORB may have been corrupted.
CORBA::INTF_REPOS An instance of the Interface Repository could not be located. If an object implementation cannot locate an interface repository during an invocation of the get_interface() method, this exception will be thrown to the client. Ensure that an Interface Repository is running, and that the requested object's interface definition has been loaded into the Interface Repository.
CORBA::INV_FLAG An invalid flag was passed to an operation. A Dynamic Invocation Interface request was created with an invalid flag.
CORBA::INV_IDENT An IDL identifier is syntactically invalid. An identifier passed to the interface repository is not well formed. An illegal operation name is used with the Dynamic Invocation Interface.
CORBA::INV_OBJREF An invalid object reference has been encountered. The VisiBroker ORB will throw this exception if an object reference is obtained that contains no usable profiles. The ORB::string_to_object() method will throw this exception if the stringified object reference does not begin with the characters "IOR:".
CORBA::INV_POLICY An invalid policy override has been encountered. This exception can be thrown from any invocation. It can be raised when an invocation cannot be made due to an incompatibility between policy overrides that apply to the particular invocation.
CORBA::INVALID_TRANSACTION A request carried an invalid transaction context. This exception could be raised if an error occurred while trying to register a Resource.
CORBA::MARSHAL Error marshalling parameter or result. A request or reply from the network is structurally invalid. This error typically indicates a bug in either the client-side or server-side run time. 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 VisiBroker ORB raises this exception. A MARSHAL exception can also be caused by using the DII or DSI incorrectly. For example, if the type of the actual parameters sent does not agree with IDL signature of an operation.
CORBA::NO_IMPLEMENT The requested object could not be located. Indicates that even though the operation that was invoked exists (it has an IDL definition), no implementation for that operation exists. For example, a NO_IMPLEMENTATION is raised when a server doesn't exist or is not running when a client initiates a bind.
CORBA::NO_MEMORY The VisiBroker ORB runtime has run out of memory.
CORBA::NO_PERMISSION The caller has insufficient privileges to complete an invocation. The Object::get_implementation() and BOA::dispose() methods throw this exception if they are called on the client side. It is only valid to call these methods within the server that activated the object implementation.
An object other than the transaction originator has attempted Current::commit() or Current::rollback().
CORBA::NO_RESOURCES A necessary resource could not be acquired. If a new thread cannot be created, this exception will be thrown. A server will throw this exception when a remote client attempts to establish a connection if the server cannot create a socket--for example, if the server runs out of file descriptors. The minor code contains the system error number obtained after the server's failed ::socket() or ::accept() call. A client will similarly throw this exception if a ::connect() call fails due to running out of file descriptors. Running out of memory may also throw this exception.
CORBA::NO_RESPONSE A client attempts to retrieve the result of a deferred synchronous call, but the response for the request is not yet available. If BindOptions are used to set timeouts, this exception is raised when send and receive calls do not occur within the specified time.
CORBA::OBJ_ADAPTER An administrative mismatch has occurred. A server has attempted to register itself with an implementation repository under a name that is already in use, or is unknown to the repository. The POA has raised an OBJ_ADAPTER error due to problems with the application's servant managers.
CORBA::OBJECT_NOT_EXIST The requested object does not exist. A server throws this exception if an attempt is made to perform an operation on an implementation that does not exist within that server. This will be seen by the client when attempting to invoke operations on deactivated implementations. For instance, if an attempt to bind to an object fails, or an auto-rebind fails, OBJECT_NOT_EXIST will be raised
CORBA::PERSIST_STORE A persistent storage failure has occurred. Attempts to establish a connection to a database has failed, or the database is corrupt.
CORBA::REBIND The client has received an IOR which conflicts with QOS policies. Thrown anytime the client gets an IOR which will conflict with the QOS policies that have been set. If the Rebind Policy has a value of NO_REBIND,NO_CONNECT, or VB_NOTIFY_REBIND and an invocation on a bound object reference results in an object forward or a location forward message.
CORBA::TIMEOUT The VisiBroker ORB timed out an operation When attempting to establish a connection or waiting for a request/reply, if the operation does not complete before the specified time, a TIMEOUT exception is thrown.
CORBA::TRANSACTION_REQUIRED The request has a null transaction context, and an active transaction is required. A method was invoked that must execute as part of a transaction, but no transaction was active on the client thread.
CORBA::TRANSACTION_ROLLEDBACK The transaction associated with a request has already been rolled back, or marked for roll back. A requested operation could not be performed because the transaction has already been marked for rollback.
CORBA::TRANSACTION_MODE Raised by the VisiBroker ORB, when it detects a mismatch between the TransactionPolicy in the IOR and the current transaction mode.
CORBA::TRANSACTION_UNAVAILABLE Raised by the VisiBroker ORB, when it cannot process a transaction service context because its connection to the Transaction Service has been abnormally terminated.
CORBA::TRANSIENT An error has occurred, but the VisiBroker ORB believes it is possible to retry the operation. A communications failure may have occurred and the VisiBroker ORB is signalling that an attempt should be made to rebind to the server with which communications have failed. This exception will not occur if the BindOptions are set to false with the enable_rebind() method, or the RebindPolicy is properly set.
CORBA::UNKNOWN The VisiBroker ORB could not determine the thrown exception. The server throws something other than a correct exception, such as a Java runtime exception. There is an IDL mismatch between the server and the client, and the exception is not defined in the client program. In DII, if the server throws an exception not known to the client at the time of compilation and the client did not specify an exception list for the CORBA::Request. Set the property vbroker.orb.warn=2 on the server to see which runtime exception caused the problem.
CORBA::UnknownUser A user exception has been received, but the client has no compile-time knowledge of that exception. When a client reads in a user exception from a server, it will generate this exception if it has no compile-time knowledge of the exception type. The client can see the type of the exception, and is given the marshalled buffer containing the contents of the exception. The VisiBroker ORB has no way to unmarshal the exception on its own.


System exception Minor code Explanation
BAD_PARAM 1 Failure to register, unregister, or lookup the value factory
BAD_PARAM 2 RID already defined in the interface repository
BAD_PARAM 3 Name already used in the context in the interface repository
BAD_PARAM 4 Target is not a valid container
BAD_PARAM 5 Name clash in inherited context
BAD_PARAM 6 Incorrect type for abstract interface
MARSHAL 1 Unable to locate value factory
NO_IMPLEMENT 1 Missing local value implementation
NO_IMPLEMENT 2 Incompatible value implementation version
BAD_INV_ORDER 1 Dependency exists in the interface repository preventing the destruction of the object
BAD_INV_ORDER 2 Attempt to destroy indestructible objects in the interface repository
BAD_INV_ORDER 3 Operation would deadlock
BAD_INV_ORDER 4 VisiBroker ORB has shut down
OBJECT_NOT_EXIST 1 Attempt to pass a deactivated (unregistered) value as an object reference

Heuristic OMG-specified exceptions

A heuristic decision is a unilateral decision made by a participant in a transaction to commit or rollback updates without first obtaining the consensus outcome determined by the VisiTransact Transaction Service.
The following table lists heuristic exceptions as defined by the OMG CORBAservices specification, and explains reasons why they might be thrown.
Heuristic exceptions defined by the OMG CORBAservices specification
Exception Description Possible causes
CosTransactions::
HeuristicCommit
A heuristic decision was made and all relevant updates have been committed by the Resource. The VisiTransact Transaction Service invoked rollback() on a Resource object that already made a heuristic decision to commit its work. The Resource raises the HeuristicCommit exception to indicate its state to the VisiTransact Transaction Service.
CosTransactions::
HeuristicHazard
A Resource may or may not have made a heuristic decision, and does not know if all relevant updates have been made. For updates that are known, all have been committed or rolled back. This exception takes priority over HeuristicMixed. The VisiTransact Transaction Service invokes commit() or rollback() on a Resource object that may or may not have made a heuristic decision.

The Resource raises this exception to indicate to the VisiTransact Transaction Service that its own state is not entirely known. The VisiTransact Transaction Service returns this exception to the application if it does not know if all Resources have made updates.
CosTransactions::
HeuristicMixed
A heuristic decision was made, and some relevant updates have been committed, and others have been rolled back. The VisiTransact Transaction Service invokes commit() or rollback() on a Resource object that has made a heuristic decision, but not made all the relevant updates.

The Resource raises this exception to indicate to the VisiTransact Transaction Service that its state is not entirely consistent. The VisiTransact Transaction Service returns this exception to the application if it receives mixed responses from Resources.
CosTransactions::
HeuristicRollback
A heuristic decision was made and all relevant updates have been rolled back by the Resource. The VisiTransact Transaction Service invokes commit() on a Resource object that has made a heuristic decision to rollback its work. The Resource raises the HeuristicRollback exception to indicate its state to the VisiTransact Transaction Service.

Other OMG-specified exceptions

The following table lists other exceptions as defined by the OMG CORBAservices specification, and explains reasons why the VisiTransact Transaction Service might throw them.
Other exceptions defined by the OMG CORBAservices specification
Exception Description Possible causes
CosTransactions::Inactive The transaction has already been prepared or terminated. This exception could be raised if register_synchronization() is invoked after the transaction has already been prepared.
CosTransactions::InvalidControl An invalid Control has been passed. This exception is raised when resume() is invoked and the parameter is not a null object reference, and is also not valid in the current execution environment.
CosTransactions::NotPrepared A Resource has not been prepared. An invocation of replay_completion() or commit() on a Resource that has not yet prepared will result in this exception.
CosTransactions::NoTransaction No transaction is associated with the client thread. The commit(), rollback(), or rollback_only() methods may raise this exception if there is no transaction associated with the client thread at invocation.
CosTransactions::NotSubtransaction The current transaction is not a subtransaction. This exception is not raised by VisiTransact Transaction Manager since nested transactions are not supported. The NoTransaction exception is raised instead.
CosTransactions::
SubtransactionsUnavailable
The client thread already has an associated transaction. The VisiTransact Transaction Service does not support nested transactions. A subsequent begin() invocation was performed after a transaction was already begun. If your transactional object needs to operate within a transaction, it must first check to see if a transaction has already begun before invoking begin().

The create_subtransaction() method was invoked, but VisiTransact Transaction Manager does not support subtransactions.
CosTransactions::
SynchronizationUnavailable
The Coordinator does not support Synchronization objects. This exception is not raised by VisiTransact Transaction Manager since Synchronization objects are supported.
CosTransactions::Unavailable The requested object cannot be provided. The Control object cannot provide the Terminator or Coordinator objects when Control::get_terminator() or Control::get_coordinator() are invoked.

The VisiTransact Transaction Service restricts the availability of the PropagationContext, and will not return it upon an invocation of Coordinator::get_txcontext().
CORBA::WrongTransaction Raised by the ORB when returning the response to a deferred synchronous request. This exception can only be raised if the request is implicitly associated with the current transaction at the time the request was issued. The get_response() and get_next_response() methods may raise this exception if the transaction associated with the request is not the same as the transaction associated with the invoking thread.

No comments:

Post a Comment