在cassandra.config中找到cassandra.config中的Cassandra源代码ConfigurationException期望URI [英] Cassandra source code ConfigurationException expection URI in cassandra.config found cassandra.yaml

查看:267
本文介绍了在cassandra.config中找到cassandra.config中的Cassandra源代码ConfigurationException期望URI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我的硕士论文,我必须修改Cassandra的源代码。因此,根据 https://wiki.apache.org/cassandra/HowToBuild 的建议,我git clone,然后运行ant,一切似乎都很好(我设法构建了项目,没有任何错误),但是当我运行unitTests(cassandra / test)时,我遇到了一个奇怪的错误:

For my master thesis, I have to modify the source code of Cassandra. So, as suggested by https://wiki.apache.org/cassandra/HowToBuild, I git clone, then run ant, and everything seems nice (I managed to build the project without any error), but when I run the unitTests (cassandra/test), I have this strange error:

org.apache.cassandra.exceptions.ConfigurationException: 
   Expecting URI in variable: [cassandra.config]. 
   Found[cassandra.yaml]. 
   Please prefix the file with [file:\\\] for local files and 
      [file:\\<server>\] for remote files. 
   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:80)
    at org.apache.cassandra.config.YamlConfigurationLoader.loadConfig(YamlConfigurationLoader.java:100)
    at org.apache.cassandra.config.DatabaseDescriptor.loadConfig(DatabaseDescriptor.java:252)
    at org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:131)
    at org.apache.cassandra.auth.jmx.AuthorizationProxyTest.setup(AuthorizationProxyTest.java:48)"

我想用unitTests在源代码上测试我的修改(因为我没有找到有关如何在Windows上从源代码设置cassandra的任何教程,因此,如果您有一个教程,我想获得链接^^),但是我没有找到解决此错误的任何方法:(。任何人都知道该问题的解决方法吗?

I would like to test my modifications on the source code with the unitTests (because I didn't find any tutorial of how to set up cassandra from the source code on Windows, so if you have one, I would like to have the link ^^) but I didn't manage to find any solution for this bug :(. Anyone know a solution to this problem?

我正在使用IntelliJ在Windows 10上工作而且我已经将我的Jdk和蚂蚁更新到la测试版本。

I am working on Windows 10 with IntelliJ and I have updated my Jdk and ant to the latest version.

推荐答案

我遇到了同样的问题。这些变量( cassandra.config, cassandra.storagedir等) 系统变量

I was facing the same issue. Those variables ("cassandra.config", "cassandra.storagedir", etc...) are System variables.

您可以通过以下操作在代码中进行设置:

You can either set them in your code by doing something like:

System.setProperty("cassandra.config", "file:///<PATH>/cassandra.yaml");

您还可以在运行jar文件时对其进行设置:

You can also set them whilst running the jar file:

java -Dcassandra.config=file:///<PATH>/cassandra.yaml -jar <JAR>

最好,

Shabir

这篇关于在cassandra.config中找到cassandra.config中的Cassandra源代码ConfigurationException期望URI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