Hi Erik,

The block with

if (textUpperCase.startsWith("SELECT") && false) {

is never executed (see the && false), it's there because of some tests, but
it's disabled for a reason.
The problem here seems to be in class loading, the SQL engine cannot find
the factory that creates the executor for SELECT.
What kind of deployment are you using? Do you have any specific class
loading process (eg. OSGI)?

Thanks

Luigi


2016-08-04 20:12 GMT+02:00 Erik T <[email protected]>:

> Hello,
>
> I was having trouble creating a connection to a graph database in
> orientDB. I always get
>
> 2016-08-04 14:02:55:993 INFO  OrientDB Server v2.1.20 is active.
> [OServer]com.orientechnologies.orient.core.command.
> OCommandExecutorNotFoundException: Cannot find a command executor for the
> command request: sql.select from OUser where name = ? limit 1
>         at com.orientechnologies.orient.core.sql.
> OCommandExecutorSQLDelegate.parse(OCommandExecutorSQLDelegate.java:72)
>         at com.orientechnologies.orient.core.sql.
> OCommandExecutorSQLDelegate.parse(OCommandExecutorSQLDelegate.java:42)
>         at com.orientechnologies.orient.core.storage.impl.local.
> OAbstractPaginatedStorage.command(OAbstractPaginatedStorage.java:1404)
>         at com.orientechnologies.orient.core.sql.query.OSQLQuery.run(
> OSQLQuery.java:72)
>         at com.orientechnologies.orient.core.sql.query.OSQLSynchQuery.
> run(OSQLSynchQuery.java:85)
>         at com.orientechnologies.orient.core.query.OQueryAbstract.
> execute(OQueryAbstract.java:33)
>         at com.orientechnologies.orient.core.metadata.security.
> OSecurityShared.getUser(OSecurityShared.java:522)
>         at com.orientechnologies.orient.core.metadata.security.
> OSecurityShared.authenticate(OSecurityShared.java:163)
>         at com.orientechnologies.orient.core.metadata.security.
> OSecurityProxy.authenticate(OSecurityProxy.java:87)
>         at com.orientechnologies.orient.core.db.document.
> ODatabaseDocumentTx.open(ODatabaseDocumentTx.java:268)
>         at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.
> openOrCreate(OrientBaseGraph.java:1797)
>         at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.<
> init>(OrientBaseGraph.java:156)
>         at com.tinkerpop.blueprints.impls.orient.
> OrientTransactionalGraph.<init>(OrientTransactionalGraph.java:102)
>         at com.tinkerpop.blueprints.impls.orient.
> OrientTransactionalGraph.<init>(OrientTransactionalGraph.java:98)
>         at com.tinkerpop.blueprints.impls.orient.OrientGraph.<
> init>(OrientGraph.java:76)
>         at com.tridium.systemDb.orient.BOrientSystemDatabase.
> connectToDatabase(BOrientSystemDatabase.java:62)
>         at com.tridium.systemDb.orient.BOrientSystemDatabase.instantiate(
> BOrientSystemDatabase.java:47)
>         at com.tridium.systemDb.orient.BOrientSystemDatabase.doConnect(
> BOrientSystemDatabase.java:83)
>         at com.tridium.systemDb.BSystemDbService.doConnect(
> BSystemDbService.java:209)
>         at auto.com_tridium_systemDb_BSystemDbService.invoke(
> AutoGenerated)
>         at com.tridium.sys.schema.ComponentSlotMap.invoke(
> ComponentSlotMap.java:1871)
>         at com.tridium.sys.engine.EngineUtil.doInvoke(EngineUtil.java:62)
>         at com.tridium.sys.engine.EngineManager.checkAsyncActions(
> EngineManager.java:420)
>         at com.tridium.sys.engine.EngineManager.execute(
> EngineManager.java:245)
>         at com.tridium.sys.engine.EngineManager$EngineThread.
> run(EngineManager.java:839)
>
> The documentation is vague and not helpful so i step through the code and
> see this in OCommandExecutorSQLDelegate.parse:
>
> public OCommandExecutorSQLDelegate parse(final OCommandRequest iCommand) {
>
> ...
>
>
> if (textUpperCase.startsWith("SELECT") && false) {
>   InputStream is = new ByteArrayInputStream(text.getBytes());
>   OrientSql osql = new OrientSql(is);
>   try {
>     // TODO create a cache of parsed statements
>     OStatement stm = osql.parse();
>     delegate = stm.buildExecutor(iCommand);
>     delegate.setContext(context);
>     delegate.setLimit(iCommand.getLimit());
>     delegate.setProgressListener(progressListener);
>     is.close();
>   } catch (Exception e) {
>     throwParsingException(e.getMessage());
>   }
> } else {
>   delegate = (OCommandExecutorSQLAbstract) 
> OSQLEngine.getInstance().getCommand(textUpperCase);
>   if (delegate == null)
>     throw new OCommandExecutorNotFoundException("Cannot find a command 
> executor for the command request: " + iCommand);
>
>   delegate.setContext(context);
>   delegate.setLimit(iCommand.getLimit());
>   delegate.parse(iCommand);
>   delegate.setProgressListener(progressListener);
> }
>
>
> the query starts with select but the try catch block is never reached because 
> of the hard coded false in the if statement. There aren't any comments to 
> explain this. Why is that there?
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "OrientDB" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to