java - Setting Neo4j cache -


I'm using Neo4j 1.9.4 for a project and I run in a strange behavior:

< P> I have a piece of code that works well I have set classpath with an ivy file and all is well

[code] public static void {// Cash Providers ArrayList & Lt; CacheProvider & gt; CashList = new arreelist & lt; CashProver & gt; (); System.out.println ("create DB configuration"); CacheList.add (new softcap provider); // Kernel Extensions LuceneKernelExtensionFactory lucene = New LuceneKernelExtensionFactory (); & Lt; KernelExtensionFactory & lt ;? & Gt; & Gt; Extension = new ArrayList & lt; KernelExtensionFactory & lt ;? & Gt; & Gt; (); Extensions.add (Lucene); // Database Setup GraphDatabaseFactory gdbf = New GraphDatabaseFactory (); Gdbf.setKernelExtensions (extension); Gdbf.setCacheProviders (cacheList); GraphDatabaseService db = gdbf.newEmbeddedDatabase ("/ tmp / test"); }

The problem is that when I change cacheList.add (new SoftCap Provider ()) in cacheList.add (new WeakCacheProvider ()) I try to get the following error:

  java.lang.IllegalArgumentException: there is no provider for the cache type 'soft'; cache providers load using Java service loading Are carried out where they register themselves in the resource (plain-text) file found on the class path under the Meta-INF / services / org.neo4j.kernel.impl.cache.CacheProvider May include. This missing provider may either be due to lack of such a missing registration, or lack of provider. Org.neo4j.kernel.InternalAbstractGraphDatabase.create at (InternalAbstractGraphDatabase.java:356) org.neo4j.kernel.InternalAbstractGraphDatabase.run (internal abstract.graph.database.java252) at org.neo4j.kernel.EmbeddedGraphDatabase. & Lt; Init & gt; (Embedded Graph Database: Java) org.neo4j.graphdb at org.neo4j.graphdb.factory.GraphDatabaseFactory $ 1.newDatabase (GraphDatabaseFactory.java:88) org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase (GraphDatabaseBuilder.java: 207) but on. Factory on Ttt.App.main (app.java34) Graphic DatabasesFinet. NEEMBDDatabase (Graphdatabasefighter.java: 69)  

If I try to use No Chaupower I am a strong keyword player.

I tried to add the file meta-INF / services / org.neo4j.kernel.impl.cache.CacheProvider with the following content but this is not changing anything.

org.neo4j.kernel.impl.cache.WeakCacheProvider org.neo4j.kernel.impl.cache.SoftCacheProvid er org.neo4j.kernel.impl.cache.NoCacheProvider org.neo4j.kernel. Impl.cache.StrongCacheProvider

Do you have any ideas of what's going on? I do not understand why only one cash provider type is working.

Please note that I have to use Neo4j 1.9.4 and I can not change it.

Edit: My project is a basic eclipse plug-in project without any other dependency

Edit2: Another interesting thing is that if I use map & lt; String, string & gt; I get the same error, even .

  public static zero main (string [] args) {Map & lt; String, string & gt; Config = new hashmap & lt; String, string & gt; (); Config.put ("cache_type", "soft"); GraphDatabaseService db = null; Db = new embedded graph database ("/ tmp / test", config, archive. AmptiIlit, archive. AmptiIlit, archive.AMPTIIlt, archive.AMPTI_LIST); } Java.lang.IllegalArgumentException: The cache type is not a provider for 'soft'. Cash providers are loaded using Java Service Loading where they register themselves in the resource (plain-text) file found on the class path under the Meta-INF / services / org.neo4j.kernel.impl.cache.CacheProvider . This missing provider may either be due to lack of such a missing registration, or lack of provider. Org.neo4j.kernel.InternalAbstractGraphDatabase.create at (InternalAbstractGraphDatabase.java:356) org.neo4j.kernel.InternalAbstractGraphDatabase.run (internal abstract.graph.database.java252) at org.neo4j.kernel.EmbeddedGraphDatabase. & Lt; Init & gt; (Embedded graph database: Java: 106) on ttt.App.main (app.java36)  

About trying to specify it directly in the config, such as:

  GraphDatabaseService db = gdbf.newEmbeddedDatabaseBuilder ('path / to / db'). SetConfig (GraphDatabaseSettings.cache_type, WeakCacheProvider.NAME) .newGraphDatabase ()  

Valid, I have not tried to do this in 1.9.4, but maybe it's worth a shot.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -