当我尝试在蓝图中实例化我的图表时出现初始化错误。这是我用来创建新图表的代码:
String path = "conf/titan-cassandra-" + System.getProperty("env") + ".properties";
Graph graph = TitanFactory.open(path);
正在设置系统属性并且文件存在。TitanFactory 中抛出错误:
final Pattern p = Pattern.compile("(" +
Pattern.quote(GraphDatabaseConfiguration.STORAGE_NS.getName()) + "\\..*" + "(" +
Pattern.quote(GraphDatabaseConfiguration.STORAGE_DIRECTORY.getName()) + "|" +
Pattern.quote(GraphDatabaseConfiguration.STORAGE_CONF_FILE.getName()) + ")" + "|" +
Pattern.quote(GraphDatabaseConfiguration.INDEX_NS.getName()) + "\\..*" + "(" +
Pattern.quote(GraphDatabaseConfiguration.INDEX_DIRECTORY.getName()) + "|" +
Pattern.quote(GraphDatabaseConfiguration.INDEX_CONF_FILE.getName()) + ")" + ")");
评估表达式 GraphDatabaseConfiguration.STORAGE_NS 会产生“null”。为什么会这样?
编辑:
我也包括堆栈跟踪
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.commons.lang.StringUtils.containsAny(Ljava/lang/String;[C)Z
at com.thinkaurelius.titan.diskstorage.configuration.ConfigElement.<init>(ConfigElement.java:26)
at com.thinkaurelius.titan.diskstorage.configuration.ConfigNamespace.<init>(ConfigNamespace.java:19)
at com.thinkaurelius.titan.diskstorage.configuration.ConfigNamespace.<init>(ConfigNamespace.java:24)
at com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.<clinit>(GraphDatabaseConfiguration.java:81)
at com.thinkaurelius.titan.core.TitanFactory.getLocalConfiguration(TitanFactory.java:240)
at com.thinkaurelius.titan.core.TitanFactory.getLocalConfiguration(TitanFactory.java:170)
at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:61)
at io.fama.api.service.GraphHolder.populateGraph(GraphHolder.java:28)
at io.fama.api.service.GraphHolder.graph(GraphHolder.java:21)
at io.fama.api.DebugTests.main(DebugTests.java:7)
当 Maven 运行测试时,它会引发不同的错误。这看起来与依赖关系有关。