Examples of AgentException


Examples of com.sun.enterprise.ee.admin.servermgmt.AgentException

        // make sure instance exists to start it
        if (!instanceExists(instanceName)) {
            // instance doesn't exist, this could be caused by a sync error
            // with the nodeagent so it doesn't know to create the instance
            // and then someone tries to start or stop it
            throw new AgentException(_strMgr.getString(
                "nodeAgent.instanceDoesNotExist", instanceName));
        }

        checkOnInstanceIsStarted(instanceName);
       
        try {          
            //beginning instance stopping
            InstanceStatus.getInstance().updateStatus(
                instanceName, Status.kInstanceStoppingCode);
            // stop instance and remove it from the ProcessManager
            if (!ProcessManager.getInstance().processExists(instanceName)){
                // create the process so it can be stopped this solves the
                // case of an instance being started outside the NA, like call
                // startserv script directly or NA reconvery from failure.
                // watchdogging can not be done, because associated process
                // can not be recaptured
                ProcessManager.getInstance().addProcessInstance(instanceName,
                                    new ProcessInstanceInternal(instanceName));
            }

            if (!force)  {
                ProcessManager.getInstance().stopProcess(instanceName);       
            } else {
                ProcessManager.getInstance().stopProcess(instanceName, timeout);
            }
            ProcessManager.getInstance().removeProcessInstance(instanceName);
            //instance successfully stopped
            InstanceStatus.getInstance().updateStatusFromAdminChannel(
                instanceName, Status.kInstanceNotRunningCode);
        } catch (Exception e) {
            //stop failed. We mark the instance running so that the user can
            //attempt to issue the stop a second time..
            InstanceStatus.getInstance().updateStatusFromAdminChannel(
                instanceName, Status.kInstanceRunningCode);
            ProcessInstance pInstance =
                ProcessManager.getInstance().getProcess(instanceName);
            if (pInstance !=null) pInstance.setStopping(false);
            StringManagerBase sm = StringManagerBase.getStringManager(
                                   getLogger().getResourceBundleName())
            getLogger().log(Level.WARNING, sm.getString(
                "nodeagent.stop.instance.exception", instanceName), e);            
            throw new AgentException(e);
        }   
    }
View Full Code Here

Examples of com.sun.enterprise.ee.admin.servermgmt.AgentException

        } catch (Exception ex) {
            StringManagerBase sm = StringManagerBase.getStringManager(
                getLogger().getResourceBundleName())
            getLogger().log(Level.INFO, sm.getString(
                "nodeagent.getStatus.exception", getNodeAgentName()), ex);            
            throw new AgentException(ex);
        }
    }           
View Full Code Here

Examples of com.sun.enterprise.ee.admin.servermgmt.AgentException

            // remove default log file from path
            logDir=logDir.substring(0, logDir.lastIndexOf("/"));
            getLogger().log(Level.FINE, "Log directory of component " +
                                        componentName + " - " + logDir);
        } catch (Exception e) {
            throw new AgentException(e);
        }
        return logDir;
    }
View Full Code Here

Examples of com.sun.enterprise.ee.admin.servermgmt.AgentException

            return LogMBean.getInstance().getLogRecordsUsingQuery(logFile,
                    fromRecord, next, forward, requestedCount, fromDate, toDate,
                    logLevel, onlyLevel, listOfModules, nameValueMap);
        } catch (Exception e) {
            throw new AgentException(e);
        }
    }
View Full Code Here

Examples of com.sun.enterprise.ee.admin.servermgmt.AgentException

                        new Object[] {newHost, newPort});
            writeToDASPropertyReader(newHost, newPort);
            setJMXConnectorInfo(newHost, newPort);
            cleanCachedConnectionToDAS();
        } catch (IOException ex) {
            throw new AgentException(ex);
        } catch (ConfigException ex) {
            throw new AgentException(ex);
        } catch (InstanceException ex) {
            throw new AgentException(ex);
        }
    }
View Full Code Here

