简体   繁体   English

OrientDB在上下文错误中找不到数据库实例?

[英]OrientDB No database instance found in context error?

Orient DB has and issue in orientdb-community-1.7-rc2 OrientDB在orientdb-community-1.7-rc2中有问题

when I try to create a small function as follows 当我尝试创建如下的小函数时

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

and executes it I get following erro 并执行它,我得到跟随错误

Error on parsing script at position #0: Error on execution of the script Script: 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) No database instance found in context 解析位置0处的脚本时出错:执行脚本时出错脚本:newPOJS ------ ^ sun.org.mozilla.javascript.internal.WrappedException:包装了com.orientechnologies.orient.core.exception.OConfigurationException:在第2行的上下文(#2)中找不到数据库实例com.orientechnologies.orient.core.exception.OConfigurationException包裹:上下文(#2)中找不到数据库实例

However following function works fine, when I get the Graph instead of database 但是,当我获得图形而不是数据库时,以下功能可以正常工作

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

Any one has any idea where the issue, 任何人都知道问题出在哪里,

I made the following configuration change as well 我也进行了以下配置更改

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

Here 这里

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

need to be remove from orientdb-server-config.xml. 需要从orientdb-server-config.xml中删除。 Because it seems orient.getGraph() and orient.getDatabase() operations cannot be configured to work simultaneously. 因为似乎orient.getGraph()和orient.getDatabase()操作无法配置为同时工作。 To work with orient.getGraph() use above handler in config file. 要使用orient.getGraph(),请在配置文件中使用上述处理程序。 To work with orient.getDatabase() remove following handler from config. 要使用orient.getDatabase(),请从配置中删除以下处理程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM