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
yaml file not in root directory prevents startup #135
Comments
I've the same issue here |
@szetheli @dariodariodario Did you guys find any workaround for this issue? |
Have same issue by the way. It is reads the
value that we did previously set when did preparing embedded cassandra. file:D:/github/cassandra-unit/cassandra-unit/target/embeddedCassandra/another-cassandra.yaml cassnadra checks for correct url doing
And sometimes it is treated as correct url sometimes not. If you have a pom-based project and a /target folder will be on classpath - like in cassandra-unit tests in file To fix this behaviour we just need to set correct "cassandra.config" value which should be like:
That the issue for cassandra-unit. In general to validate url better to use
...and only after that attempt to open/close to have final check - that a issue for cassandra. Since even strictly says incorrect url can be resolved under some circumstances. |
hi @prakapenka, thanks for the investigation. I'm looking forward to the PR ;-) |
Hi @prakapenka do you know if the issue is resolved or if the PR was accepted after the fix ? I am still getting the issue in now |
I think i am also seeing this problem but am a new user to cassandra so it may be something else. |
hey @jsevellec, the problem is still there :) |
Sorry for the latency... That should be solved. While waiting for the next release, snapshot is already available with the fix if you want to give it a try (3.7.1.1-SNAPSHOT : https://oss.sonatype.org/content/repositories/snapshots/) |
When is this being released? |
Yeah, when is it going to be released? |
testCompile('org.cassandraunit:cassandra-unit:2.1.3.1')
testCompile('org.apache.cassandra:cassandra-all:2.1.8')
testCompile 'com.google.guava:guava:18.0'
EmbeddedCassandraServerHelper.startEmbeddedCassandra("config/cassandra.yaml");
Results in exception:
2015-07-30 14:37:45,098 EventType=ERROR LogName=org.apache.cassandra.config.DatabaseDescriptor [main,{}]:
Fatal configuration error
org.apache.cassandra.exceptions.ConfigurationException: Expecting URI in variable: [cassandra.config]. Please prefix the file with file:/// for local files or file:/// for remote files. Aborting. If you are executing this from an external tool, it needs to set Config.setClientMode(true) to avoid loading configuration.
at org.apache.cassandra.config.YamlConfigurationLoader.getStorageConfigURL(YamlConfigurationLoader.java:73)
at org.apache.cassandra.config.YamlConfigurationLoader.loadConfig(YamlConfigurationLoader.java:84)
at org.apache.cassandra.config.DatabaseDescriptor.loadConfig(DatabaseDescriptor.java:161)
at org.apache.cassandra.config.DatabaseDescriptor.(DatabaseDescriptor.java:136)
at org.cassandraunit.utils.EmbeddedCassandraServerHelper.mkdirs(EmbeddedCassandraServerHelper.java:244)
at org.cassandraunit.utils.EmbeddedCassandraServerHelper.cleanupAndLeaveDirs(EmbeddedCassandraServerHelper.java:216)
at org.cassandraunit.utils.EmbeddedCassandraServerHelper.startEmbeddedCassandra(EmbeddedCassandraServerHelper.java:107)
at org.cassandraunit.utils.EmbeddedCassandraServerHelper.startEmbeddedCassandra(EmbeddedCassandraServerHelper.java:77)
at org.cassandraunit.utils.EmbeddedCassandraServerHelper.startEmbeddedCassandra(EmbeddedCassandraServerHelper.java:57)
at org.cassandraunit.utils.EmbeddedCassandraServerHelper.startEmbeddedCassandra(EmbeddedCassandraServerHelper.java:53)
at com.expedia.www.optimus.storage.SessionManagerUnitTests.testSessionFromNewCluster(SessionManagerUnitTests.java:239)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Expecting URI in variable: [cassandra.config]. Please prefix the file with file:/// for local files or file:/// for remote files. Aborting. If you are executing this from an external tool, it needs to set Config.setClientMode(true) to avoid loading configuration.
Fatal configuration error; unable to start. See log for stacktrace.
What went wrong:
org.cassandraunit.utils.EmbeddedCassandraServerHelper.copy(String, String) copies the file to target/embeddedCassandra/cassandra.yaml because copy strips off all the path information from the from string.
org.cassandraunit.utils.EmbeddedCassandraServerHelper.startEmbeddedCassandra(String, String, long) appends the string as is to build the property to send to cassandra.
Either the copy task needs to be preserve the path passed in, or startEmbeddedCassandra is the one that needs to strip path information.
The text was updated successfully, but these errors were encountered: