graphaware / neo4j-to-elasticsearch

GraphAware Framework Module for Integrating Neo4j with Elasticsearch
261 stars 57 forks source link

mapping.json does not load from conf file #121

Closed sofiane01234 closed 6 years ago

sofiane01234 commented 6 years ago

Hi,

I've got the community version of Neo4j and when I use the following config settings:

com.graphaware.module.ES.mapping=com.graphaware.module.es.mapping.JsonFileMapping
com.graphaware.module.ES.file=mapping.json

I get an error:

java.lang.RuntimeException: Unable to read json mapping file
    at com.graphaware.module.es.mapping.JsonFileMapping.configure(JsonFileMapping.java:53)
    at com.graphaware.module.es.ElasticSearchConfiguration.withMapping(ElasticSearchConfiguration.java:133)
    at com.graphaware.module.es.ElasticSearchModuleBootstrapper.doBootstrapModule(ElasticSearchModuleBootstrapper.java:101)
    at com.graphaware.module.es.ElasticSearchModuleBootstrapper.doBootstrapModule(ElasticSearchModuleBootstrapper.java:31)
    at com.graphaware.runtime.module.BaseRuntimeModuleBootstrapper.bootstrapModule(BaseRuntimeModuleBootstrapper.java:66)
    at com.graphaware.runtime.bootstrap.RuntimeKernelExtension.registerModules(RuntimeKernelExtension.java:143)
    at com.graphaware.runtime.bootstrap.RuntimeKernelExtension.start(RuntimeKernelExtension.java:113)
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:433)
    at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107)
    at org.neo4j.kernel.extension.KernelExtensions.start(KernelExtensions.java:86)
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:433)
    at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107)
    at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.initFacade(GraphDatabaseFacadeFactory.java:195)
    at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:130)
    at org.neo4j.server.CommunityNeoServer.lambda$static$0(CommunityNeoServer.java:57)
    at org.neo4j.server.database.LifecycleManagingDatabase.start(LifecycleManagingDatabase.java:89)
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:433)
    at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107)
    at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:202)
    at org.neo4j.desktop.runtime.DatabaseActions.start(DatabaseActions.java:71)
    at org.neo4j.desktop.ui.StartDatabaseActionListener$1.run(StartDatabaseActionListener.java:64)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$500(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: class path resource [mapping.json] cannot be resolved to URL because it does not exist
    at org.springframework.core.io.ClassPathResource.getURL(ClassPathResource.java:187)
    at org.springframework.core.io.AbstractFileResolvingResource.getFile(AbstractFileResolvingResource.java:48)
    at com.graphaware.module.es.mapping.JsonFileMapping.configure(JsonFileMapping.java:50)
    ... 34 more

mapping.json file is in the neo4j plugins directory I've tried to put mapping.json file in many places but it still didn't work. I even tried to write the whole absolute path of the file mapping.json in the neo4j.conf, and it didn't work. where should i put it ? Thanks

ikwattro commented 6 years ago

The file should be in the /conf directory of neo4j, can you paste the previous lines of the logs, the path from where it tries to load it should be logged.

sofiane01234 commented 6 years ago

Thanks for your response. Actually, I'm using a previous version of Neo4j/Graphaware (3.1.3) , and it does not contain the /conf directory Does this version supports the feature of mapping file ??

ikwattro commented 6 years ago

Neo4j 3.1.3 contains definitely a conf directory, check here :

https://neo4j.com/docs/operations-manual/3.1/configuration/file-locations/

Are you sure about that version ?

sofiane01234 commented 6 years ago

actually we are using the neo4j desktop version ( windows ) and the config file is located in this directory %APPDATA%\Neo4j Community Edition\neo4j.conf

i've tried to put my mapping.json there , but it doesn't work Thanks in advance

ikwattro commented 6 years ago

Allright, Not sure about the compatibility of our plugins on desktop for windows. latest versions from 3.3.4 have support for full path to the conf file. So the only recommendation I have is to upgrade to 3.4.0 or use Neo4j standalone (not with desktop)

sofiane01234 commented 6 years ago

i did upgrade to 3.4.0 , but once done , i can't have the admin view ( see picture ) to manage our databases. any idea about how to have it please ? Thanks

ikwattro commented 6 years ago

No idea, we don't use desktop that much :/

ikwattro commented 6 years ago

Closing this issue, as the plugin with the mapping.json is proven to be working on 3.4.0