Titan loading problems with elastic search - java

I'm using the following code to load Titan:
TitanFactory.Builder config = TitanFactory.build();
config.set("storage.backend", "berkeleyje");
config.set("storage.directory", DIRECTORY);
//config.set("storage.conf-file", "file:////" + DIRECTORY + "/cassandra/cassandra.yaml");
config.set("index." + INDEX_NAME + ".backend", "elasticsearch");
config.set("index." + INDEX_NAME + ".DIRECTORY", DIRECTORY + File.separator + "es");
config.set("index." + INDEX_NAME + ".elasticsearch.local-mode", true);
config.set("index." + INDEX_NAME + ".elasticsearch.client-only", false);
graph = config.open();
loading dependencies with gradle:
compile group: 'com.thinkaurelius.titan', name: 'titan-all', version: '1.0.0'
My project directory is:
/home/ray/IdeaProjects/BAG - Byzantine fault-tolerant Architecture for Graph database/
my titan is in this project directory in the folder "TITAN"
That's what I set in the Directory variable.
Still on start it always crashes:
22:56:01.420 [main] DEBUG c.t.t.d.b.BerkeleyJEStoreManager - Opened database system_properties
java.lang.Throwable: null
at com.thinkaurelius.titan.diskstorage.berkeleyje.BerkeleyJEStoreManager.openDatabase(BerkeleyJEStoreManager.java:172) [titan-berkeleyje-1.0.0.jar:na]
at com.thinkaurelius.titan.diskstorage.berkeleyje.BerkeleyJEStoreManager.openDatabase(BerkeleyJEStoreManager.java:34) [titan-berkeleyje-1.0.0.jar:na]
at com.thinkaurelius.titan.diskstorage.keycolumnvalue.keyvalue.OrderedKeyValueStoreManagerAdapter.openDatabase(OrderedKeyValueStoreManagerAdapter.java:76) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.diskstorage.keycolumnvalue.keyvalue.OrderedKeyValueStoreManagerAdapter.openDatabase(OrderedKeyValueStoreManagerAdapter.java:69) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.diskstorage.keycolumnvalue.keyvalue.OrderedKeyValueStoreManagerAdapter.openDatabase(OrderedKeyValueStoreManagerAdapter.java:25) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.diskstorage.Backend.getStandaloneGlobalConfiguration(Backend.java:449) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.<init>(GraphDatabaseConfiguration.java:1322) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:94) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:84) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.core.TitanFactory$Builder.open(TitanFactory.java:139) [titan-core-1.0.0.jar:na]
at main.java.com.bag.server.database.TitanDatabaseAccess.start(TitanDatabaseAccess.java:56) [main/:na]
at main.java.com.bag.server.TestServer.<init>(TestServer.java:105) [main/:na]
at main.java.com.bag.server.TestServer.main(TestServer.java:428) [main/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_112]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_112]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_112]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_112]
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) [idea_rt.jar:na]
22:56:01.423 [main] DEBUG c.t.t.d.k.k.OrderedKeyValueStoreAdapter - Used key length 0 for database system_properties
22:56:01.429 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader$LoaderConfiguration - Option loading enabled by default
22:56:01.431 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Added preferred classloader to config option loader chain: sun.misc.Launcher$AppClassLoader#63e31ee
22:56:01.431 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Added thread context classloader to config option loader chain: sun.misc.Launcher$AppClassLoader#63e31ee
22:56:01.431 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Added caller classloader to config option loader chain: sun.misc.Launcher$AppClassLoader#63e31ee
22:56:01.442 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Loaded class com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager with loader sun.misc.Launcher$AppClassLoader#63e31ee
22:56:01.442 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Located functioning classloader sun.misc.Launcher$AppClassLoader#63e31ee; using it for remaining classload attempts
22:56:01.447 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Loaded class com.thinkaurelius.titan.diskstorage.cassandra.astyanax.AstyanaxStoreManager with selected loader sun.misc.Launcher$AppClassLoader#63e31ee
22:56:01.447 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Loaded class com.thinkaurelius.titan.diskstorage.cassandra.AbstractCassandraStoreManager with selected loader sun.misc.Launcher$AppClassLoader#63e31ee
22:56:01.452 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Loaded class com.thinkaurelius.titan.diskstorage.cassandra.thrift.CassandraThriftStoreManager with selected loader sun.misc.Launcher$AppClassLoader#63e31ee
22:56:01.459 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Loaded class com.thinkaurelius.titan.diskstorage.es.ElasticSearchIndex with selected loader sun.misc.Launcher$AppClassLoader#63e31ee
22:56:01.460 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Unable to load class com.thinkaurelius.titan.diskstorage.solr.SolrIndex with selected loader sun.misc.Launcher$AppClassLoader#63e31ee
java.lang.ClassNotFoundException: com.thinkaurelius.titan.diskstorage.solr.SolrIndex
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_112]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_112]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) ~[na:1.8.0_112]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_112]
at java.lang.Class.forName0(Native Method) ~[na:1.8.0_112]
at java.lang.Class.forName(Class.java:348) ~[na:1.8.0_112]
at com.thinkaurelius.titan.core.util.ReflectiveConfigOptionLoader.loadStandard(ReflectiveConfigOptionLoader.java:136) ~[titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.diskstorage.configuration.ConfigNamespace.getChild(ConfigNamespace.java:68) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.diskstorage.configuration.ConfigElement.parse(ConfigElement.java:180) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.diskstorage.configuration.BasicConfiguration.getAll(BasicConfiguration.java:80) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.<init>(GraphDatabaseConfiguration.java:1327) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:94) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:84) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.core.TitanFactory$Builder.open(TitanFactory.java:139) [titan-core-1.0.0.jar:na]
at main.java.com.bag.server.database.TitanDatabaseAccess.start(TitanDatabaseAccess.java:56) [main/:na]
at main.java.com.bag.server.TestServer.<init>(TestServer.java:105) [main/:na]
at main.java.com.bag.server.TestServer.main(TestServer.java:428) [main/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_112]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_112]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_112]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_112]
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) [idea_rt.jar:na]
22:56:01.462 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Loaded class com.thinkaurelius.titan.diskstorage.log.kcvs.KCVSLog with selected loader sun.misc.Launcher$AppClassLoader#63e31ee
22:56:01.463 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Loaded class com.thinkaurelius.titan.diskstorage.log.kcvs.KCVSLogManager with selected loader sun.misc.Launcher$AppClassLoader#63e31ee
22:56:01.463 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Loaded class com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration with selected loader sun.misc.Launcher$AppClassLoader#63e31ee
22:56:01.464 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Loaded class com.thinkaurelius.titan.graphdb.database.idassigner.placement.SimpleBulkPlacementStrategy with selected loader sun.misc.Launcher$AppClassLoader#63e31ee
22:56:01.465 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Loaded class com.thinkaurelius.titan.graphdb.database.idassigner.VertexIDAssigner with selected loader sun.misc.Launcher$AppClassLoader#63e31ee
22:56:01.465 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Loaded class com.thinkaurelius.titan.diskstorage.berkeleyje.BerkeleyJEStoreManager with selected loader sun.misc.Launcher$AppClassLoader#63e31ee
22:56:01.465 [main] INFO c.t.t.c.u.ReflectiveConfigOptionLoader - Loaded and initialized config classes: 11 OK out of 12 attempts in PT0.035S
22:56:01.466 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Added preferred classloader to config option loader chain: sun.misc.Launcher$AppClassLoader#63e31ee
22:56:01.466 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Added thread context classloader to config option loader chain: sun.misc.Launcher$AppClassLoader#63e31ee
22:56:01.466 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Added caller classloader to config option loader chain: sun.misc.Launcher$AppClassLoader#63e31ee
22:56:01.493 [main] DEBUG org.reflections.Reflections - going to scan these urls:
file:/home/ray/IdeaProjects/BAG%20-%20Byzantine%20fault-tolerant%20Architecture%20for%20Graph%20database/build/classes/main/
22:56:01.497 [main] DEBUG org.reflections.Reflections - could not scan file main/java/com/bag/server/TestServer.class in url file:/home/ray/IdeaProjects/BAG%20-%20Byzantine%20fault-tolerant%20Architecture%20for%20Graph%20database/build/classes/main/ with scanner TypeAnnotationsScanner
22:56:01.497 [main] DEBUG org.reflections.Reflections - could not scan file main/java/com/bag/server/TestServer.class in url file:/home/ray/IdeaProjects/BAG%20-%20Byzantine%20fault-tolerant%20Architecture%20for%20Graph%20database/build/classes/main/ with scanner SubTypesScanner
22:56:01.497 [main] DEBUG org.reflections.Reflections - could not scan file main/java/com/bag/server/ConflictHandler.class in url file:/home/ray/IdeaProjects/BAG%20-%20Byzantine%20fault-tolerant%20Architecture%20for%20Graph%20database/build/classes/main/ with scanner TypeAnnotationsScanner
22:56:01.498 [main] DEBUG org.reflections.Reflections - could not scan file main/java/com/bag/server/ConflictHandler.class in url file:/home/ray/IdeaProjects/BAG%20-%20Byzantine%20fault-tolerant%20Architecture%20for%20Graph%20database/build/classes/main/ with scanner SubTypesScanner
22:56:01.502 [main] DEBUG org.reflections.Reflections - could not scan file main/java/com/bag/server/database/Neo4jDatabaseAccess.class in url file:/home/ray/IdeaProjects/BAG%20-%20Byzantine%20fault-tolerant%20Architecture%20for%20Graph%20database/build/classes/main/ with scanner TypeAnnotationsScanner
22:56:01.503 [main] DEBUG org.reflections.Reflections - could not scan file main/java/com/bag/server/database/Neo4jDatabaseAccess.class in url file:/home/ray/IdeaProjects/BAG%20-%20Byzantine%20fault-tolerant%20Architecture%20for%20Graph%20database/build/classes/main/ with scanner SubTypesScanner
22:56:01.506 [main] DEBUG org.reflections.Reflections - could not scan file main/java/com/bag/server/database/OrientDBDatabaseAccess.class in url file:/home/ray/IdeaProjects/BAG%20-%20Byzantine%20fault-tolerant%20Architecture%20for%20Graph%20database/build/classes/main/ with scanner TypeAnnotationsScanner
22:56:01.506 [main] DEBUG org.reflections.Reflections - could not scan file main/java/com/bag/server/database/OrientDBDatabaseAccess.class in url file:/home/ray/IdeaProjects/BAG%20-%20Byzantine%20fault-tolerant%20Architecture%20for%20Graph%20database/build/classes/main/ with scanner SubTypesScanner
22:56:01.508 [main] DEBUG org.reflections.Reflections - could not scan file main/java/com/bag/client/TestClient.class in url file:/home/ray/IdeaProjects/BAG%20-%20Byzantine%20fault-tolerant%20Architecture%20for%20Graph%20database/build/classes/main/ with scanner TypeAnnotationsScanner
22:56:01.508 [main] DEBUG org.reflections.Reflections - could not scan file main/java/com/bag/client/TestClient.class in url file:/home/ray/IdeaProjects/BAG%20-%20Byzantine%20fault-tolerant%20Architecture%20for%20Graph%20database/build/classes/main/ with scanner SubTypesScanner
22:56:01.516 [main] INFO org.reflections.Reflections - Reflections took 22 ms to scan 1 urls, producing 6 keys and 13 values
22:56:01.518 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Preloaded 0 config option(s) via Reflections (0 class(es) with errors)
22:56:01.518 [main] DEBUG c.t.t.d.c.BasicConfiguration - Ignored configuration entry for index.search.DIRECTORY since it does not map to an option
java.lang.IllegalArgumentException: Unknown configuration element in namespace [root.index]: DIRECTORY
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145) ~[guava-18.0.jar:na]
at com.thinkaurelius.titan.diskstorage.configuration.ConfigElement.parse(ConfigElement.java:181) ~[titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.diskstorage.configuration.BasicConfiguration.getAll(BasicConfiguration.java:80) ~[titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.<init>(GraphDatabaseConfiguration.java:1327) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:94) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:84) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.core.TitanFactory$Builder.open(TitanFactory.java:139) [titan-core-1.0.0.jar:na]
at main.java.com.bag.server.database.TitanDatabaseAccess.start(TitanDatabaseAccess.java:56) [main/:na]
at main.java.com.bag.server.TestServer.<init>(TestServer.java:105) [main/:na]
at main.java.com.bag.server.TestServer.main(TestServer.java:428) [main/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_112]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_112]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_112]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_112]
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) [idea_rt.jar:na]
22:56:01.557 [main] DEBUG c.t.t.d.c.BasicConfiguration - Ignored configuration entry for index.search.DIRECTORY since it does not map to an option
java.lang.IllegalArgumentException: Unknown configuration element in namespace [root.index]: DIRECTORY
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145) ~[guava-18.0.jar:na]
at com.thinkaurelius.titan.diskstorage.configuration.ConfigElement.parse(ConfigElement.java:181) ~[titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.diskstorage.configuration.BasicConfiguration.getAll(BasicConfiguration.java:80) ~[titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.<init>(GraphDatabaseConfiguration.java:1383) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:94) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:84) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.core.TitanFactory$Builder.open(TitanFactory.java:139) [titan-core-1.0.0.jar:na]
at main.java.com.bag.server.database.TitanDatabaseAccess.start(TitanDatabaseAccess.java:56) [main/:na]
at main.java.com.bag.server.TestServer.<init>(TestServer.java:105) [main/:na]
at main.java.com.bag.server.TestServer.main(TestServer.java:428) [main/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_112]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_112]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_112]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_112]
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) [idea_rt.jar:na]
22:56:01.563 [main] DEBUG c.t.t.d.b.BerkeleyJEStoreManager - Removed database system_properties
22:56:01.613 [main] INFO c.t.t.g.c.GraphDatabaseConfiguration - Generated unique-instance-id=c0a8000d21256-Laptop1
22:56:01.641 [main] INFO c.t.titan.diskstorage.Backend - Configuring index [search]
Exception in thread "main" java.lang.IllegalArgumentException: Could not instantiate implementation: com.thinkaurelius.titan.diskstorage.es.ElasticSearchIndex
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.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:84)
at com.thinkaurelius.titan.core.TitanFactory$Builder.open(TitanFactory.java:139)
at main.java.com.bag.server.database.TitanDatabaseAccess.start(TitanDatabaseAccess.java:56)
at main.java.com.bag.server.TestServer.<init>(TestServer.java:105)
at main.java.com.bag.server.TestServer.main(TestServer.java:428)
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)
... 16 more
Caused by: java.lang.NoSuchFieldError: LUCENE_3_6
at org.elasticsearch.Version.<clinit>(Version.java:43)
at com.thinkaurelius.titan.diskstorage.es.ElasticSearchIndex.checkExpectedClientVersion(ElasticSearchIndex.java:1059)
at com.thinkaurelius.titan.diskstorage.es.ElasticSearchIndex.<init>(ElasticSearchIndex.java:186)
... 21 more
My gradle file:
testCompile group: 'junit', name: 'junit', version: '4.11'
compile files('libs/BFT-SMaRt.jar')
compile "org.neo4j:neo4j-enterprise:${neo4jVersion}"
compile group: 'commons-codec', name: 'commons-codec', version: '1.5'
compile group: 'io.netty', name: 'netty-all', version: '4.0.36.Final'
compile group: 'com.thinkaurelius.titan', name: 'titan-all', version: '1.0.0'
compile group: 'com.sparsity', name: 'sparkseejava', version: '5.2.0'
compile group: 'com.orientechnologies', name: 'orientdb-graphdb', version: '2.2.11'
compile group: 'org.jboss.spec.javax.ws.rs', name: 'jboss-jaxrs-api_2.0_spec', version: '1.0.0.Final'
compile group: 'com.esotericsoftware', name: 'kryo', version: '4.0.0'
compile 'com.intellij:annotations:+#jar'
compile group: 'org.apache.tinkerpop', name: 'gremlin-core', version: '3.0.0.M9-incubating'

