Server activation failure is usually indicated by the receipt of a NoEndpointException. This can happen for a number of reasons, but the most likely cause is an incorrect configuration. For example, an IceGrid node may fail to activate a server because the server’s executable file, shared libraries, or classes could not be found. There are several steps you can take in this case:
Another cause of activation failure is a server fault during startup. After you have confirmed that the node successfully spawns the server process using the steps above, you should then check for signs of a server fault (e.g., on Unix, look for a
core file in the node’s current working directory). See
Section 35.25.3 for more information on server failures.
A client may receive Ice::NotRegisteredException if binding fails for an indirect proxy (see
Section 28.17.2). This exception indicates that the proxy’s object identity or object adapter is not known by the IceGrid registry. The following steps may help you discover the cause of the exception:
1. Use icegridadmin (see
Section 35.23.1) to verify that the object identity or object adapter identifier is actually registered, and that it matches what is used by the proxy:
>>> adapter list
...
>>>
object find ::Hello
...
3.
Run the server in a debugger; a server configured for automatic activation can also be started manually if necessary. However, since the IceGrid node did not activate the server, it cannot monitor the server process and therefore will not know when the server terminates. This will prevent subsequent activation unless you clean up the IceGrid state when you have finished debugging and terminated the server. You can do this by starting the server using
icegridadmin (see
Section 35.23.1):
>>> server start TheServer
Another cause for a server to fail to activate correctly is if there is a mismatch in the adapter names used by the server for its adapters, and the adapter names specified in the server’s deployment descriptor. After starting a server process, the node waits for the server to activate all its object adapters and report them as ready; if the server does not do this, the node reports a failure once a timeout expires. The timeout is controlled by the setting of the property
IceGrid.Node.WaitTime. (The default value is 60 seconds.)
You can check the status of each of a server’s adapters using icegridadmin or the GUI tool. While the node waits for an adapter to be activated by the server, it reports the status of the adapter as "activating". If you experience timeouts before each adapter’s status changes to "active", the most likely cause is that the deployment descriptor for the server either mentions more object adapters than are actually created by the server, or that the server uses a name for one or more adapters that does not match the corresponding name in the deployment descriptor.
You may find it necessary to disable a server that terminates in an error condition. For example, on a Unix platform each server failure might result in the creation of a new (and potentially quite large) core file. This problem is exacerbated when the server is used frequently, in which case repeated cycles of activation and failure can consume a great deal of disk space and threaten the viability of the application as a whole.
As a defensive measure, you can configure an IceGrid node to disable these servers automatically using the
IceGrid.Node.DisableOnFailure property. In the disabled state, a server cannot be activated on demand. The default value of the property is zero, meaning the node does not disable a server that terminates improperly. A positive value causes the node to temporarily disable a faulty server, with the value representing the number of seconds the server should remain disabled. If the property has a negative value, the server is disabled indefinitely, or until the server is explicitly enabled or started via an administrative action.