Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find a command executor for the command request #1

Closed
devilseye opened this issue Jan 17, 2018 · 6 comments
Closed

Cannot find a command executor for the command request #1

devilseye opened this issue Jan 17, 2018 · 6 comments

Comments

@devilseye
Copy link

Hello, i tried to use your library (thank you for it), and get an error when run liquibase:update task:

Error setting up or running Liquibase: liquibase.exception.DatabaseException:
Error while executing command [Failed SQL: CREATE TABLE DATABASECHANGELOGLOCK (ID INT NOT NULL, LOCKED BOOLEAN NOT NULL, LOCKGRANTED datetime, LOCKEDBY VARCHAR(255), CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID))]:
Cannot find a command executor for the command request: sql.CREATE TABLE DATABASECHANGELOGLOCK (ID INT NOT NULL, LOCKED BOOLEAN NOT NULL, LOCKGRANTED datetime, LOCKEDBY VARCHAR(255), CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID))

Have you ever got this error or something like this?
I guess that the problem in liquibase algorithms, they try to create tables in database, but database doesn't understand this syntax.

I hope for your help, thank you.

@tkrullmann
Copy link
Member

Hi,
the plugin contains a class that translates the "create table" requests into CREATE CLASS when run against an OrientDB database. It should be chosen by Liquibase for its DATABASECHANGELOG and DATABASECHANGELOGLOCK tables.
How do you run Liquibase? Are you sure that the plugin library is on the classpath?

@devilseye
Copy link
Author

devilseye commented Jan 20, 2018

I use maven application module with plugins:
liquibase-core 3.5.3
liquibase-orientdb 0.2.1 (scope: runtime)
orientdb-jdbc 2.2.31:

<dependencies>
    <dependency>
      <groupId>org.liquibase</groupId>
      <artifactId>liquibase-core</artifactId>
      <version>3.5.3</version>
    </dependency>

    <dependency>
      <groupId>org.unbroken-dome.liquibase-orientdb</groupId>
      <artifactId>liquibase-orientdb</artifactId>
      <version>0.2.1</version>
      <scope>runtime</scope>
    </dependency>

    <dependency>
      <groupId>com.orientechnologies</groupId>
      <artifactId>orientdb-jdbc</artifactId>
      <version>2.2.31</version>
    </dependency>
  </dependencies>

build with plugin liquibase-maven-plugin with settings:

<configuration>
          <driver>com.orientechnologies.orient.jdbc.OrientJdbcDriver</driver>
          <changeLogFile>${liquibase.changelog.path}</changeLogFile>
          <url>${liquibase.url}</url>
          <username>${liquibase.username}</username>
          <password>${liquibase.password}</password>
        </configuration>

Liquibase is run by command:
mvn liquibase:update

@tkrullmann
Copy link
Member

tkrullmann commented Jan 21, 2018

Hi,
thanks for the info!

First, I think Liquibase can't be used with OrientDB 2.2's JDBC driver. Liquibase is querying some metadata from it that the driver just doesn't implement. It will run the changesets, but it fails to update the DATABASECHANGELOG, so you will get errors on the second run. It seems to work fine in 3.0 and upwards.

Second, the (Liquibase OrientDB) plugin doesn't seem to end up on the classpath for the Maven plugin invocation. I haven't used the Liquibase Maven plugin a lot so I don't know exactly how it works internally.

I got it to run by putting the dependencies directly under the <plugin> block:

    <properties>
        <liquibase.version>3.5.3</liquibase.version>
        <orientdb.version>3.0.0RC1</orientdb.version>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.liquibase</groupId>
                <artifactId>liquibase-maven-plugin</artifactId>
                <version>${liquibase.version}</version>
                <configuration>
                    <changeLogFile>src/main/resources/liquibase/changelog-master.xml</changeLogFile>
                    <driver>com.orientechnologies.orient.jdbc.OrientJdbcDriver</driver>
                    <url>jdbc:orient:remote:192.168.99.100/test</url>
                    <username>root</username>
                    <password>root</password>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>com.orientechnologies</groupId>
                        <artifactId>orientdb-jdbc</artifactId>
                        <version>${orientdb.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.unbroken-dome.liquibase-orientdb</groupId>
                        <artifactId>liquibase-orientdb</artifactId>
                        <version>0.3.0</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

@devilseye
Copy link
Author

Hi, I tried to use Orient JDBC Driver 3.0.0RC1, update version (0.3.0) of your library and put dependecies under <plugin> block.
liquibase:update build was successful, thank you.
But then it throwed two exceptions:

Exception in thread "Thread-2" java.lang.NoClassDefFoundError: com/orientechnologies/common/directmemory/OByteBufferPool
        at com.orientechnologies.orient.core.Orient$OShutdownOrientDBInstancesHandler.shutdown(Orient.java:777)
        at com.orientechnologies.orient.core.Orient.shutdown(Orient.java:379)
        at com.orientechnologies.orient.core.OrientShutdownHook.run(OrientShutdownHook.java:40)
Caused by: java.lang.ClassNotFoundException: com.orientechnologies.common.directmemory.OByteBufferPool
        at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
        ... 3 more

I think that isn't good...

and liquibase:dropAll function doesn't work:

[ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:3.5.3:dropAll (default-cli) on project migration: Error setting up or running Liquibase: Error while executing com
mand [Failed SQL: DROP TABLE DATABASECHANGELOGLOCK]: Error parsing query:
[ERROR] DROP TABLE DATABASECHANGELOGLOCK
[ERROR]    ^

@tkrullmann
Copy link
Member

I got those last two exceptions as well, but it seemed they were only logged on shutdown, and it doesn't affect the successful outcome of the task. It's a pre-release driver after all, so I'd ignore them for now and see if this still pops up in the 3.0 release version.

As for the dropAll task, it isn't supported yet. I've created a separate issue #2 for that.

@devilseye
Copy link
Author

Ok, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants