Package com.caucho.config

Examples of com.caucho.config.ConfigException


                        WebAppDeployClient deployClient)
  {
    String war = args.getDefaultArg();
   
    if (war == null) {
      throw new ConfigException(L.l("Cannot find .war argument in command line"));
    }
   
    if (! war.endsWith(".war")) {
      throw new ConfigException(L.l("Deploy expects to be used with a *.war file at {0}",
                                    war));
    }

    String name = args.getArg("-name");
   
    String webapp = args.getArg("-web-app");
   
    if (webapp != null)
      name = webapp;
   
    String host = args.getArg("-host");
   
    if (host == null)
      host = "default";
   
    CommitBuilder commit = new CommitBuilder();
    commit.type("webapp");
   
    String stage = args.getArg("-stage");
   
    if (stage != null)
      commit.stage(stage);
   
    Path path = Vfs.lookup(war);
   
    if (name == null) {
      String tail = path.getTail();
     
      int p = tail.lastIndexOf('.');

      name = tail.substring(0, p);
    }
   
    commit.tagKey(host + "/" + name);

    /*
    String tag = args.getArg("-tag");
    if (tag != null)
      commit.tagKey(tag);
      */
   
    if (! path.isFile()) {
      throw new ConfigException(L.l("'{0}' is not a readable file.",
                                    path.getFullPath()));
    }
   
    String message = args.getArg("-m");
   
View Full Code Here


    String tag = args.getArg("-tag");

    if (tag == null) {
      String name = args.getDefaultArg();
      if (name == null)
        throw new ConfigException("command requires tag or name be specified");

      String stage = args.getArg("-stage");
      if (stage == null)
        stage = "production";
View Full Code Here

  @PostConstruct
  public void init()
  {
    if (_serverPort == 0)
      throw new ConfigException(L.l("'serverPort' is a required attribute for {0}",
                                    getClass().getSimpleName()));
  }
View Full Code Here

          factory.name(_name);

        cdiManager.addBean(factory.singleton(_value));
      }
      else if (_className == null)
        throw new ConfigException(L.l("BeanEmbed must either have a value or a class"));
      else {
        ClassLoader loader = Thread.currentThread().getContextClassLoader();

        Class<?> cl = Class.forName(_className, false, loader);
View Full Code Here

  //  @Override
  public void init()
    throws ConfigException
  {
    if (_name == null) {
      throw new ConfigException(L.l("'name' is a required attribute of '{0}'.",
                                    getClass().getSimpleName()));
    }
   
    if (_value == null) {
      throw new ConfigException(L.l("'value' is a required attribute of '{0}'.",
                                    getClass().getSimpleName()));
    }
  }
View Full Code Here

    }
   
    String jvmVersion = System.getProperty("java.runtime.version");
   
    if ("1.6".compareTo(jvmVersion) > 0) {
      throw new ConfigException(L().l("Resin requires Java 1.6 or later but was started with {0}",
                                      jvmVersion));
    }

    // required for license check
    System.setProperty("resin.home", resinHome.getNativePath());

    // watchdog/0210
    // Vfs.setPwd(_rootDirectory);

    if (! _args.getResinConf().canRead()) {
      throw new ConfigException(L().l("Resin/{0} can't open configuration file '{1}'",
                                      VersionFactory.getVersion(),
                                      _args.getResinConf().getNativePath()));
    }
   
    Path rootDirectory = _args.getRootDirectory();
    Path dataDirectory = rootDirectory.lookup("watchdog-data");

    ResinSystem system = new ResinSystem("watchdog",
                                         rootDirectory,
                                         dataDirectory);

    Thread thread = Thread.currentThread();
    thread.setContextClassLoader(system.getClassLoader());
   
    LibraryLoader libLoader = new LibraryLoader();
    libLoader.setPath(rootDirectory.lookup("lib"));
    libLoader.init();

    Config config = new Config();
    BootResinConfig bootManager = new BootResinConfig(system, _args);

    ResinELContext elContext = _args.getELContext();

    /**
     * XXX: the following setVar calls should not be necessary, but the
     * EL.setEnviornment() call above is not effective:
     */
    InjectManager beanManager = InjectManager.create();

    Config.setProperty("resinHome", elContext.getResinHome());
    Config.setProperty("java", elContext.getJavaVar());
    Config.setProperty("resin", elContext.getResinVar());
    Config.setProperty("server", elContext.getServerVar());
    Config.setProperty("system", System.getProperties());
    Config.setProperty("getenv", System.getenv());

    ResinConfigLibrary.configure(beanManager);

    config.configure(bootManager, _args.getResinConf(),
                     "com/caucho/server/resin/resin.rnc");

    if (_args.isDynamicServer()) {
      _client = bootManager.addDynamicClient(_args);
    }
    else {
      _client = bootManager.findClient(_args.getServerId());
    }
   
    if (_client == null && _args.isShutdown()) {
      _client = bootManager.findShutdownClient();
    }
   
    if (_client == null && ! (_args.isStart() || _args.isConsole())) {
      _client = bootManager.findShutdownClient();
    }

    if (_client == null) {
      throw new ConfigException(L().l("Resin/{0}: -server '{1}' does not match any defined <server>\nin {2}.",
                                      VersionFactory.getVersion(), _args.getServerId(), _args.getResinConf()));
    }
  }
View Full Code Here

   */
  protected void required(Object value, String name)
    throws ConfigException
  {
    if (value == null)
      throw new ConfigException(L.l("{0} requires '{1}' attribute.",
                                    getTagName(), name));
  }
View Full Code Here

   * Adds a dynamic server
   */
  public void addDynamicServer(String serverId, String address, int port)
    throws ConfigException
  {
    throw new ConfigException(L.l("addDynamicServer requires Resin Professional"));
  }
View Full Code Here

   * Remove a dynamic server
   */
  public void removeDynamicServer(String serverId, String address, int port)
    throws ConfigException
  {
    throw new ConfigException(L.l("removeDynamicServer requires Resin Professional"));
  }
View Full Code Here

                                              String address,
                                              int port,
                                              int index)
    throws ConfigException
  {
    throw new ConfigException(L.l("setDynamicServer requires Resin Professional"));
  }
View Full Code Here

TOP

Related Classes of com.caucho.config.ConfigException

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.