如何使用嵌入式Cassandra将Java与Titan连接起来
我安装了如何使用嵌入式Cassandra将Java与Titan连接起来,java,cassandra,titan,Java,Cassandra,Titan,我安装了titan-cassandra-0.4.4,我可以完美地运行cassandra和gremlin(本地节点) 我想用Java测试一个算法,所以我需要将Java连接到titan。 我的pom是: <dependency> <groupId>com.thinkaurelius.titan</groupId> <artifactId>titan-core</artifactId>
titan-cassandra-0.4.4
,我可以完美地运行cassandra和gremlin(本地节点)
我想用Java测试一个算法,所以我需要将Java连接到titan。
我的pom是:
<dependency>
<groupId>com.thinkaurelius.titan</groupId>
<artifactId>titan-core</artifactId>
<version>0.4.4</version>
</dependency>
在最后一行中,错误是:
Exception in thread "main" java.lang.NoClassDefFoundError: com/netflix/astyanax/connectionpool/exceptions/ConnectionException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.thinkaurelius.titan.diskstorage.Backend.getStorageManager(Backend.java:202)
at com.thinkaurelius.titan.diskstorage.Backend.<init>(Backend.java:97)
at com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.getBackend(GraphDatabaseConfiguration.java:398)
at com.thinkaurelius.titan.graphdb.database.StandardTitanGraph.<init>(StandardTitanGraph.java:78)
at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:60)
at Connecting.main(Connecting.java:20)
Caused by: java.lang.ClassNotFoundException: com.netflix.astyanax.connectionpool.exceptions.ConnectionException
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 8 more
线程“main”java.lang.NoClassDefFoundError中的异常:com/netflix/astyanax/connectionpool/exceptions/ConnectionException
位于java.lang.Class.forName0(本机方法)
位于java.lang.Class.forName(Class.java:264)
位于com.thinkaurelius.titan.diskstorage.Backend.getStorageManager(Backend.java:202)
位于com.thinkaurelius.titan.diskstorage.Backend.(Backend.java:97)
位于com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.getBackend(GraphDatabaseConfiguration.java:398)
位于com.thinkaurelius.titan.graphdb.database.StandardTitanGraph.(StandardTitanGraph.java:78)
位于com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:60)
at Connecting.main(Connecting.java:20)
原因:java.lang.ClassNotFoundException:com.netflix.astyanax.connectionpool.exceptions.ConnectionException
位于java.net.URLClassLoader.findClass(URLClassLoader.java:381)
位于java.lang.ClassLoader.loadClass(ClassLoader.java:424)
位于sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
位于java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 8个以上
我首先启动cassandra,然后启动titan gremlin.sh,最后运行java代码。我不知道我是否错过了什么
提前谢谢 您应该包含对
titan casssandra
的依赖项
<dependency>
<groupId>com.thinkaurelius.titan</groupId>
<artifactId>titan-casssandra</artifactId>
<version>0.4.4</version>
</dependency>
com.thinkaurelius.titan
<dependency>
<groupId>com.thinkaurelius.titan</groupId>
<artifactId>titan-casssandra</artifactId>
<version>0.4.4</version>
</dependency>