You should be more specific on your Titan dependencies so you don't pull in unintended artifacts. Instead of using titan-all, try something like this:
compile group: 'com.thinkaurelius.titan', name: 'titan-berkeleyje', version: '1.0.0'
compile group: 'com.thinkaurelius.titan', name: 'titan-es', version: '1.0.0'
You should not need to include gremlin-core explicitly because it is a dependency of titan-core, however if you do add it, it should be aligned with the TinkerPop version that Titan 1.0 uses:
compile group: 'org.apache.tinkerpop', name: 'gremlin-core', version: '3.0.1-incubating'
Updated
Your previous failed attempts have likely created an invalid graph instance stored under DIRECTORY. You must recursively remove DIRECTORY before attempting to create a new graph using the same directory.
Elasticsearch indexing backend does not work with a index.search.DIRECTORY configuration (note the case). This is the relevant part of the stack trace:
Ignored configuration entry for index.search.DIRECTORY since it does not map to an option
java.lang.IllegalArgumentException: Unknown configuration element in namespace [root.index]: DIRECTORY
You can read more about the various Elasticsearch configuration options in Chapter 22 of the Titan documentation.
Instead of Elasticsearch, consider using Lucene. Its configuration looks similar to BerkeleyJE storage, and both are well-suited for a single-machine Titan.
TitanFactory.Builder config = TitanFactory.build();
config.set("storage.backend", "berkeleyje");
config.set("storage.directory", DIRECTORY + File.separator + "berkeleyje");
config.set("index." + INDEX_NAME + ".backend", "lucene");
config.set("index." + INDEX_NAME + ".directory", DIRECTORY + File.separator + "lucene");
graph = config.open();
Also update build.gradle with the dependency for lucene:
compile group: 'com.thinkaurelius.titan', name: 'titan-berkeleyje', version: '1.0.0'
compile group: 'com.thinkaurelius.titan', name: 'titan-lucene', version: '1.0.0'
I'd also recommend trying to build a Titan project without Neo4j, OrientDB, Sparksee, and other non-Titan dependencies first to ensure you have a simple project that works without any dependency conflicts.

You appear to have a classpath issue:
Caused by: java.lang.NoSuchFieldError: LUCENE_3_6 at org.elasticsearch.Version.(Version.java:43)
Titan-es 1.0.0 depends on Elasticsearch 1.5.1 which again depends on Lucene 4.10.4 which has a deprecated field org.apache.lucene.util.Version.LUCENE_3_6. This field was removed in later versions of Lucene. You need to check your classpath and make sure you are pulling in the correct version of Lucene.

Related

Idea unable import maven project

my idea Unable to import Maven project,seems caused by openJDK ,but i dont sure
i use springInitalizr to init a simple spring demo
my computer profile as follows
MacOS mojave 10.14.6
AdaptOpenJDK with version 8.0.222.hs-adpt
maven 3.6.2
idea version is 2019.2.2
2019-09-08 20:23:08,571 [ 9844] INFO - tellij.diagnostic.LoadingPhase - Reached INDEXING_FINISHED loading phase
2019-09-08 20:23:08,682 [ 9955] INFO - CompilerWorkspaceConfiguration - Available processors: 8
2019-09-08 20:23:08,838 [ 10111] INFO - cloudConfig.CloudConfigManager - === StatusBar.start create ===
2019-09-08 20:23:12,679 [ 13952] INFO - ings.impl.UpdateCheckerService - channel: release
2019-09-08 20:23:15,246 [ 16519] ERROR - #org.jetbrains.idea.maven - com.google.inject.CreationException: Unable to create injector, see the following errors:
1) No implementation for org.apache.maven.model.path.PathTranslator was bound.
while locating org.apache.maven.model.path.PathTranslator
for field at org.apache.maven.model.interpolation.AbstractStringBasedModelInterpolator.pathTranslator(Unknown Source)
at org.codehaus.plexus.DefaultPlexusContainer$1.configure(DefaultPlexusContainer.java:350)
2) No implementation for org.apache.maven.model.path.UrlNormalizer was bound.
while locating org.apache.maven.model.path.UrlNormalizer
for field at org.apache.maven.model.interpolation.AbstractStringBasedModelInterpolator.urlNormalizer(Unknown Source)
at org.codehaus.plexus.DefaultPlexusContainer$1.configure(DefaultPlexusContainer.java:350)
2 errors
java.lang.RuntimeException: com.google.inject.CreationException: Unable to create injector, see the following errors:
1) No implementation for org.apache.maven.model.path.PathTranslator was bound.
while locating org.apache.maven.model.path.PathTranslator
for field at org.apache.maven.model.interpolation.AbstractStringBasedModelInterpolator.pathTranslator(Unknown Source)
at org.codehaus.plexus.DefaultPlexusContainer$1.configure(DefaultPlexusContainer.java:350)
2) No implementation for org.apache.maven.model.path.UrlNormalizer was bound.
while locating org.apache.maven.model.path.UrlNormalizer
for field at org.apache.maven.model.interpolation.AbstractStringBasedModelInterpolator.urlNormalizer(Unknown Source)
at org.codehaus.plexus.DefaultPlexusContainer$1.configure(DefaultPlexusContainer.java:350)
2 errors
at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:543)
at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:159)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:106)
at com.google.inject.Guice.createInjector(Guice.java:87)
at com.google.inject.Guice.createInjector(Guice.java:69)
at com.google.inject.Guice.createInjector(Guice.java:59)
at org.codehaus.plexus.DefaultPlexusContainer.addComponent(DefaultPlexusContainer.java:344)
at org.codehaus.plexus.DefaultPlexusContainer.addComponent(DefaultPlexusContainer.java:332)
at org.jetbrains.idea.maven.server.Maven3XServerEmbedder.customizeComponents(Maven3XServerEmbedder.java:573)
at org.jetbrains.idea.maven.server.Maven3XServerEmbedder.customize(Maven3XServerEmbedder.java:542)
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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
at java.rmi/sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:283)
at java.rmi/sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:260)
at java.rmi/sun.rmi.server.UnicastRef.invoke(UnicastRef.java:161)
at java.rmi/java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:209)
at java.rmi/java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:161)
at com.sun.proxy.$Proxy136.customize(Unknown Source)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.intellij.execution.rmi.RemoteUtil.invokeRemote(RemoteUtil.java:175)
at com.intellij.execution.rmi.RemoteUtil.access$200(RemoteUtil.java:38)
at com.intellij.execution.rmi.RemoteUtil$1$1$1.compute(RemoteUtil.java:156)
at com.intellij.openapi.util.ClassLoaderUtil.computeWithClassLoader(ClassLoaderUtil.java:45)
at com.intellij.execution.rmi.RemoteUtil.executeWithClassLoader(RemoteUtil.java:227)
at com.intellij.execution.rmi.RemoteUtil$1$1.invoke(RemoteUtil.java:153)
at com.sun.proxy.$Proxy136.customize(Unknown Source)
at org.jetbrains.idea.maven.server.MavenEmbedderWrapper.doCustomize(MavenEmbedderWrapper.java:92)
at org.jetbrains.idea.maven.server.MavenEmbedderWrapper.onWrappeeCreated(MavenEmbedderWrapper.java:45)
at org.jetbrains.idea.maven.server.RemoteObjectWrapper.getOrCreateWrappee(RemoteObjectWrapper.java:42)
at org.jetbrains.idea.maven.server.MavenEmbedderWrapper.doCustomize(MavenEmbedderWrapper.java:92)
at org.jetbrains.idea.maven.server.MavenEmbedderWrapper.lambda$customizeForResolve$1(MavenEmbedderWrapper.java:65)
at org.jetbrains.idea.maven.server.RemoteObjectWrapper.perform(RemoteObjectWrapper.java:76)
at org.jetbrains.idea.maven.server.MavenEmbedderWrapper.customizeForResolve(MavenEmbedderWrapper.java:64)
at org.jetbrains.idea.maven.project.MavenProjectsTree.resolve(MavenProjectsTree.java:1261)
at org.jetbrains.idea.maven.project.MavenProjectsProcessorResolvingTask.perform(MavenProjectsProcessorResolvingTask.java:45)
at org.jetbrains.idea.maven.project.MavenProjectsProcessor.doProcessPendingTasks(MavenProjectsProcessor.java:140)
at org.jetbrains.idea.maven.project.MavenProjectsProcessor.access$000(MavenProjectsProcessor.java:33)
at org.jetbrains.idea.maven.project.MavenProjectsProcessor$2.run(MavenProjectsProcessor.java:114)
at org.jetbrains.idea.maven.utils.MavenUtil.lambda$runInBackground$5(MavenUtil.java:468)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:294)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
2019-09-08 20:23:15,247 [ 16520] ERROR - #org.jetbrains.idea.maven - IntelliJ IDEA 2019.2.2 Build #IU-192.6603.28
2019-09-08 20:23:15,248 [ 16521] ERROR - #org.jetbrains.idea.maven - JDK: 11.0.3; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o
2019-09-08 20:23:15,248 [ 16521] ERROR - #org.jetbrains.idea.maven - OS: Mac OS X
2019-09-08 20:23:15,252 [ 16525] ERROR - #org.jetbrains.idea.maven - Last Action: Maven.ReimportProject
i hope someone could tell me how to fix it
It is known Maven 3.6.2 compatibility issue: https://youtrack.jetbrains.com/issue/IDEA-221882 .
A workaround is to change Maven version to 3.6.1 or older here:
UPD: The issue has been fixed in IntelliJ IDEA 2019.2.3 version.
I had the same problem, but it still didn't work after I changed the maven version to 3.5.4, I ended up replacing the Java version with Java HotSpot(TM) v1.8.0_171, it has be resolved.

