Package com.orientechnologies.orient.core.exception

Examples of com.orientechnologies.orient.core.exception.OConfigurationException


    if (!file.exists())
      file = new File("../server/config/orientdb-server-config.xml");
    if (!file.exists())
      file = new File(OSystemVariableResolver.resolveSystemVariables("${ORIENTDB_HOME}/config/orientdb-server-config.xml"));
    if (!file.exists())
      throw new OConfigurationException("Can't load file orientdb-server-config.xml to execute remote tests");

    FileReader f = new FileReader(file);
    final char[] buffer = new char[(int) file.length()];
    f.read(buffer);
    f.close();
View Full Code Here


        if (m.getParameterTypes().length > 0)
          m.invoke(iPojo, iDocument);
        else
          m.invoke(iPojo);
      } catch (Exception e) {
        throw new OConfigurationException("Error on executing user callback '" + m.getName() + "' annotated with '"
            + iAnnotation.getSimpleName() + "'", e);
      }
  }
View Full Code Here

      color = inStream.getAsBoolean();
      init();
      size = inStream.getAsInteger();

      if (size > pageSize)
        throw new OConfigurationException("Loaded index with page size setted to " + pageSize
            + " while the loaded was built with: " + size);

      // UNCOMPACT KEYS SEPARATELY
      serializedKeys = new int[pageSize];
      for (int i = 0; i < size; ++i) {
View Full Code Here

        registerPojo(pojo, record);

        stream2pojo(record, pojo, iFetchPlan);

      } catch (Exception e) {
        throw new OConfigurationException("Can't retrieve pojo from the record " + record, e);
      }
    }

    return (T) pojo;
  }
View Full Code Here

   * @throws IOException
   */
  private int registerCluster(final OCluster iCluster) throws IOException {
    // CHECK FOR DUPLICATION OF NAMES
    if (clusterMap.containsKey(iCluster.getName()))
      throw new OConfigurationException("Can't add segment '" + iCluster.getName() + "' because it was already registered");

    // CREATE AND ADD THE NEW REF SEGMENT
    clusterMap.put(iCluster.getName(), iCluster);

    final int id = iCluster.getId();
View Full Code Here

      iURL = iURL.substring(0, iURL.length() - 1);

    // SEARCH FOR ENGINE
    int pos = iURL.indexOf(':');
    if (pos <= 0)
      throw new OConfigurationException("Error in database URL: the engine was not specified. Syntax is: " + URL_SYNTAX
          + ". URL was: " + iURL);

    final String engineName = iURL.substring(0, pos);

    acquireExclusiveLock();
    try {
      final OEngine engine = engines.get(engineName.toLowerCase());

      if (engine == null)
        throw new OConfigurationException("Error on opening database: the engine '" + engineName + "' was not found. URL was: "
            + iURL + ". registered engines are: " + engines.keySet());

      // SEARCH FOR DB-NAME
      iURL = iURL.substring(pos + 1);
      pos = iURL.indexOf('?');

      Map<String, String> parameters = null;
      String dbName = null;
      if (pos > 0) {
        dbName = iURL.substring(0, pos);
        iURL = iURL.substring(pos + 1);

        // PARSE PARAMETERS
        parameters = new HashMap<String, String>();
        String[] pairs = iURL.split("&");
        String[] kv;
        for (String pair : pairs) {
          kv = pair.split("=");
          if (kv.length < 2)
            throw new OConfigurationException("Error on opening database: the parameter has no value. Syntax is: " + URL_SYNTAX
                + ". URL was: " + iURL);
          parameters.put(kv[0], kv[1]);
        }
      } else
        dbName = iURL;
View Full Code Here

      return OStorageSegmentConfiguration.class;
    case 'd':
      return OStorageFileConfiguration.class;
    }

    throw new OConfigurationException("Unsupported record type: " + iType);
  }
View Full Code Here

  public ONetworkProtocolDistributed() {
    super("Distributed-DB");

    manager = OServerMain.server().getHandler(ODistributedServerManager.class);
    if (manager == null)
      throw new OConfigurationException(
          "Can't find a ODistributedServerDiscoveryManager instance registered as handler. Check the server configuration in the handlers section.");
  }
View Full Code Here

    if (!file.exists())
      file = new File("../server/config/orientdb-server-config.xml");
    if (!file.exists())
      file = new File(OSystemVariableResolver.resolveSystemVariables("${ORIENTDB_HOME}/config/orientdb-server-config.xml"));
    if (!file.exists())
      throw new OConfigurationException("Can't load file orientdb-server-config.xml to execute remote tests");

    FileReader f = new FileReader(file);
    final char[] buffer = new char[(int) file.length()];
    f.read(buffer);
    f.close();
View Full Code Here

            OConfigurationException.class);

      id = distributedNetworkListener.getInboundAddr().getHostName() + ":" + distributedNetworkListener.getInboundAddr().getPort();

    } catch (Exception e) {
      throw new OConfigurationException("Can't configure OrientDB Server as Cluster Node", e);
    }
  }
View Full Code Here

TOP

Related Classes of com.orientechnologies.orient.core.exception.OConfigurationException

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.