1
votes

Tried to start titan with the following code:

 TitanFactory.Builder config = TitanFactory.build();
    config.set("storage.backend", "embeddedcassandra");
    config.set("storage.directory", DIRECTORY);
    graph = config.open();

But, got the following exception.

Exception in thread "main" java.lang.IllegalArgumentException: Could not instantiate implementation: com.thinkaurelius.titan.diskstorage.cassandra.embedded.CassandraEmbeddedStoreManager at com.thinkaurelius.titan.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:55) at com.thinkaurelius.titan.diskstorage.Backend.getImplementationClass(Backend.java:473) at com.thinkaurelius.titan.diskstorage.Backend.getStorageManager(Backend.java:407) at com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.(GraphDatabaseConfiguration.java:1320) at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:94) at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:84) at com.thinkaurelius.titan.core.TitanFactory$Builder.open(TitanFactory.java:139) at main.java.com.bag.server.database.TitanDatabaseAccess.start(TitanDatabaseAccess.java:55) at main.java.com.bag.server.TestServer.(TestServer.java:105) at main.java.com.bag.server.TestServer.main(TestServer.java:429) 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:498) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at com.thinkaurelius.titan.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:44) ... 14 more Caused by: java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.format(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String; at org.slf4j.impl.JDK14LoggerAdapter.info(JDK14LoggerAdapter.java:303) at com.thinkaurelius.titan.diskstorage.cassandra.utils.CassandraDaemonWrapper.start(CassandraDaemonWrapper.java:69) at com.thinkaurelius.titan.diskstorage.cassandra.embedded.CassandraEmbeddedStoreManager.(CassandraEmbeddedStoreManager.java:81) ... 19 more

Trying to run it on Linux in Intellij - java.

1

1 Answers

0
votes

This may be because you have not started Embedded Cassandra. Titan does not do that automatically for you I think. You can start embedded Cassandra with:

EmbeddedCassandraServerHelper.startEmbeddedCassandra();

for example. Or with

EmbeddedCassandraServerHelper.startEmbeddedCassandra("cassandra.yaml");

If you have a custom config to pass through.

Edit:

The above helper class is available by adding the following dependency to your project:

<dependency>
    <groupId>org.cassandraunit</groupId>
    <artifactId>cassandra-unit</artifactId>
    <version>2.1.9.2</version>
</dependency>