Package com.sun.appserv.server

Examples of com.sun.appserv.server.ServerLifecycleException


        setInitializeOrbManager(false);
        super.onInitialization(context);
        try {
            server.setSystemAppLoader(new SystemAppLoader());
        } catch (Exception e) {
            throw new ServerLifecycleException(e);
        }
    }
View Full Code Here


                        throws ServerLifecycleException {
        super.onShutdown();
        try {
            sg.stop(null);
        } catch (Exception e) {
            throw new ServerLifecycleException(e);
        }
    }
View Full Code Here

            final InternalServicesList ondemandservices = new OnDemandServices();
            final String[][] servicesByName = services.getServicesByName();
            final String[][] odsByName = ondemandservices.getServicesByName();
            if (servicesByName == null) {
               _logger.log(Level.SEVERE, "services.null");
               throw new ServerLifecycleException();
            }

            final List<ServerLifecycle> serviceList = new ArrayList<ServerLifecycle>();

            // Instantiate service objects
            allServices :
            for (final String[] service : servicesByName) {
               for (final String[] ods : odsByName) {
                    if (service[0].equals(ods[0])) {
                        continue allServices;
                    }
               }
               try {
                   final ServerLifecycle serverLifecycle =
                    super.instantiateOneServerLifecycle( serverContext, service[1] );
                   serviceList.add( serverLifecycle );
               } catch (Exception ex) {
                   _logger.log(Level.SEVERE, "server.exception", ex);
                   throw new ServerLifecycleException(ex.getMessage());
               }
            }
            return serviceList;
        } else {
            return super.instantiateRuntimeServices( serverContext, defaultServices);
View Full Code Here

                        }
                        catch (Exception e) {
                            _logger.log(Level.INFO, "jms.broker_attach_failed");
                            _logger.log(Level.INFO,
                                "jms.broker_log_location", instanceName);
                            throw new ServerLifecycleException(e.getMessage(), e);
                        }
                        if (s.equals(instanceName)) {
                            // An iMQ broker instance with the same name
                            // is already running.  Since the instance
                            // names match, it is probably a broker
                            // process left behind by the application
                            // server. Treat it as if it was started by
                            // this application server process...
                            startedByMe_ = true;
                            _logger.log(Level.INFO, "jms.broker_found",
                                instanceName);
                        }
                        else {
                            startedByMe_ = false;
                            Object[] params = {s, portStr};
                            _logger.log(Level.SEVERE, "jms.broker_already_up",
                                params);
                            throw new ServerLifecycleException(
                                "JmsProviderLifecycle error.");
                        }
                    }
                    else {
                        _logger.fine("Starting JMS broker : imq-home=" + iMQBin +
                            ", stargArgs=" + tmpstr +
                            ", instanceName=" + instanceName);

                        try {
                            jmsAdmin_.startProvider(iMQBin,
                                startArgs, instanceName);
                        }
                        catch (Exception e) {
                            _logger.log(Level.INFO, "jms.broker_exec_failed");
                            _logger.log(Level.INFO,
                                "jms.broker_log_location", instanceName);
                            throw new ServerLifecycleException(e.getMessage(), e);
                        }


                    }
                }
            }
            catch (Exception e) {
                jmsService_ = null;
                _logger.log(Level.SEVERE, "jms.broker_startup_failed");

                // The exception will be logged at the outer level...

                throw new ServerLifecycleException(e.getMessage(), e);
            }
        }
    }
View Full Code Here

            e.printStackTrace();
            _logger.log(Level.INFO, "Failed to start or connect JMS RA");
            _logger.log(Level.INFO, "If MQ is configured as REMOTE and" +
                  " don't want to start MQ broker then set jvm-option " +
               "com.sun.enterprise.jms.DONT_CONNECT_MQ_IN_REMOTE_MODE to true");
            throw new ServerLifecycleException("Failed to start JMS RA", e);

        }
      
    }
View Full Code Here

  switch (startupStatus) {
      case NOTCHECKED    : break;
      case SUCCESSFUL    : return;
      case FAILED        :
           throw new ServerLifecycleException
     ("MQ startup failed :" + exception);
      case REMOTESTARTUP : return;
  }

  String iMQInstance =  System.getProperty(Constants.INSTALL_ROOT) +
                        java.io.File.separator + "imq" +
                        java.io.File.separator + "var" +
                        java.io.File.separator + "instances";

        String initTimeoutStr = null;
        long initTimeout = 30 * 1000;

        initTimeoutStr = jmsService_.getInitTimeoutInSeconds();

        if (initTimeoutStr != null)
            initTimeout = Integer.parseInt(initTimeoutStr) * 1000;

        Exception excp = null;
        try {
             waitForJmsProvider(initTimeout);
       startupStatus = SUCCESSFUL;
        }
        catch (javax.jms.JMSSecurityException e) {
      excp = e;

      // Provider is up and we have a wrong username and password
      // configured. We should shut this down. Recreate the admin
      // with defult user and password.
            startedByMe_ = true;
      try {
                jmsAdmin_ =
                    IASJmsUtil.getJMSAdminFactory().getJMSAdmin(url,
        IASJmsUtil.DEFAULT_USER,
        IASJmsUtil.DEFAULT_PASSWORD);
      } catch (Exception ex) {
      }
  }
        catch (Exception e1) {
      excp = e1;
        }

  if (excp != null) {
             startupStatus = FAILED;
             _logger.log(Level.INFO, "jms.broker_ping_failed",
                         Long.toString(initTimeout));
             _logger.log(Level.INFO,
                    "jms.broker_instance_dir", iMQInstance);
             _logger.log(Level.INFO,
                    "jms.broker_log_location",instanceName);
       exception = excp.getMessage();
             throw new ServerLifecycleException(excp.getMessage(), excp);
  }

        startedByMe_ = true;

        Object[] params = {instanceName, iMQBin};
View Full Code Here

                _logger.log(Level.INFO, "jms.broker_shutting_down");
                jmsAdmin_.connectToProvider();
            }
            catch (Exception e) {
                throw new ServerLifecycleException(e.getMessage(), e);
            }

            try {
                jmsAdmin_.shutdownProvider();
                _logger.log(Level.INFO, "jms.broker_shutdown_complete");
View Full Code Here

    context.getPluggableFeatureFactory().getInternalServicesList();

  final String[][] servicesByName = servicesList.getServicesByName();
  if (servicesByName == null) {
        _logger.log(Level.SEVERE, "services.null");
        throw new ServerLifecycleException();
  }

        // security manager is set inside SecurityLifecycle

  // Instantiate the built-in runtime services
        final List<ServerLifecycle> temp = instantiateRuntimeServices( context, servicesByName );
        services.addAll( temp );
         
        // Initialize the built-in runtime services
        for ( final ServerLifecycle service : services) {
          try {
                service.onInitialization(context);
            } catch (ServerLifecycleException e) {      
                _logger.log(Level.SEVERE, "service.notinit",
                    new Object[] {service, e.toString()});
                throw e;
            }
        }

        //add listeners for security dynamic reconfiguration
        AdminEventListenerRegistry.addAuditModuleEventListener(
                new AuditModuleEventListenerImpl());
        AdminEventListenerRegistry.addAuthRealmEventListener(
                new AuthRealmEventListenerImpl());
        AdminEventListenerRegistry.addSecurityServiceEventListener(
                new SecurityServiceEventListenerImpl());
        AdminEventListenerRegistry.addUserMgmtEventListener(
                new UserMgmtEventListenerImpl());
        AdminEventListenerRegistry.addEventListener(
                MessageSecurityConfigEvent.eventType,
                new MessageSecurityConfigEventListenerImpl());

        //add Listeners for extended Admin Feature Events
        getServerContext().getPluggableFeatureFactory().
            getAdminExtensionFeature().registerEventListeners();

            // Call RI J2EEServer initialization code. Note that all resources
            // specified in server.xml will be loaded by the common class loader.
        try {
            J2EEServer.main(context);
        } catch (Exception e) {
            throw new ServerLifecycleException(e);
        }

        // final connector class loader for the anonymous inner class
        final ClassLoader connCL = connectorClassLoader;
View Full Code Here

                    }
                }
            }

        } catch (Exception ee) {
            throw new ServerLifecycleException(ee);
        }


        // notify the built-in runtime services that we are ready
        for ( final ServerLifecycle service : services) {
View Full Code Here

    if(_logger.isLoggable(Level.SEVERE))
        _logger.log(Level.SEVERE,"enterprise.j2ee_server_error",e.getMessage());
      }
      _logger.log(Level.SEVERE,"enterprise.j2ee_server_error1");
      System.err.flush();
      throw new ServerLifecycleException(e.getMessage(), e);
  }
    }
View Full Code Here

TOP

Related Classes of com.sun.appserv.server.ServerLifecycleException

Copyright © 2018 www.massapicom. 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.