Basic HTTP Get with Apache Camel (http4)

We are unable to a basic HTTP GET to any URL with Camel. Even the simplest GET to a localhost never returns an answer.
from("timer://foo?period=5000")
.to("http4://localhost:8888")
.log("Never get here...");
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/http/ssl/SSLContexts
at org.apache.camel.component.http4.HttpComponent.createConnectionRegistry(HttpComponent.java:379)
at org.apache.camel.component.http4.HttpComponent.createConnectionManager(HttpComponent.java:346)
at org.apache.camel.component.http4.HttpComponent.createEndpoint(HttpComponent.java:276)
at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:126)
at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:706)
at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:80)
at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:227)
at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:116)
at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:122)
at org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:62)
at org.apache.camel.model.SendDefinition.createProcessor(SendDefinition.java:56)
at org.apache.camel.model.ProcessorDefinition.makeProcessorImpl(ProcessorDefinition.java:569)
at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:530)
at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:240)
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1349)
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:212)
at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:1140)
at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:3735)
at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3440)
at org.apache.camel.impl.DefaultCamelContext$4.call(DefaultCamelContext.java:3248)
at org.apache.camel.impl.DefaultCamelContext$4.call(DefaultCamelContext.java:3244)
at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:3267)
at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:3244)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:72)
at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:3160)
at marc.Main.main(Main.java:59)
Caused by: java.lang.ClassNotFoundException: org.apache.http.ssl.SSLContexts
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 26 more
Windows 10, JDK 1.8. Camel 2.23.1
716 [main] DEBUG org.apache.camel.impl.DefaultCamelContext - timer://foo?period=5000 converted to endpoint: timer://foo?period=5000 by component: org.apache.camel.component.timer.TimerComponent#71809907
732 [main] DEBUG org.apache.camel.management.DefaultManagementAgent - Registered MBean with ObjectName: org.apache.camel:context=camel-1,type=endpoints,name="timer://foo\?period=5000"
747 [main] DEBUG org.apache.camel.impl.DefaultCamelContext - Using ComponentResolver: org.apache.camel.impl.DefaultComponentResolver#20deea7f to resolve component with name: http4
747 [main] DEBUG org.apache.camel.util.ResolverHelper - Lookup Component with name http4 in registry. Found: null
747 [main] DEBUG org.apache.camel.util.ResolverHelper - Lookup Component with name http4-component in registry. Found: null
747 [main] DEBUG org.apache.camel.impl.DefaultComponentResolver - Found component: http4 via type: org.apache.camel.component.http4.HttpComponent via: META-INF/services/org/apache/camel/component/http4

Error on running Grails project

