简体   繁体   中英

OrientDB No database instance found in context error?

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>

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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