【问题标题】:OrientDB No database instance found in context error?OrientDB No database instance found in context 错误?
【发布时间】:2014-05-23 12:48:22
【问题描述】:

Orient DB 在 orientdb-community-1.7-rc2 中存在和问题

当我尝试如下创建一个小函数时

var db = orient.getDatabase()
return 'test';

并执行它我得到以下错误

在位置 #0 解析脚本时出错:执行脚本时出错 脚本:newPOJS ------^ sun.org.mozilla.javascript.internal.WrappedException: Wrapped com.orientechnologies.orient.core.exception.OConfigurationException: No database instance found in context (#2) in at line number 2 Wrapped com.orientechnologies.orient.core.exception.OConfigurationException: No database instance found in context (#2) 在上下文中找不到数据库实例

但是,当我得到 Graph 而不是数据库时,以下函数可以正常工作

var db = orient.getGraph()
return 'test';

任何人都知道问题出在哪里,

我也进行了以下配置更改

    <handler class="com.orientechnologies.orient.server.handler.OServerSideScriptInterpreter">
        <parameters>
            <parameter value="true" name="enabled"/>
        </parameters>
    </handler>

【问题讨论】:

    标签: javascript orientdb


    【解决方案1】:

    这里

        <handler class="com.orientechnologies.orient.graph.handler.OGraphServerHandler">
            <parameters>
                <parameter value="true" name="enabled"/>
                <parameter value="50" name="graph.pool.max"/>
            </parameters>
        </handler>
    

    需要从 orientdb-server-config.xml 中删除。因为似乎 orient.getGraph() 和 orient.getDatabase() 操作无法配置为同时工作。要使用 orient.getGraph() 在配置文件中使用上述处理程序。要使用 orient.getDatabase() 从配置中删除以下处理程序。

    【讨论】:

      猜你喜欢
      • 2017-02-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-21
      • 1970-01-01
      • 1970-01-01
      • 2021-11-13
      相关资源
      最近更新 更多