Ohh sorry, we were already able to fix it. Yeah it was with Shading. Well why not using Maven? How do you compile your OrientDB java code?
http://stackoverflow.com/questions/26490352/ocommandexecutornotfoundexception-creating-orientdb-database-via-jar-file/26496803#26496803 Am Donnerstag, 23. Oktober 2014 14:53:12 UTC+2 schrieb odbuser: > > The maven-assembly-plugin is likely not including META-INF/services from > the jar files which means the service framework will not work correctly. > Check for the presence of META-INF/services in the output jar (uber-jar). > I think you'll have to use the shade plugin... or better yet don't use > maven :0). > > On Tuesday, October 21, 2014 12:48:22 PM UTC-4, Curtis Mosters wrote: >> >> We want to import data on a Linux system. So we have 2 Java files for the >> import. One (*OrientDBMain.java*) is for creating an object that is >> doing all the work. The other (*OrientDB.java*) contains all the >> database functions like setting an index and so on. The second files starts >> with: >> >> public class OrientDB { >> private OrientGraphFactory factoryGraph; >> private ODatabaseDocumentTx db; >> private String csvPath; >> >> @SuppressWarnings("resource") >> public OrientDB(String dbPath) { >> OGlobalConfiguration.STORAGE_KEEP_OPEN.setValue(true); >> OGlobalConfiguration.ENVIRONMENT_CONCURRENT.setValue(false); >> db = new ODatabaseDocumentTx(dbPath).create(); >> } >> ... >> >> Running this in Eclipse on a Windows and MAC works well. No error and >> data is correctly imported. >> >> But now we wanted to run this on our Linux system. So we setup a Maven >> project (m2e) and exported a Jar file with all the dependencies here: >> >> >> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi=" >> http://www.w3.org/2001/XMLSchema-instance" >> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 >> http://maven.apache.org/xsd/maven-4.0.0.xsd"> >> <modelVersion>4.0.0</modelVersion> >> >> <groupId>mapegy</groupId> >> <artifactId>orientdbcsv</artifactId> >> <version>0.0.2-SNAPSHOT</version> >> <packaging>jar</packaging> >> >> <name>orientdbcsv</name> >> <url>http://maven.apache.org</url> >> >> <properties> >> <project.build.sourceEncoding>UTF-8 >> </project.build.sourceEncoding> >> </properties> >> >> <dependencies> >> <dependency> >> <groupId>junit</groupId> >> <artifactId>junit</artifactId> >> <version>3.8.1</version> >> <scope>test</scope> >> </dependency> >> <dependency> >> <groupId>com.orientechnologies</groupId> >> <artifactId>orientdb-graphdb</artifactId> >> <version>2.0-M1</version> >> </dependency> >> </dependencies> >> <build> >> <plugins> >> <plugin> >> <artifactId>maven-assembly-plugin</artifactId> >> <configuration> >> <archive> >> <manifest> >> <mainClass>mapegy.orientdbcsv.OrientDBMain</mainClass> >> </manifest> >> </archive> >> <descriptorRefs> >> <descriptorRef>jar-with-dependencies</descriptorRef> >> </descriptorRefs> >> </configuration> >> <executions> >> <execution> >> <id>make-assembly</id> >> <phase>package</phase> >> <goals> >> <goal>single</goal> >> </goals> >> </execution> >> </executions> >> </plugin> >> <plugin> >> <groupId>org.apache.maven.plugins</groupId> >> <artifactId>maven-compiler-plugin</artifactId> >> <version>2.3.2</version> >> <configuration> >> <source>${jdk.version}</source> >> <target>${jdk.version}</target> >> </configuration> >> </plugin> >> </plugins> >> </build> >> </project> >> >> >> >> But if we run that Jar now we are getting some errors. They say that >> there is some OCommandExecutorNotFoundException thrown. But how can that be >> if it run great directly in Eclipse? We have 2 args {pathtoimportdata, >> pathtodestinationdb}. >> >> >> C:\eclipse-workspace\orientdbcsv\target>java -jar orientdbcsv-0.0.2- >> SNAPSHOT-jar >> -with-dependencies.jar "C:\data" >> "C:\orientdb-community-2.0-M1\databases\test" >> Exception in thread "main" com.orientechnologies.orient.core. >> exception.ODatabase >> Exception: Cannot create database >> at com.orientechnologies.orient.core.db.record. >> ODatabaseRecordAbstract.c >> reate(ODatabaseRecordAbstract.java:289) >> at com.orientechnologies.orient.core.db. >> ODatabaseWrapperAbstract.create( >> ODatabaseWrapperAbstract.java:61) >> at com.orientechnologies.orient.core.db. >> ODatabaseRecordWrapperAbstract.c >> reate(ODatabaseRecordWrapperAbstract.java:72) >> at com.orientechnologies.orient.core.db. >> ODatabaseWrapperAbstract.create( >> ODatabaseWrapperAbstract.java:56) >> at com.orientechnologies.orient.core.db. >> ODatabaseRecordWrapperAbstract.c >> reate(ODatabaseRecordWrapperAbstract.java:66) >> at mapegy.orientdbcsv.OrientDB.<init>(OrientDB.java:36) >> at mapegy.orientdbcsv.OrientDBMain.main(OrientDBMain.java:6) >> Caused by: com.orientechnologies.orient.core.command. >> OCommandExecutorNotFoundExc >> eption: Cannot find a command executor for the command request: sql. >> select count >> (*) from ORole where name.type() not in ["STRING"] and name is not >> null >> at com.orientechnologies.orient.core.sql. >> OCommandExecutorSQLDelegate.par >> se(OCommandExecutorSQLDelegate.java:48) >> at com.orientechnologies.orient.core.sql. >> OCommandExecutorSQLDelegate.par >> se(OCommandExecutorSQLDelegate.java:33) >> at com.orientechnologies.orient.core.storage.OStorageEmbedded >> .command(OS >> torageEmbedded.java:69) >> at com.orientechnologies.orient.core.command. >> OCommandRequestTextAbstract >> .execute(OCommandRequestTextAbstract.java:59) >> at com.orientechnologies.orient.core.metadata.schema. >> OClassImpl.checkPer >> sistentPropertyType(OClassImpl.java:1597) >> at com.orientechnologies.orient.core.metadata.schema. >> OClassImpl.addPrope >> rty(OClassImpl.java:1911) >> at com.orientechnologies.orient.core.metadata.schema. >> OClassImpl.createPr >> operty(OClassImpl.java:580) >> at com.orientechnologies.orient.core.metadata.security. >> OSecurityShared.c >> reateMetadata(OSecurityShared.java:350) >> at com.orientechnologies.orient.core.metadata.security. >> OSecurityShared.c >> reate(OSecurityShared.java:282) >> at com.orientechnologies.orient.core.metadata.security. >> OSecurityProxy.cr >> eate(OSecurityProxy.java:70) >> at com.orientechnologies.orient.core.metadata. >> OMetadataDefault.create(OM >> etadataDefault.java:84) >> at com.orientechnologies.orient.core.db.record. >> ODatabaseRecordAbstract.c >> reate(ODatabaseRecordAbstract.java:269) >> ... 6 more >> >> So the question is right now. Why does it throw that error and why does >> it work properly in Eclipse. And maybe do you know other way to compile >> import scripts for OrientDB in an easy way with less effort. >> >> Thank you. >> >> Edit: I already got the tip to use Maven Shade, but did not work for me. >> Do someone has an idea except this. Or maybe can tell me how to use the jar >> without dependencies to get it running. That would be amazing =) >> > -- --- 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.
