I am running a Java test program to establish a connection to OrientDB and keep getting these exceptions when I run the code from within IntelliJ IDEA or OpenFire (xmpp server):
java.lang.NoSuchMethodError: com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap$Builder.maximumWeightedCapacity(J)Lcom/googlecode/concurrentlinkedhashmap/ConcurrentLinkedHashMap$Builder; at com.orientechnologies.orient.core.db.record.ridbag.sbtree.OSBTreeCollectionManagerAbstract.(OSBTreeCollectionManagerAbstract.java:43) at com.orientechnologies.orient.core.db.record.ridbag.sbtree.OSBTreeCollectionManagerAbstract.(OSBTreeCollectionManagerAbstract.java:48) at com.orientechnologies.orient.client.remote.OSBTreeCollectionManagerRemote.(OSBTreeCollectionManagerRemote.java:58) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at java.lang.Class.newInstance(Class.java:379) at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx$2.call(ODatabaseDocumentTx.java:2863) at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx$2.call(ODatabaseDocumentTx.java:2854) at com.orientechnologies.common.concur.resource.OSharedContainerImpl.getResource(OSharedContainerImpl.java:64) at com.orientechnologies.orient.core.storage.OStorageAbstract.getResource(OStorageAbstract.java:143) at com.orientechnologies.orient.client.remote.OStorageRemoteThread.getResource(OStorageRemoteThread.java:658) at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.initAtFirstOpen(ODatabaseDocumentTx.java:2853) at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.open(ODatabaseDocumentTx.java:260) at com.orientechnologies.orient.jdbc.OrientJdbcConnection.(OrientJdbcConnection.java:63) at com.orientechnologies.orient.jdbc.OrientJdbcDriver.connect(OrientJdbcDriver.java:52) at java.sql.DriverManager.getConnection(DriverManager.java:571) at java.sql.DriverManager.getConnection(DriverManager.java:187) at com.momentum.orientdb.core.JdbcConnectionManager.getConnection(JdbcConnectionManager.java:87) at com.momentum.orientdb.core.JdbcConnectionManager.getConnection(JdbcConnectionManager.java:56) at com.momentum.orientdb.core.JdbcConnectionManager$getConnection.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112) at com.momentum.orientdb.core.test.JdbcConnectionManagerTest.testGetConnection(JdbcConnectionManagerTest.groovy:26) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84) at org.junit.runner.JUnitCore.run(JUnitCore.java:160) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:78) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:212) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:68) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Any idea why? How can I fix it?
UPDATE 1
It seems to me that it has to do with this library (from Google): concurrentlinkedhashmap-lru-1.4.1.jar.
But I searched the development computer's file system and found only the above mentioned version (1.4.1).
UPDATE 2 - Solution
After searching thoroughly I found that I had different version of concurrentlinkedhashmap-lru-xxxx.jar on my development machine's file system and somehow I "managed" to put two different versions in the build.
Meanwhile, I still get the same exceptions when using my library (which I've already tested) in order to establish a connection to OrientDb from within OpenFire since OpenFire uses another version of concurrentlinkedhashmap then the one being used by OrientDb (concurrentlinkedhashmap-lru-1.4.1.jar).