OrientDB No database instance found in context error?

大城市里の小女人 提交于 2019-12-02 03:54:57

问题


Orient DB has and issue in 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

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>

回答1:


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. 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.



来源:https://stackoverflow.com/questions/23829704/orientdb-no-database-instance-found-in-context-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!