Skip to content
This repository has been archived by the owner on Oct 5, 2021. It is now read-only.
This repository has been archived by the owner on Oct 5, 2021. It is now read-only.

ClassNotFoundException: com.thinkaurelius.titan.diskstorage.es.ElasticSearchIndex #25

Closed
jordi-chacon opened this issue Jan 9, 2016 · 2 comments

Comments

@jordi-chacon
Copy link

Hi,

I am trying to configure DynamoDB Local as backend for my Titan database. Up until now I have been using BerkeleyDB.

My build.gradle file looks like this:

plugins {
  id 'groovy'
  id 'com.github.johnrengelman.shadow' version '1.2.1'
  id 'net.saliman.cobertura' version '2.2.7'
}

archivesBaseName = '....'
apply plugin: 'groovy'

repositories {
    mavenCentral()
    jcenter()
    flatDir {
        dirs 'lib'
    }
    maven {
        url "https://jitpack.io"
    }
    maven {
        url "http://dynamodb-local.s3-website-us-west-2.amazonaws.com/release"
    }
}

dependencies {
    compile 'org.codehaus.groovy:groovy-all:2.4.5'
    compile 'commons-configuration:commons-configuration:1.10'
    compile 'com.thinkaurelius.titan:titan-core:1.0.0'
    compile 'com.thinkaurelius.titan:titan-berkeleyje:1.0.0'
    compile 'com.amazonaws:dynamodb-titan100-storage-backend:1.0.0'
    compile 'com.amazonaws:aws-java-sdk-dynamodb:1.10.45'
    compile 'com.amazonaws:DynamoDBLocal:1.10.20'
    compile fileTree(dir: 'lib', include: ['*.jar'])
    testCompile "org.spockframework:spock-core:1.0-groovy-2.4"
    testRuntime 'org.objenesis:objenesis:2.2'
    testRuntime "com.github.cglib.cglib:cglib-nodep:5503bcca74"
}

I configure my Graph instance like this: TitanFactory.open("dynamodblocal.properties") where that properties file is basically this file (https://github.com/awslabs/dynamodb-titan-storage-backend/blob/1.0.0/src/test/resources/dynamodb-local.properties) except that I have removed the last 5 lines related to index search.

I do not want to perform any index search and thus I do not want ElasticSearch, that is why I have removed the last 5 lines of the properties file.

When I run my application, an exception is thrown when opening the properties file:

java.lang.IllegalArgumentException: Could not find implementation class: com.thinkaurelius.titan.diskstorage.es.ElasticSearchIndex
        at com.thinkaurelius.titan.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:47)
        at com.thinkaurelius.titan.diskstorage.Backend.getImplementationClass(Backend.java:473)
        at com.thinkaurelius.titan.diskstorage.Backend.getIndexes(Backend.java:460)
        at com.thinkaurelius.titan.diskstorage.Backend.<init>(Backend.java:147)
        at com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.getBackend(GraphDatabaseConfiguration.java:1805)
        at com.thinkaurelius.titan.graphdb.database.StandardTitanGraph.<init>(StandardTitanGraph.java:123)
        at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:94)
        at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:62)
        at com.....Titan.getInstance(Titan.groovy:63)
        at com.....node.Control.<init>(Control.groovy:25)
        at com.....node.ControlSpec.$spock_initializeFields(ControlSpec.groovy:34)

        Caused by:
        java.lang.ClassNotFoundException: com.thinkaurelius.titan.diskstorage.es.ElasticSearchIndex
            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)
            at java.lang.Class.forName(Class.java:264)
            at com.thinkaurelius.titan.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:42)

I do not understand why the ElasticSearchIndex class is fetched, since I have not specified it anywhere.

Just to verify that this doesn't have to do with my code, I have changed the properties file to the following:

storage.backend=berkeleyje
storage.directory=/tmp/foo

And this works just fine.

I can avoid the exception by adding titan-es to my build.gradle file, but I would like to avoid that as I am not using ElasticSearch.

Any ideas how I can avoid including titan-es in my project?
Thanks!

@amcp
Copy link
Contributor

amcp commented Jan 11, 2016

Is it possible you opened the graph once with the es properties included, and then deleted them afterwards? Or, Is it enough to just open a fresh new graph without the Es lines to get this error?

@jordi-chacon
Copy link
Author

You are correct Alexander!
Restarting DynamoDBLocal did the trick. Now I can run my project without the titan-es dependency.
Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants