0

Can any body suggest me which jar i shld use to resolve the below exception,

Exception in thread "main" java.lang.NoSuchMethodError: org.neo4j.graphdb.factory.GraphDatabaseSetting$BooleanSetting.<init>(Ljava/lang/String;)V
    at org.neo4j.shell.ShellSettings.<clinit>(ShellSettings.java:37)
    at sun.misc.Unsafe.ensureClassInitialized(Native Method)
    at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(Unknown Source)
    at sun.reflect.ReflectionFactory.newFieldAccessor(Unknown Source)
    at java.lang.reflect.Field.acquireFieldAccessor(Unknown Source)
    at java.lang.reflect.Field.getFieldAccessor(Unknown Source)
    at java.lang.reflect.Field.get(Unknown Source)
    at org.neo4j.kernel.configuration.AnnotatedFieldHarvester.findStatic(AnnotatedFieldHarvester.java:47)
    at org.neo4j.kernel.configuration.AnnotationBasedConfigurationMigrator.<init>(AnnotationBasedConfigurationMigrator.java:40)
    at org.neo4j.kernel.configuration.Config.<init>(Config.java:89)
    at org.neo4j.kernel.InternalAbstractGraphDatabase.<init>(InternalAbstractGraphDatabase.java:218)
    at org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:103)
    at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:88)
    at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:207)
    at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:69)
    at com.Neo4J.src.EmbeddedNeo4j.createDb(EmbeddedNeo4j.java:48)
    at com.Neo4J.src.EmbeddedNeo4j.main(EmbeddedNeo4j.java:38). 

I have already included the below jar,

neo4j-kernel-1.9.3.jar. Thanks.

MvG
  • 57,380
  • 22
  • 148
  • 276
Sujana
  • 331
  • 1
  • 3
  • 12
  • http://stackoverflow.com/questions/35186/how-do-i-fix-a-nosuchmethoderror – Aneesh Oct 01 '13 at 11:30
  • Do not edit an existing question to change the core of what you are asking about. The question, as originally asked, has been answered. If problems remain, try to solve them yourself, and if you still need help, post a different question. Add links between questions as approproate. but don't turn a correct answer into an incomplete or even incorrect one by editing the question. I consider this rather rude! – MvG Oct 01 '13 at 13:27
  • Hey sorry for that,i dint meant to,i was able to resolve the next prblm so i have edited the smae..th8 of saving others time as i am able to solve the same.. – Sujana Oct 01 '13 at 13:33

1 Answers1

2

Make sure you have the matching neo4j-shell jar file.

The command javap -v -classpath neo4j-shell-1.9.3.jar org.neo4j.shell.ShellSettings | grep invoke indicates to me that there are only five methods called by ShellSettings. One is the Object default constructor, but that's during the constructor for ShellSettings, not the static class initialization <clinit>. The others are all from class org.neo4j.helpers.Settings. setting is called four times, in two different overloaded versions, matches and illegalValueMessage each once.

So in the 1.9.3 version of neo4j, the call to the constructor of GraphDatabaseSetting$BooleanSetting which is mentioned in your stack trace does not occur. therefore your ShellSettings class must come from some other version which is not binary compatible to 1.9.3. Use compatible versions, and you should be fine.

MvG
  • 57,380
  • 22
  • 148
  • 276
  • Hi MvG, Thanks for ur reply, yes i have included two versions by mistake,1.9.3 and 1.8.After removing one it resolved. – Sujana Oct 01 '13 at 13:18