I have a problem with grailsVersion=3.3.0.M1 and gradleWrapperVersion=3.0. Whenever I run the project I get the following error.
|Resolving Dependencies. Please wait...
CONFIGURE SUCCESSFUL
Total time: 13.543 secs |Running application... 2017-05-29
22:08:46.634 ERROR --- [ main] o.s.boot.SpringApplication
: Application startup failed
java.lang.NoClassDefFoundError:
org/springframework/boot/context/embedded/FilterRegistrationBean at
asset.pipeline.AssetPipelineGrailsPlugin$_doWithSpring_closure1.doCall(AssetPipelineGrailsPlugin.groovy:105)
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
org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1426)
at
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) at
org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1027)
at groovy.lang.Closure.call(Closure.java:414) at
groovy.lang.Closure.call(Closure.java:408) at
grails.spring.BeanBuilder.invokeBeanDefiningClosure(BeanBuilder.java:759)
at grails.spring.BeanBuilder.beans(BeanBuilder.java:588) at
grails.spring.BeanBuilder.invokeMethod(BeanBuilder.java:531) at
org.grails.plugins.DefaultGrailsPlugin.doWithRuntimeConfiguration(DefaultGrailsPlugin.java:559)
at
org.grails.plugins.AbstractGrailsPluginManager.doRuntimeConfiguration(AbstractGrailsPluginManager.java:167)
at
grails.boot.config.GrailsApplicationPostProcessor.postProcessBeanDefinitionRegistry(GrailsApplicationPostProcessor.groovy:171)
at
org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:118)
at
org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:686)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:524)
at
org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
at
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737)
at
org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370)
at
org.springframework.boot.SpringApplication.run(SpringApplication.java:314)
at grails.boot.GrailsApp.run(GrailsApp.groovy:83) at
grails.boot.GrailsApp.run(GrailsApp.groovy:388) at
grails.boot.GrailsApp.run(GrailsApp.groovy:375) at
grails.boot.GrailsApp$run.call(Unknown Source) at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
at mjmdashboardnext.Application.main(Application.groovy:8) Caused by:
java.lang.ClassNotFoundException:
org.springframework.boot.context.embedded.FilterRegistrationBean 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) ... 33 common
frames omitted
2017-05-29 22:08:46.749 ERROR --- [ main]
o.s.b.f.s.DefaultListableBeanFactory : Destroy method on bean with
name 'grailsApplicationPostProcessor' threw an exception
java.lang.IllegalStateException: ApplicationEventMulticaster not
initialized - call 'refresh' before multicasting events via the
context:
org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#64c2b546:
startup date [Mon May 29 22:08:08 NPT 2017]; root of context hierarchy
at
org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:404)
at
org.springframework.context.support.ApplicationListenerDetector.postProcessBeforeDestruction(ApplicationListenerDetector.java:97)
at
org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:253)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:578)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:554)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:961)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:523)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:968)
at
org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1033)
at
org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1009)
at
org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:961)
at
org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:794)
at
org.springframework.boot.SpringApplication.run(SpringApplication.java:325)
at grails.boot.GrailsApp.run(GrailsApp.groovy:83) at
grails.boot.GrailsApp.run(GrailsApp.groovy:388) at
grails.boot.GrailsApp.run(GrailsApp.groovy:375) at
grails.boot.GrailsApp$run.call(Unknown Source) at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
at mjmdashboardnext.Application.main(Application.groovy:8)
2017-05-29 22:08:46.765 ERROR --- [ main]
o.s.b.f.s.DefaultListableBeanFactory : Destroy method on bean with
name
'org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory'
threw an exception
java.lang.IllegalStateException: ApplicationEventMulticaster not
initialized - call 'refresh' before multicasting events via the
context:
org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#64c2b546:
startup date [Mon May 29 22:08:08 NPT 2017]; root of context hierarchy
at
org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:404)
at
org.springframework.context.support.ApplicationListenerDetector.postProcessBeforeDestruction(ApplicationListenerDetector.java:97)
at
org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:253)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:578)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:554)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:961)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:523)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:968)
at
org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1033)
at
org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1009)
at
org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:961)
at
org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:794)
at
org.springframework.boot.SpringApplication.run(SpringApplication.java:325)
at grails.boot.GrailsApp.run(GrailsApp.groovy:83) at
grails.boot.GrailsApp.run(GrailsApp.groovy:388) at
grails.boot.GrailsApp.run(GrailsApp.groovy:375) at
grails.boot.GrailsApp$run.call(Unknown Source) at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
at mjmdashboardnext.Application.main(Application.groovy:8)
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':bootRun'.
Process 'command 'C:\Program Files\Java\jdk1.8.0_121\bin\java.exe'' finished with non-zero exit value 1
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Error | Failed to start server (Use --stacktrace to see the full trace)
Process finished with exit code 1
I have tried to upgrade my plugins in build.gradle but the error remains the same.
My build.gradle is as follows
buildscript {
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath "org.grails.plugins:hibernate5:6.0.7"
classpath "org.grails.plugins:views-gradle:1.1.5"
classpath 'com.bertramlabs.plugins:asset-pipeline-gradle:2.10.1'
classpath "org.grails.plugins:views-gradle:1.2.0"
} }
version "0.5.1" group "test"
apply plugin:"eclipse" apply plugin:"idea" apply plugin:"war" apply plugin:"org.grails.grails-web" apply plugin:"org.grails.plugins.views-json"
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
maven { url 'http://dl.bintray.com/agorapulse/libs' } }
dependencyManagement {
imports {
mavenBom "org.grails:grails-bom:$grailsVersion"
}
applyMavenExclusions false }
dependencies {
compile "org.springframework.boot:spring-boot-starter-logging"
compile "org.springframework.boot:spring-boot-autoconfigure"
compile "org.grails:grails-core"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "org.springframework.boot:spring-boot-starter-tomcat"
compile "org.grails:grails-plugin-url-mappings"
compile "org.grails:grails-plugin-rest"
compile "org.grails:grails-plugin-codecs"
compile "org.grails:grails-plugin-interceptors"
compile "org.grails:grails-plugin-services"
compile "org.grails:grails-plugin-datasource"
compile "org.grails:grails-plugin-databinding"
compile "org.grails:grails-plugin-async"
compile "org.grails:grails-web-boot"
compile "org.grails:grails-logging"
compile "org.grails.plugins:cache"
compile "org.grails.plugins:hibernate5"
compile "org.hibernate:hibernate-core:5.1.2.Final"
compile "org.hibernate:hibernate-ehcache:5.1.2.Final"
compile "org.grails.plugins:views-json:1.2.1"
compile "org.grails.plugins:views-json-templates:1.2.1"
console "org.grails:grails-console"
profile "org.grails.profiles:rest-api"
runtime "com.h2database:h2"
testCompile "org.grails:grails-plugin-testing"
testCompile "org.grails.plugins:geb"
testCompile "org.grails:grails-datastore-rest-client"
testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1"
testRuntime "net.sourceforge.htmlunit:htmlunit:2.18"
runtime 'mysql:mysql-connector-java:5.1.36'
compile 'org.grails.plugins:aws-sdk-s3:2.1.5'
compile 'org.grails.plugins:spring-security-core:3.1.1'
compile "org.grails.plugins:spring-security-rest:2.0.0.M2"
compile 'com.nayidisha.grails.uploadr:grails3-uploadr:3.1.0'
compile 'org.grails.plugins:joda-time:2.0.0'
compile 'org.grails.plugins:quartz:2.0.9'
compile 'org.grails.plugins:wkhtmltopdf:1.0.0.RC7'
compile 'org.grails.plugins:rabbitmq:2.0.0'
compile 'org.grails.plugins:excel-import:3.0.0.RC2'
compile 'com.bertramlabs.plugins:selfie:1.1.1'
compile "org.grails.plugins:swaggydoc-grails3:0.26.0"
compile "org.grails:grails-dependencies"
}
bootRun {
jvmArgs('-Dspring.output.ansi.enabled=always') }
grails {
pathingJar = true }
Has anyone faced this issue? How do I resolve this?
compile 'org.grails.plugins:spring-security-core:3.1.1'
Is not compatible with 3.3 - use
compile 'org.grails.plugins:spring-security-core:3.2.0.M1'
Also I'd suggest using the gradle wrapper that the grails version you use ships with. 3.0 is quite old.
You can see my 3.3.0 Upgrade notes here https://gist.github.com/erichelgeson/72e1b6cb8e1b9428738799368c32133f
Also 3.3.0.M2 was just released today with a bunch of fixes.

How to solve the noSuchMethodError when call a method which contains a Spring ApplicationContext?