Examples of com.sun.enterprise.ee.admin.servermgmt.AgentException

            // make sure instance exists
            if (!instanceExists(componentName)) {
                // instance doesn't exist, this could be caused by a sync error
                // with the nodeagent so it doesn't know to create the instance
                // and then someone tries to start or stop it
                throw new AgentException(_strMgr.getString(
                    "nodeAgent.instanceDoesNotExist", componentName));
            }
            // create log prefix
            String logFileX = "";
            String logPrefix = getNodeAgentConfig().getRepositoryRoot() + "/" +
View Full Code Here

Examples of com.sun.enterprise.ee.admin.servermgmt.AgentException

                }
               
            } catch (Exception e) {
                getLogger().log(Level.WARNING,
                                "nodeagent.synchronization.Exception",e);
                throw new AgentException(e);
            }       
        } else {
            // not bound
            getLogger().log(Level.FINE,
                            "Error on Synchronization, NodeAgent is not bound");
            throw new AgentException(
                    _strMgr.getString("nodeAgent.unboundSyncError"));
        }          
        return createdInstances;
    }           
View Full Code Here

Examples of com.sun.enterprise.ee.admin.servermgmt.AgentException

            String msg =
                sm.getString("nodeagent.couldNotStartInstance", instanceName,
                             InstanceStatus.getInstance().getStatus(
                                instanceName).getStatus().getStatusString());
            getLogger().log(Level.WARNING, msg);               
            throw new AgentException(msg);
        }
    }
View Full Code Here

Examples of com.sun.enterprise.ee.admin.servermgmt.AgentException

            // make sure instance exists to start it
            if (!instanceExists(instanceName)) {
                // instance doesn't exist, this could be caused by a sync error
                // with the nodeagent so it doesn't know to create the instance
                // and then someone tries to start or stop it
                throw new AgentException(_strMgr.getString(
                        "nodeAgent.instanceDoesNotExist", instanceName));
            }       
            //Ensure that the instance is in a stopped state before starting it.
            ensureInstanceIsStopped(instanceName, synchronizeInstance);       
            if (synchronizeInstance)  {           
                try {
                    //beginning instance synchronization
                    InstanceStatus.getInstance().updateStatus(
                        instanceName, Status.kInstanceSynchronizingCode);
                    // synchronise of behalf of the instance, should only be done
                    // on direct start invocation
                    getLogger().log(Level.INFO,
                        "NodeAgent synchronizing for instance", instanceName);
                    synchronizeInstanceWithDAS(instanceName);
                } catch (AgentException ae) {
                    //synchronization failed
                    InstanceStatus.getInstance().updateStatusFromAdminChannel(
                        instanceName, Status.kInstanceNotRunningCode);
                    // need to throw exception so start-instance command show
                    // proper error and fails
                   
                    debug("ERROR IN SYNCHRONIZATION!!!! " + ae);
                   
                    throw ae;
                }
            }
            debug("Release Lock: " + instanceName);
        }

        // there was no sync or it succeeded
        try {               
            //beginning instance startup
            debug("Getting ready to have ProcessManger start the instance: " + instanceName);
            InstanceStatus.getInstance().updateStatus(
                instanceName, Status.kInstanceStartingCode);                          
            // always start when asked (not checking for now)
            // add instance to ProcessManager & start it
            ProcessManager.getInstance().addProcessInstance(instanceName,
                new ProcessInstanceInternal(instanceName));
            ProcessManager.getInstance().startProcess(instanceName);
            //startup succeeded
            InstanceStatus.getInstance().updateStatusFromAdminChannel(
                instanceName, Status.kInstanceRunningCode);  
        } catch (Exception e) {
            //startup failed. We put the instance in a not running state so that
            // the user can attempt to start it again.
            InstanceStatus.getInstance().updateStatusFromAdminChannel(
                instanceName, Status.kInstanceNotRunningCode);                 
            StringManagerBase sm = StringManagerBase.getStringManager(
                getLogger().getResourceBundleName())
            getLogger().log(Level.WARNING,
              sm.getString("nodeagent.start.instance.exception", instanceName), e);                 
            throw new AgentException(e);
        }
    }
View Full Code Here

Examples of com.sun.enterprise.ee.admin.servermgmt.AgentException

                    // don't stop creation loop, so just keep looping
                    // this was only a fail safe on restart
                }
            }
        } catch (Exception e) {
            throw new AgentException(e);
        }
        return createdInstances;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.