Hi Erik, This could just be a classpath issue. What is your Gradle configuration?
Thanks Luigi 2016-08-09 17:35 GMT+02:00 Erik T <[email protected]>: > Hi Luigi, > > I was a bit startled to see a false in the conditional since the reasoning > isn't obvious in the code. > > I'm not entirely sure what you mean by 'deployment'. I'm looking to embed > orientDb (2.1.20). The build process is written in Gradle. I'm not sure if > OSGI is used or not since I'm new to this company and haven't worked with > OSGI before. What little progress I have made is finding more dependency > issues. I'm able to start the server but I'm unable to make a connection. > These segments of code are failing because jna.Platform can not be found > but its in my classpath. Its almost like the ClassLoader doesn't see it. > Here are two brief examples with what I'm trying: > > Example 1 : > > OrientGraphFactory factory = new OrientGraphFactory(*location*, "guest", > "guest"); > graph = factory.getTx(); > > > Example 2: > graph = new OrientGraph(*location*, "guest", "guest"); > > > Both examples give the following stack trace : > > > java.lang.NoClassDefFoundError: com/sun/jna/Platform > at > com.orientechnologies.nio.OCLibraryFactory.<clinit>(OCLibraryFactory.java:35) > at > com.orientechnologies.nio.OJNADirectMemory.<clinit>(OJNADirectMemory.java:35) > at > com.orientechnologies.common.directmemory.ODirectMemoryFactory.<clinit>(ODirectMemoryFactory.java:59) > at > com.orientechnologies.common.directmemory.ODirectMemoryPointerFactory.<init>(ODirectMemoryPointerFactory.java:28) > at > com.orientechnologies.common.directmemory.ODirectMemoryPointerFactory.<clinit>(ODirectMemoryPointerFactory.java:24) > at > com.orientechnologies.orient.core.storage.impl.local.paginated.wal.ODiskWriteAheadLog$LogSegment.initPageCache(ODiskWriteAheadLog.java:554) > at > com.orientechnologies.orient.core.storage.impl.local.paginated.wal.ODiskWriteAheadLog$LogSegment.init(ODiskWriteAheadLog.java:275) > at > com.orientechnologies.orient.core.storage.impl.local.paginated.wal.ODiskWriteAheadLog.<init>(ODiskWriteAheadLog.java:701) > at > com.orientechnologies.orient.core.storage.impl.local.paginated.wal.ODiskWriteAheadLog.<init>(ODiskWriteAheadLog.java:612) > at > com.orientechnologies.orient.core.storage.impl.local.paginated.OLocalPaginatedStorage.initWalAndDiskCache(OLocalPaginatedStorage.java:299) > at > com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.open(OAbstractPaginatedStorage.java:169) > at > com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.open(ODatabaseDocumentTx.java:252) > 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:103) > at > systemDb.orient.BOrientSystemDatabase.instantiate(BOrientSystemDatabase.java:52) > > Caused by: java.lang.ClassNotFoundException: com.sun.jna.Platform > at java.net.URLClassLoader.findClass(URLClassLoader.java:381) > at java.lang.ClassLoader.loadClass(ClassLoader.java:424) > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) > at java.lang.ClassLoader.loadClass(ClassLoader.java:357) > > > > > On Friday, August 5, 2016 at 3:05:14 AM UTC-4, Luigi Dell'Aquila wrote: >> >> 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.OCommandExecutorSQLDel >>> egate.parse(OCommandExecutorSQLDelegate.java:72) >>> at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDel >>> egate.parse(OCommandExecutorSQLDelegate.java:42) >>> at com.orientechnologies.orient.core.storage.impl.local.OAbstra >>> ctPaginatedStorage.command(OAbstractPaginatedStorage.java:1404) >>> at com.orientechnologies.orient.core.sql.query.OSQLQuery.run(OS >>> QLQuery.java:72) >>> at com.orientechnologies.orient.core.sql.query.OSQLSynchQuery.r >>> un(OSQLSynchQuery.java:85) >>> at com.orientechnologies.orient.core.query.OQueryAbstract.execu >>> te(OQueryAbstract.java:33) >>> at com.orientechnologies.orient.core.metadata.security.OSecurit >>> yShared.getUser(OSecurityShared.java:522) >>> at com.orientechnologies.orient.core.metadata.security.OSecurit >>> yShared.authenticate(OSecurityShared.java:163) >>> at com.orientechnologies.orient.core.metadata.security.OSecurit >>> yProxy.authenticate(OSecurityProxy.java:87) >>> at com.orientechnologies.orient.core.db.document.ODatabaseDocum >>> entTx.open(ODatabaseDocumentTx.java:268) >>> at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.openOr >>> Create(OrientBaseGraph.java:1797) >>> at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.<init> >>> (OrientBaseGraph.java:156) >>> at com.tinkerpop.blueprints.impls.orient.OrientTransactionalGra >>> ph.<init>(OrientTransactionalGraph.java:102) >>> at com.tinkerpop.blueprints.impls.orient.OrientTransactionalGra >>> ph.<init>(OrientTransactionalGraph.java:98) >>> at com.tinkerpop.blueprints.impls.orient.OrientGraph.<init>( >>> OrientGraph.java:76) >>> at com.tridium.systemDb.orient.BOrientSystemDatabase.connectToD >>> atabase(BOrientSystemDatabase.java:62) >>> at com.tridium.systemDb.orient.BOrientSystemDatabase.instantiat >>> e(BOrientSystemDatabase.java:47) >>> at com.tridium.systemDb.orient.BOrientSystemDatabase.doConnect( >>> BOrientSystemDatabase.java:83) >>> at com.tridium.systemDb.BSystemDbService.doConnect(BSystemDbSer >>> vice.java:209) >>> at auto.com_tridium_systemDb_BSystemDbService.invoke(AutoGenera >>> ted) >>> at com.tridium.sys.schema.ComponentSlotMap.invoke(ComponentSlot >>> Map.java:1871) >>> at com.tridium.sys.engine.EngineUtil.doInvoke(EngineUtil.java: >>> 62) >>> at com.tridium.sys.engine.EngineManager.checkAsyncActions(Engin >>> eManager.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. > -- --- 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.
