TransportException + Fatal configuration error (cannot locate cassandra.yaml)

226 views
Skip to first unread message

Andy Leung

unread,
Sep 18, 2014, 3:17:17 PM9/18/14
to cassandra-...@googlegroups.com
Hi everyone,

I'm new to CassandraUnit and I have a few questions.

I'm getting a com.datastax.driver.core.TransportException being thrown when I ran the examples. Is this normal?

Also, when I try using CassandraUnit, I get the following error message:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/andyleung/.m2/repository/ch/qos/logback/logback-classic/1.0.13/logback-classic-1.0.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/andyleung/.m2/repository/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
Cannot locate cassandra.yaml
Fatal configuration error; unable to start. See log for stacktrace.
2014-09-18 15:11:36.435 [main] ERROR o.a.c.config.DatabaseDescriptor - Fatal configuration error
org.apache.cassandra.exceptions.ConfigurationException: Cannot locate cassandra.yaml
at org.apache.cassandra.config.YamlConfigurationLoader.getStorageConfigURL(YamlConfigurationLoader.java:64) ~[cassandra-all-2.0.5.jar:2.0.5]
at org.apache.cassandra.config.YamlConfigurationLoader.loadConfig(YamlConfigurationLoader.java:75) ~[cassandra-all-2.0.5.jar:2.0.5]
at org.apache.cassandra.config.DatabaseDescriptor.loadConfig(DatabaseDescriptor.java:134) ~[cassandra-all-2.0.5.jar:2.0.5]
at org.apache.cassandra.config.DatabaseDescriptor.<clinit>(DatabaseDescriptor.java:110) ~[cassandra-all-2.0.5.jar:2.0.5]
at org.cassandraunit.utils.EmbeddedCassandraServerHelper.dropKeyspaces(EmbeddedCassandraServerHelper.java:140) [cassandra-unit-2.0.2.1.jar:na]
at org.cassandraunit.utils.EmbeddedCassandraServerHelper.cleanEmbeddedCassandra(EmbeddedCassandraServerHelper.java:136) [cassandra-unit-2.0.2.1.jar:na]
at org.cassandraunit.spring.AbstractCassandraUnitTestExecutionListener.cleanServer(AbstractCassandraUnitTestExecutionListener.java:103) [cassandra-unit-spring-2.0.2.1.jar:na]
at org.cassandraunit.spring.CassandraUnitTestExecutionListener.afterTestMethod(CassandraUnitTestExecutionListener.java:23) [cassandra-unit-spring-2.0.2.1.jar:na]
at org.springframework.test.context.TestContextManager.afterTestMethod(TestContextManager.java:409) [spring-test-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:91) [spring-test-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72) [spring-test-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:233) [spring-test-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:87) [spring-test-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) [junit-4.8.2.jar:na]
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) [junit-4.8.2.jar:na]
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) [junit-4.8.2.jar:na]
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) [junit-4.8.2.jar:na]
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) [junit-4.8.2.jar:na]
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) [spring-test-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71) [spring-test-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.junit.runners.ParentRunner.run(ParentRunner.java:236) [junit-4.8.2.jar:na]
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:176) [spring-test-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) [.cp/:na]
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) [.cp/:na]
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) [.cp/:na]
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) [.cp/:na]
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) [.cp/:na]
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) [.cp/:na]

I added the dependencies in my pom.xml file (including cassandra-unit-spring and cassandra-unit). I get the same error regardless if I have cassandra-unit or not. 
 
Thanks in advance :)

Romain Sertelon

unread,
Sep 26, 2014, 9:36:16 AM9/26/14
to cassandra-...@googlegroups.com
Hi,

I've seen this error on my project too using CassandraUnit for Spring.

This seems to be caused by the server not starting.

Indeed, the good path for the configuration is configured in the starting part of the embedded server (it's a system property).

In your case, (and in mine also), it was not set, and I could see that the start method wasn't even called.

It seems to me that it is a bug, or an incompatibility of Spring versions. I was running spring 3.2 whereas CassandraUnit uses Spring 4 in its latest version.

I "solved" my problem using the CassandraCQLUnit class.

Hope this helps !

Romain Sertelon

unread,
Sep 26, 2014, 10:01:15 AM9/26/14
to cassandra-...@googlegroups.com
BTW upgrading to Spring 4 solves the problem in part.

Now I'm facing a problem where my beans are wired before the cassandra server has started. This is bad for me because one of my beans actually connects on @PostConstruct. If it fails,nothing works until reconnection is attempted, which is not what I want in testing environment.

Is it possible to force the embedded server to start before any wireing is done by Spring?

Thanks,
Reply all
Reply to author
Forward
0 new messages