There are two project I have build( more than two indeed),the 1st one is DataCollector which do data service built with Spring and Hibernate, the 2nd is CoreProcessor which do analysis to these data built with Drools. The CoreProcessor need call some methods supported by DataCollector to return data for itself, these methods will first find application context .xml file, and then create session and do queries.When I test there method in DataCollector project, they are run smoothly, However it returns Error when CoreProcessor project calls them.
Here is the Error Message:
21:14:57.332 [main] DEBUG o.s.core.env.StandardEnvironment - Adding [systemProperties] PropertySource with lowest search precedence
21:14:57.336 [main] DEBUG o.s.core.env.StandardEnvironment - Adding [systemEnvironment] PropertySource with lowest search precedence
21:14:57.336 [main] DEBUG o.s.core.env.StandardEnvironment - Initialized StandardEnvironment with PropertySources [systemProperties,systemEnvironment]
21:14:57.340 [main] INFO o.s.c.s.ClassPathXmlApplicationContext - Refreshing org.springframework.context.support.ClassPathXmlApplicationContext#6108b2d7: startup date [Mon Apr 11 21:14:57 CST 2016]; root of context hierarchy
21:14:57.378 [main] DEBUG o.s.core.env.StandardEnvironment - Adding [systemProperties] PropertySource with lowest search precedence
21:14:57.379 [main] DEBUG o.s.core.env.StandardEnvironment - Adding [systemEnvironment] PropertySource with lowest search precedence
21:14:57.379 [main] DEBUG o.s.core.env.StandardEnvironment - Initialized StandardEnvironment with PropertySources [systemProperties,systemEnvironment]
21:14:57.390 [main] INFO o.s.b.f.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [ConnectToLocalDataBase.xml]
21:14:57.402 [main] DEBUG o.s.b.f.xml.DefaultDocumentLoader - Using JAXP provider [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl]
21:14:57.422 [main] DEBUG o.s.b.f.xml.PluggableSchemaResolver - Loading schema mappings from [META-INF/spring.schemas]
21:14:57.428 [main] DEBUG o.s.b.f.xml.PluggableSchemaResolver - Loaded schema mappings: {http://www.springframework.org/schema/tx/spring-tx-2.5.xsd=org/springframework/transaction/config/spring-tx-2.5.xsd, http://www.springframework.org/schema/cache/spring-cache-4.2.xsd=org/springframework/cache/config/spring-cache-4.2.xsd, http://www.springframework.org/schema/context/spring-context-3.1.xsd=org/springframework/context/config/spring-context-3.1.xsd, http://www.springframework.org/schema/jdbc/spring-jdbc-4.1.xsd=org/springframework/jdbc/config/spring-jdbc-4.1.xsd, http://www.springframework.org/schema/util/spring-util-3.0.xsd=org/springframework/beans/factory/xml/spring-util-3.0.xsd, http://www.springframework.org/schema/tool/spring-tool.xsd=org/springframework/beans/factory/xml/spring-tool-4.0.xsd, http://www.springframework.org/schema/aop/spring-aop-3.2.xsd=org/springframework/aop/config/spring-aop-3.2.xsd, http://www.springframework.org/schema/lang/spring-lang-4.1.xsd=org/springframework/scripting/config/spring-lang-4.1.xsd, http://www.springframework.org/schema/context/spring-context-4.0.xsd=org/springframework/context/config/spring-context-4.0.xsd, http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd=org/springframework/web/servlet/config/spring-mvc-3.2.xsd, http://www.springframework.org/schema/oxm/spring-oxm-3.0.xsd=org/springframework/oxm/config/spring-oxm-3.0.xsd, http://www.springframework.org/schema/lang/spring-lang-3.2.xsd=org/springframework/scripting/config/spring-lang-3.2.xsd, http://www.springframework.org/schema/cache/spring-cache-3.2.xsd=org/springframework/cache/config/spring-cache-3.2.xsd, http://www.springframework.org/schema/jee/spring-jee-4.1.xsd=org/springframework/ejb/config/spring-jee-4.1.xsd, http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd=org/springframework/jdbc/config/spring-jdbc-3.1.xsd, http://www.springframework.org/schema/util/spring-util-2.0.xsd=org/springframework/beans/factory/xml/spring-util-2.0.xsd, http://www.springframework.org/schema/task/spring-task-4.2.xsd=org/springframework/scheduling/config/spring-task-4.2.xsd, http://www.springframework.org/schema/tool/spring-tool-3.2.xsd=org/springframework/beans/factory/xml/spring-tool-3.2.xsd, http://www.springframework.org/schema/context/spring-context.xsd=org/springframework/context/config/spring-context-4.2.xsd, http://www.springframework.org/schema/tx/spring-tx-4.2.xsd=org/springframework/transaction/config/spring-tx-4.2.xsd, http://www.springframework.org/schema/cache/spring-cache-4.1.xsd=org/springframework/cache/config/spring-cache-4.1.xsd, http://www.springframework.org/schema/aop/spring-aop-4.0.xsd=org/springframework/aop/config/spring-aop-4.0.xsd, http://www.springframework.org/schema/jee/spring-jee-3.2.xsd=org/springframework/ejb/config/spring-jee-3.2.xsd, http://www.springframework.org/schema/context/spring-context-3.0.xsd=org/springframework/context/config/spring-context-3.0.xsd, http://www.springframework.org/schema/jdbc/spring-jdbc-4.0.xsd=org/springframework/jdbc/config/spring-jdbc-4.0.xsd, http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd=org/springframework/web/servlet/config/spring-mvc-4.0.xsd, http://www.springframework.org/schema/util/spring-util-2.5.xsd=org/springframework/beans/factory/xml/spring-util-2.5.xsd, http://www.springframework.org/schema/beans/spring-beans-3.2.xsd=org/springframework/beans/factory/xml/spring-beans-3.2.xsd, http://www.springframework.org/schema/aop/spring-aop-3.1.xsd=org/springframework/aop/config/spring-aop-3.1.xsd, http://www.springframework.org/schema/lang/spring-lang-4.0.xsd=org/springframework/scripting/config/spring-lang-4.0.xsd, http://www.springframework.org/schema/mvc/spring-mvc.xsd=org/springframework/web/servlet/config/spring-mvc-4.0.xsd, http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd=org/springframework/web/servlet/config/spring-mvc-3.1.xsd, http://www.springframework.org/schema/tool/spring-tool-4.0.xsd=org/springframework/beans/factory/xml/spring-tool-4.0.xsd, http://www.springframework.org/schema/tx/spring-tx-3.2.xsd=org/springframework/transaction/config/spring-tx-3.2.xsd, http://www.springframework.org/schema/lang/spring-lang-3.1.xsd=org/springframework/scripting/config/spring-lang-3.1.xsd, http://www.springframework.org/schema/cache/spring-cache-3.1.xsd=org/springframework/cache/config/spring-cache-3.1.xsd, http://www.springframework.org/schema/jee/spring-jee-4.0.xsd=org/springframework/ejb/config/spring-jee-4.0.xsd, http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd=org/springframework/jdbc/config/spring-jdbc-3.0.xsd, http://www.springframework.org/schema/task/spring-task-4.1.xsd=org/springframework/scheduling/config/spring-task-4.1.xsd, http://www.springframework.org/schema/jdbc/spring-jdbc.xsd=org/springframework/jdbc/config/spring-jdbc-4.2.xsd, http://www.springframework.org/schema/tool/spring-tool-3.1.xsd=org/springframework/beans/factory/xml/spring-tool-3.1.xsd, http://www.springframework.org/schema/tx/spring-tx-4.1.xsd=org/springframework/transaction/config/spring-tx-4.1.xsd, http://www.springframework.org/schema/cache/spring-cache-4.0.xsd=org/springframework/cache/config/spring-cache-4.0.xsd, http://www.springframework.org/schema/jee/spring-jee-3.1.xsd=org/springframework/ejb/config/spring-jee-3.1.xsd, http://www.springframework.org/schema/task/spring-task-3.2.xsd=org/springframework/scheduling/config/spring-task-3.2.xsd, http://www.springframework.org/schema/beans/spring-beans-3.1.xsd=org/springframework/beans/factory/xml/spring-beans-3.1.xsd, http://www.springframework.org/schema/util/spring-util.xsd=org/springframework/beans/factory/xml/spring-util-4.0.xsd, http://www.springframework.org/schema/aop/spring-aop-3.0.xsd=org/springframework/aop/config/spring-aop-3.0.xsd, http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd=org/springframework/web/servlet/config/spring-mvc-3.0.xsd, http://www.springframework.org/schema/beans/spring-beans-4.0.xsd=org/springframework/beans/factory/xml/spring-beans-4.0.xsd, http://www.springframework.org/schema/oxm/spring-oxm-4.2.xsd=org/springframework/oxm/config/spring-oxm-4.2.xsd, http://www.springframework.org/schema/beans/spring-beans.xsd=org/springframework/beans/factory/xml/spring-beans-4.0.xsd, http://www.springframework.org/schema/web-services/web-services.xsd=/org/springframework/ws/config/web-services-2.0.xsd, http://www.springframework.org/schema/tx/spring-tx-3.1.xsd=org/springframework/transaction/config/spring-tx-3.1.xsd, http://www.springframework.org/schema/lang/spring-lang-3.0.xsd=org/springframework/scripting/config/spring-lang-3.0.xsd, http://www.springframework.org/schema/context/spring-context-2.5.xsd=org/springframework/context/config/spring-context-2.5.xsd, http://www.springframework.org/schema/task/spring-task-4.0.xsd=org/springframework/scheduling/config/spring-task-4.0.xsd, http://www.springframework.org/schema/tool/spring-tool-3.0.xsd=org/springframework/beans/factory/xml/spring-tool-3.0.xsd, http://www.springframework.org/schema/tx/spring-tx-4.0.xsd=org/springframework/transaction/config/spring-tx-4.0.xsd, http://www.springframework.org/schema/aop/spring-aop-2.0.xsd=org/springframework/aop/config/spring-aop-2.0.xsd, http://www.springframework.org/schema/jee/spring-jee-3.0.xsd=org/springframework/ejb/config/spring-jee-3.0.xsd, http://www.springframework.org/schema/task/spring-task-3.1.xsd=org/springframework/scheduling/config/spring-task-3.1.xsd, http://www.springframework.org/schema/beans/spring-beans-3.0.xsd=org/springframework/beans/factory/xml/spring-beans-3.0.xsd, http://www.springframework.org/schema/jee/spring-jee.xsd=org/springframework/ejb/config/spring-jee-4.2.xsd, http://www.springframework.org/schema/aop/spring-aop-2.5.xsd=org/springframework/aop/config/spring-aop-2.5.xsd, http://www.springframework.org/schema/lang/spring-lang-2.0.xsd=org/springframework/scripting/config/spring-lang-2.0.xsd, http://www.springframework.org/schema/oxm/spring-oxm.xsd=org/springframework/oxm/config/spring-oxm-4.2.xsd, http://www.springframework.org/schema/util/spring-util-3.2.xsd=org/springframework/beans/factory/xml/spring-util-3.2.xsd, http://www.springframework.org/schema/oxm/spring-oxm-4.1.xsd=org/springframework/oxm/config/spring-oxm-4.1.xsd, http://www.springframework.org/schema/task/spring-task.xsd=org/springframework/scheduling/config/spring-task-4.2.xsd, http://www.springframework.org/schema/tool/spring-tool-2.0.xsd=org/springframework/beans/factory/xml/spring-tool-2.0.xsd, http://www.springframework.org/schema/tx/spring-tx-3.0.xsd=org/springframework/transaction/config/spring-tx-3.0.xsd, http://www.springframework.org/schema/lang/spring-lang-2.5.xsd=org/springframework/scripting/config/spring-lang-2.5.xsd, http://www.springframework.org/schema/context/spring-context-4.2.xsd=org/springframework/context/config/spring-context-4.2.xsd, http://www.springframework.org/schema/jee/spring-jee-2.0.xsd=org/springframework/ejb/config/spring-jee-2.0.xsd, http://www.springframework.org/schema/oxm/spring-oxm-3.2.xsd=org/springframework/oxm/config/spring-oxm-3.2.xsd, http://www.springframework.org/schema/tool/spring-tool-2.5.xsd=org/springframework/beans/factory/xml/spring-tool-2.5.xsd, http://www.springframework.org/schema/jee/spring-jee-2.5.xsd=org/springframework/ejb/config/spring-jee-2.5.xsd, http://www.springframework.org/schema/web-services/web-services-2.0.xsd=/org/springframework/ws/config/web-services-2.0.xsd, http://www.springframework.org/schema/util/spring-util-4.0.xsd=org/springframework/beans/factory/xml/spring-util-4.0.xsd, http://www.springframework.org/schema/task/spring-task-3.0.xsd=org/springframework/scheduling/config/spring-task-3.0.xsd, http://www.springframework.org/schema/lang/spring-lang.xsd=org/springframework/scripting/config/spring-lang-4.2.xsd, http://www.springframework.org/schema/context/spring-context-3.2.xsd=org/springframework/context/config/spring-context-3.2.xsd, http://www.springframework.org/schema/jdbc/spring-jdbc-4.2.xsd=org/springframework/jdbc/config/spring-jdbc-4.2.xsd, http://www.springframework.org/schema/util/spring-util-3.1.xsd=org/springframework/beans/factory/xml/spring-util-3.1.xsd, http://www.springframework.org/schema/beans/spring-beans-2.0.xsd=org/springframework/beans/factory/xml/spring-beans-2.0.xsd, http://www.springframework.org/schema/oxm/spring-oxm-4.0.xsd=org/springframework/oxm/config/spring-oxm-4.0.xsd, http://www.springframework.org/schema/cache/spring-cache.xsd=org/springframework/cache/config/spring-cache-4.2.xsd, http://www.springframework.org/schema/tx/spring-tx.xsd=org/springframework/transaction/config/spring-tx-4.2.xsd, http://www.springframework.org/schema/lang/spring-lang-4.2.xsd=org/springframework/scripting/config/spring-lang-4.2.xsd, http://www.springframework.org/schema/context/spring-context-4.1.xsd=org/springframework/context/config/spring-context-4.1.xsd, http://www.springframework.org/schema/beans/spring-beans-2.5.xsd=org/springframework/beans/factory/xml/spring-beans-2.5.xsd, http://www.springframework.org/schema/oxm/spring-oxm-3.1.xsd=org/springframework/oxm/config/spring-oxm-3.1.xsd, http://www.springframework.org/schema/tx/spring-tx-2.0.xsd=org/springframework/transaction/config/spring-tx-2.0.xsd, http://www.springframework.org/schema/jee/spring-jee-4.2.xsd=org/springframework/ejb/config/spring-jee-4.2.xsd, http://www.springframework.org/schema/jdbc/spring-jdbc-3.2.xsd=org/springframework/jdbc/config/spring-jdbc-3.2.xsd, http://www.springframework.org/schema/web-services/web-services-1.5.xsd=/org/springframework/ws/config/web-services-1.5.xsd, http://www.springframework.org/schema/aop/spring-aop.xsd=org/springframework/aop/config/spring-aop-4.0.xsd}
21:14:57.429 [main] DEBUG o.s.b.f.xml.PluggableSchemaResolver - Found XML schema [http://www.springframework.org/schema/beans/spring-beans.xsd] in classpath: org/springframework/beans/factory/xml/spring-beans-4.0.xsd
21:14:57.466 [main] DEBUG o.s.b.f.xml.PluggableSchemaResolver - Found XML schema [http://www.springframework.org/schema/context/spring-context.xsd] in classpath: org/springframework/context/config/spring-context-4.2.xsd
21:14:59.078 [main] DEBUG o.s.b.f.x.DefaultBeanDefinitionDocumentReader - Loading bean definitions
21:14:59.090 [main] DEBUG o.s.b.f.x.DefaultNamespaceHandlerResolver - Loaded NamespaceHandler mappings: {http://www.springframework.org/schema/p=org.springframework.beans.factory.xml.SimplePropertyNamespaceHandler, http://www.springframework.org/schema/mvc=org.springframework.web.servlet.config.MvcNamespaceHandler, http://www.springframework.org/schema/web-services=org.springframework.ws.config.WebServicesNamespaceHandler, http://www.springframework.org/schema/util=org.springframework.beans.factory.xml.UtilNamespaceHandler, http://www.springframework.org/schema/jee=org.springframework.ejb.config.JeeNamespaceHandler, http://www.springframework.org/schema/aop=org.springframework.aop.config.AopNamespaceHandler, http://www.springframework.org/schema/jdbc=org.springframework.jdbc.config.JdbcNamespaceHandler, http://www.springframework.org/schema/oxm=org.springframework.oxm.config.OxmNamespaceHandler, http://www.springframework.org/schema/cache=org.springframework.cache.config.CacheNamespaceHandler, http://www.springframework.org/schema/c=org.springframework.beans.factory.xml.SimpleConstructorNamespaceHandler, http://www.springframework.org/schema/tx=org.springframework.transaction.config.TxNamespaceHandler, http://www.springframework.org/schema/task=org.springframework.scheduling.config.TaskNamespaceHandler, http://www.springframework.org/schema/lang=org.springframework.scripting.config.LangNamespaceHandler, http://www.springframework.org/schema/context=org.springframework.context.config.ContextNamespaceHandler}
Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [ConnectToLocalDataBase.xml]; nested exception is java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.XmlReaderContext.getEnvironment()Lorg/springframework/core/env/Environment;
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:414)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:216)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:187)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:251)
at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:127)
at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:93)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:609)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:510)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
at Testcase.TestDataSource.getTestBill(TestDataSource.java:20)
at testCases.DataRequestTest.main(DataRequestTest.java:14)
Caused by: java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.XmlReaderContext.getEnvironment()Lorg/springframework/core/env/Environment;
at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:81)
at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:74)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1426)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1416)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:179)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:149)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:103)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:510)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:392)
... 15 more
Check the below link. It mentions the same error. You need to add an extra dependency
NoSuchMethodError: org.springframework.beans.factory.xml.XmlReaderContext.getEnvironment()Lorg/springframework/core/env/Environment; With zkoss
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>

