Dear experts,
I met some dependency issue with titan+cassandra setup.
I started a gremlin-server+titan+cassandra+elasticsearch using the titan.sh from 1.0.0 dist zip folder.
and in my java application I'm trying to create a TitanGraph connecting to the cassandra instance running in the same host.
the titan configuration is like below:
-------------------------------------------------------------------------------------------------------------------------
storage.backend=cassandrathrift
storage.hostname=127.0.0.1
#storage.hostname=192.168.0.61
cache.db-cache=true
cache.db-cache-clean-wait=20
cache.db-cache-time=180000
cache.db-cache-size=0.25
index.search.backend=elasticsearch
index.search.hostname=127.0.0.1
index.search.elasticsearch.client-only=true
------------------------------------------------------------------------------------------------------------------------
and my pom file is including titan-all:1.0.0
--------------------------------------------------------------------------------------------------------------------------
<dependency>
<groupId>com.thinkaurelius.titan</groupId>
<artifactId>titan-all</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.thinkaurelius.titan</groupId>
<artifactId>titan-solr</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-expressions</artifactId>
<version>4.10.4</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-codecs</artifactId>
<version>4.10.4</version>
</dependency>
----------------------------------------------------------------------------------------------------------------------------
The problem I'm having now is that even the configuration file specifies elasticsearch, the server is still trying to load the solr related classes, and while doing elasticsearch indexing, the server again run into error with NoClassDefFoundError for org.apache.lucene.codecs.CompoundFormat. See the stack trace below.
Is there other dependencies that need to add so that I could connect properly?
10:15:20.757 [main] DEBUG com.thinkaurelius.titan.core.util.ReflectiveConfigOptionLoader - Unable to load class com.thinkaurelius.titan.diskstorage.solr.SolrIndex with selected loader sun.misc.Launcher$AppClassLoader@c387f44
java.lang.NoClassDefFoundError: org/apache/solr/client/solrj/impl/HttpSolrClient$RemoteSolrException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at com.thinkaurelius.titan.core.util.ReflectiveConfigOptionLoader.loadStandard(ReflectiveConfigOptionLoader.java:136)
at com.thinkaurelius.titan.diskstorage.configuration.ConfigNamespace.getChild(ConfigNamespace.java:68)
at com.thinkaurelius.titan.diskstorage.configuration.ConfigElement.parse(ConfigElement.java:180)
at com.thinkaurelius.titan.diskstorage.configuration.BasicConfiguration.getAll(BasicConfiguration.java:80)
at com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.<init>(GraphDatabaseConfiguration.java:1327)
at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:94)
at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:74)
at com.zqykj.TitanDataReader.main(TitanDataReader.java:28)
Caused by: java.lang.ClassNotFoundException: org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException
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)
... 10 common frames omitted
and after connecting the titan instance will throw other exceptions like below:
10:15:32.085 [elasticsearch[Batwing][clusterService#updateTask][T#1]] WARN org.elasticsearch.indices.cluster - [Batwing] [[titan][1]] marking and sending shard failed due to [failed to create index]
org.elasticsearch.indices.IndexCreationException: [titan] failed to create index
....
Caused by: java.lang.ClassNotFoundException: org.apache.lucene.codecs.CompoundFormat
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)
... 29 common frames omitted