OrientDB在上下文错误中找不到数据库实例? [英] OrientDB No database instance found in context error?

查看:244
本文介绍了OrientDB在上下文错误中找不到数据库实例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Orient DB在orientdb-community-1.7-rc2

Orient DB has and issue in orientdb-community-1.7-rc2

中有问题

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

并执行它我得到以下错误

and executes it I get following erro

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

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

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

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>


推荐答案

此处

    <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(),请从config中删除以下处理程序。

need to be remove from orientdb-server-config.xml. Because it seems orient.getGraph() and orient.getDatabase() operations cannot be configured to work simultaneously. To work with orient.getGraph() use above handler in config file. To work with orient.getDatabase() remove following handler from config.

这篇关于OrientDB在上下文错误中找不到数据库实例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