Package javax.naming

Examples of javax.naming.ConfigurationException


        if (ctx != null) ctx.close();
      }
    } else if (obj instanceof String[]) {
      // Try each URL until either lookup succeeds or they all fail
      String[] urls = (String[])obj;
      if (urls.length == 0) throw new ConfigurationException("0");
      Context context = new ServiceRegistryContext(environment);
      try
      {
        NamingException ne = null;
        for(int i=0; i< urls.length; i++)
View Full Code Here


        for (Map.Entry<String, Object> cmdLineProp : _shell.getCmdLineProperties().entrySet()) {
            params.put(cmdLineProp.getKey(), cmdLineProp.getValue());
        }

        if (!_resource.configure(getResourceName(), params)) {
            throw new ConfigurationException("Unable to configure " + _resource.getName());
        }

        _connection = new NioClient("Agent", _shell.getHost(), _shell.getPort(), _shell.getWorkers(), this);

        // ((NioClient)_connection).setBindAddress(_shell.getPrivateIp());
View Full Code Here

    }

    private void loadProperties() throws ConfigurationException {
        final File file = PropertiesUtil.findConfigFile("agent.properties");
        if (file == null) {
            throw new ConfigurationException("Unable to find agent.properties.");
        }

        s_logger.info("agent.properties found at " + file.getAbsolutePath());

        try {
View Full Code Here

        if (_pod == null || (_pod.startsWith("@") && _pod.endsWith("@"))) {
            _pod = "default";
        }

        if (_host == null || (_host.startsWith("@") && _host.endsWith("@"))) {
            throw new ConfigurationException(
                    "Host is not configured correctly: " + _host);
        }

        final String retries = getProperty(null, "ping.retries");
        _pingRetries = NumbersUtil.parseInt(retries, 5);

        String value = getProperty(null, "developer");
        boolean developer = Boolean.parseBoolean(value);

        if (guid != null)
            _guid = guid;
        else
            _guid = getProperty(null, "guid");
        if (_guid == null) {
            if (!developer) {
                throw new ConfigurationException("Unable to find the guid");
            }
            _guid = UUID.randomUUID().toString();
            _properties.setProperty("guid", _guid);
        }
View Full Code Here

                constructor.setAccessible(true);
                ServerResource resource = (ServerResource) constructor
                        .newInstance();
                launchAgent(getNextAgentId(), resource);
            } catch (final ClassNotFoundException e) {
                throw new ConfigurationException("Resource class not found: "
                        + name + " due to: " + e.toString());
            } catch (final SecurityException e) {
                throw new ConfigurationException(
                        "Security excetion when loading resource: " + name
                        + " due to: " + e.toString());
            } catch (final NoSuchMethodException e) {
                throw new ConfigurationException(
                        "Method not found excetion when loading resource: "
                                + name + " due to: " + e.toString());
            } catch (final IllegalArgumentException e) {
                throw new ConfigurationException(
                        "Illegal argument excetion when loading resource: "
                                + name + " due to: " + e.toString());
            } catch (final InstantiationException e) {
                throw new ConfigurationException(
                        "Instantiation excetion when loading resource: " + name
                        + " due to: " + e.toString());
            } catch (final IllegalAccessException e) {
                throw new ConfigurationException(
                        "Illegal access exception when loading resource: "
                                + name + " due to: " + e.toString());
            } catch (final InvocationTargetException e) {
                throw new ConfigurationException(
                        "Invocation target exception when loading resource: "
                                + name + " due to: " + e.toString());
            }
        }
    }
View Full Code Here

    private void launchAgentFromTypeInfo() throws ConfigurationException {
        String typeInfo = getProperty(null, "type");
        if (typeInfo == null) {
            s_logger.error("Unable to retrieve the type");
            throw new ConfigurationException(
                    "Unable to retrieve the type of this agent.");
        }
        s_logger.trace("Launching agent based on type=" + typeInfo);
    }
View Full Code Here

      s_logger.info("Start configuring secondary storage vm alert manager : " + name);
   
    try {
      SubscriptionMgr.getInstance().subscribe(SecondaryStorageVmManager.ALERT_SUBJECT, this, "onSSVMAlert");
    } catch (SecurityException e) {
      throw new ConfigurationException("Unable to register secondary storage vm event subscription, exception: " + e);
    } catch (NoSuchMethodException e) {
      throw new ConfigurationException("Unable to register secondary storage vm event subscription, exception: " + e);
    }
   
    return true;
  }
View Full Code Here

        // this can sometimes happen, if DB is manually or programmatically manipulated
        if(_offering == null) {
            String msg = "Data integrity problem : System Offering For Software router VM has been removed?";
            s_logger.error(msg);
            throw new ConfigurationException(msg);
        }

        _systemAcct = _accountMgr.getSystemAccount();

        String aggregationRange = configs.get("usage.stats.job.aggregation.range");
View Full Code Here

        }

         try {
            SubscriptionMgr.getInstance().subscribe(ClusterManager.ALERT_SUBJECT, this, "onClusterAlert");
        } catch (SecurityException e) {
            throw new ConfigurationException("Unable to register cluster event subscription");
        } catch (NoSuchMethodException e) {
            throw new ConfigurationException("Unable to register cluster event subscription");
        }

        return true;
    }
View Full Code Here

            int poolSize = (cloudMaxActive * 2) / 3;

            s_logger.info("Start AsyncJobManager thread pool in size " + poolSize);
            _executor = Executors.newFixedThreadPool(poolSize, new NamedThreadFactory("Job-Executor"));
        } catch (final Exception e) {
            throw new ConfigurationException("Unable to load db.properties to configure AsyncJobManagerImpl");
        }

        return true;
    }
View Full Code Here

TOP

Related Classes of javax.naming.ConfigurationException

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.