Analyzing with SonarQube Ant Task

I am following the instructions given here on how to integrate SonarQube with an Ant-based project. However when I reach the point where I have to invoke ant sonar, it fails.
Before reaching that point I've verified that Sonar is up and running and that the following URL is accessible and presents the default "Welcome to SonarQube Dashboard" page:
http://localhost:9000
By doing a tail -f logs/sonar.log I see the following at some point which seems to coincide to the issue:
$ tail -f sonarqube-4.5.4/logs/sonar.log
[...]/sonarqube-4.5.4/web/WEB-INF/gems/gems/rack-1.1.6/lib/rack/methodoverride.rb:24:in `call'
[...]/sonarqube-4.5.4/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/params_parser.rb:15:in `call'
[...]/sonarqube-4.5.4/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/session_store.rb:70:in `context'
[...]/sonarqube-4.5.4/web/WEB-INF/gems/gems/rack-1.1.6/lib/rack/session/abstract/id.rb:58:in `call'
[...]/sonarqube-4.5.4/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/failsafe.rb:26:in `call'
[...]/sonarqube-4.5.4/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/dispatcher.rb:106:in `call
[...]/sonarqube-4.5.4/lib/server/jruby-rack-1.1.13.2.jar!/rack/adapter/rails.rb:34:in `serve_rails'
[...]/sonarqube-4.5.4/lib/server/jruby-rack-1.1.13.2.jar!/rack/adapter/rails.rb:39:in `call'
[...]/sonarqube-4.5.4/lib/server/jruby-rack-1.1.13.2.jar!/rack/handler/servlet.rb:22:in `call'
2015.04.28 19:15:08 ERROR web[o.s.s.ui.JRubyFacade] Fail to render: http://localhost:9000/api/server
undefined method `generate' for #<JSON::Ext::Generator::State:0x1d0f333>
/home/mperdikeas/.rvm/gems/ruby-2.0.0-p353#global/gems/json-1.8.1/lib/json/common.rb:223:in `generate'
/home/mperdikeas/.rvm/gems/ruby-2.0.0-p353#global/gems/json-1.8.1/lib/json/common.rb:470:in `JSON'
/home/mperdikeas/software-downloads/sonarqube/sonarqube-5.4/web/WEB-INF/app/controllers/api/api_controller.rb:48:in `jsonp'
/home/mperdikeas/software-downloads/sonarqube/sonarqube-4.5.4/web/WEB-INF/app/controllers/api/server_controller.rb:42:in `index'
I append below the trace on the console where ant sonar is run:
ant sonar trace
$ ant sonar
Buildfile: [...]/sample-sonar-ant-project/build.xml
sonar:
[sonar:sonar] Apache Ant(TM) version 1.8.2 compiled on December 3 2011
[sonar:sonar] SonarQube Ant Task version: 2.2
[sonar:sonar] Loaded from: file:/home/mperdikeas/software-downloads/sonarqube/sonar-ant-task-2.2.jar
[sonar:sonar] INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
[sonar:sonar] INFO: Work directory: /home/mperdikeas/playground-local/sample-sonar-ant-project/.sonar
[sonar:sonar] INFO: SonarQube Server 4.5.4
[sonar:sonar] 19:15:06.240 INFO - Load global referentials...
[sonar:sonar] 19:15:06.486 INFO - Load global referentials done: 249 ms
[sonar:sonar] 19:15:06.500 INFO - User cache: /home/mperdikeas/.sonar/cache
[sonar:sonar] 19:15:06.512 INFO - Install plugins
[sonar:sonar] 19:15:06.572 INFO - Install JDBC driver
[sonar:sonar] 19:15:06.580 INFO - Create JDBC datasource for jdbc:postgresql://localhost:5432/sonar?useUnicode=true&characterEncoding=utf8
BUILD FAILED
/home/mperdikeas/playground-local/sample-sonar-ant-project/build.xml:478: org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
at org.sonar.runner.api.Runner.execute(Runner.java:100)
at org.sonar.ant.SonarTask.launchAnalysis(SonarTask.java:53)
at org.sonar.ant.SonarTask.execute(SonarTask.java:48)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:809)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: org.sonar.api.utils.HttpDownloader$HttpException: Fail to download [http://localhost:9000/api/server]. Response code: 500
at org.sonar.api.utils.HttpDownloader$BaseHttpDownloader$HttpInputSupplier.getInput(HttpDownloader.java:281)
at org.sonar.api.utils.HttpDownloader$BaseHttpDownloader$HttpInputSupplier.getInput(HttpDownloader.java:235)
at org.sonar.batch.bootstrap.ServerClient.request(ServerClient.java:89)
at org.sonar.batch.bootstrap.ServerClient.request(ServerClient.java:83)
at org.sonar.batch.bootstrap.ServerClient.request(ServerClient.java:79)
at org.sonar.batch.bootstrap.ServerMetadata.getServerId(ServerMetadata.java:99)
at org.sonar.batch.bootstrap.DatabaseCompatibility.checkCorrectServerId(DatabaseCompatibility.java:57)
at org.sonar.batch.bootstrap.DatabaseCompatibility.start(DatabaseCompatibility.java:51)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110)
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89)
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
at org.picocontainer.behaviors.Stored.start(Stored.java:110)
at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1015)
at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1008)
at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:766)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.batch.bootstrapper.Batch.start(Batch.java:81)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
... 24 more
Total time: 3 seconds
Here's the root cause (taken from your stacktrace):
Caused by: org.sonar.api.utils.HttpDownloader$HttpException: Fail to download [http://localhost:9000/api/server]. Response code: 500
The HTTP 500 code indicates a problem with your Sonar server. Is it running as expected on the following URL?
http://localhost:9000
If so, I suggest next checking the server-side logfiles for an error message.

Categories

Resources