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

Configure cassandra-unit with specific version of Hector and Cassandra. #46

Closed
marccarre opened this issue Dec 4, 2012 · 2 comments
Closed

Comments

@marccarre
Copy link
Contributor

Hi,

To avoid all the:

  • NoSuchMethodException
  • IncompatibleClassChangeError
  • etc.

due to conflicting dependencies, would it be possible to have a way to configure cassandra-unit with the versions used in client projects?

I guess this would also avoid having to release new versions of cassandra-unit just to upgrade to different versions of Hector/Cassandra.

Thanks & Regards,

Marc.

P.S. : Happy to help implementing this, provided some guidance.


EDIT:

As a workaround, Maven exclusions work on cassandra-unit 1.1.12, using the cassandra-all 1.0.7 and hector-core 1.0-5 in all my modules:

<dependency>
    <groupId>org.cassandraunit</groupId>
    <artifactId>cassandra-unit</artifactId>
    <scope>test</scope>
    <exclusions>
        <exclusion>
            <groupId>org.apache.cassandra</groupId>
            <artifactId>cassandra-all</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.hectorclient</groupId>
            <artifactId>hector-core</artifactId>
        </exclusion>
        <exclusion>
            <groupId>com.googlecode.concurrentlinkedhashmap</groupId>
            <artifactId>concurrentlinkedhashmap-lru</artifactId>
        </exclusion>
    </exclusions>
</dependency>
@jsevellec
Copy link
Owner

Hi Marc,

I think it's not a workaround but the simplest solution to deal with that problem.

@marccarre
Copy link
Contributor Author

Hi Jeremy,

Thanks for your reply.
I guess it could be useful to add this to the wiki, under a Troubleshooting / FAQ section?
Let me know if I can help with this.

Besides, after having migrated my projects to cassandra-all 1.1.5, I am now having the below issue when running my unit tests:

java.lang.NoSuchMethodError: org.yaml.snakeyaml.Yaml.loadAs(Ljava/io/InputStream;Ljava/lang/Class;)Ljava/lang/Object;
    at org.cassandraunit.dataset.yaml.AbstractYamlDataSet.getParsedKeyspace(AbstractYamlDataSet.java:32)
    at org.cassandraunit.dataset.commons.AbstractCommonsParserDataSet.getKeyspace(AbstractCommonsParserDataSet.java:30)
    at org.cassandraunit.DataLoader.load(DataLoader.java:59)
    at org.cassandraunit.DataLoader.load(DataLoader.java:55)

... as it seems, cassandra-all 1.1.5 is using:

<dependency>
    <groupId>org.yaml</groupId>
    <artifactId>snakeyaml</artifactId>
    <version>1.6</version>
</dependency>

... while cassandra-unit 1.1.1.2 is using:

<dependency>
    <groupId>org.yaml</groupId>
    <artifactId>snakeyaml</artifactId>
    <version>1.9</version>
</dependency>

Adding the below at the very end of my dependencies block fixed it, though:

<dependency>
    <groupId>org.yaml</groupId>
    <artifactId>snakeyaml</artifactId>
    <version>1.9</version>
    <scope>test</scope>
</dependency>

and hasn't been conflicting with Cassandra (yet?).

Cheers,

Marc.


EDIT:
Just edited the documentation with some explanations and an example.
See also this page

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