2

I try to use new neo4j version 3.2.1 with WildFly 10 and when I try to connect to an embedded Database created with

this.gdbs = new GraphDatabaseFactory().newEmbeddedDatabase(new File(DB_PATH))

I have got this error

10:28:12,960 ERROR [stderr] (neo4j.FileWatcher-1) Exception in thread "neo4j.FileWatcher-1" java.lang.NoClassDefFoundError: com/sun/nio/file/SensitivityWatchEventModifier
10:28:12,960 ERROR [stderr] (neo4j.FileWatcher-1)   at org.neo4j.io.fs.watcher.DefaultFileSystemWatcher.watch(DefaultFileSystemWatcher.java:66)
10:28:12,960 ERROR [stderr] (neo4j.FileWatcher-1)   at org.neo4j.io.fs.watcher.RestartableFileSystemWatcher.watchFile(RestartableFileSystemWatcher.java:107)
10:28:12,961 ERROR [stderr] (neo4j.FileWatcher-1)   at org.neo4j.io.fs.watcher.RestartableFileSystemWatcher.startWatching(RestartableFileSystemWatcher.java:92)
10:28:12,961 ERROR [stderr] (neo4j.FileWatcher-1)   at org.neo4j.kernel.impl.util.watcher.DefaultFileSystemWatcherService$FileSystemEventWatcher.run(DefaultFileSystemWatcherService.java:92)
10:28:12,961 ERROR [stderr] (neo4j.FileWatcher-1)   at java.lang.Thread.run(Thread.java:745)
10:28:12,961 ERROR [stderr] (neo4j.FileWatcher-1) Caused by: java.lang.ClassNotFoundException: com.sun.nio.file.SensitivityWatchEventModifier from [Module "deployment.ksm-app.ear:main" from Service Module Loader]
10:28:12,961 ERROR [stderr] (neo4j.FileWatcher-1)   at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
10:28:12,962 ERROR [stderr] (neo4j.FileWatcher-1)   at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)
10:28:12,962 ERROR [stderr] (neo4j.FileWatcher-1)   at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)
10:28:12,962 ERROR [stderr] (neo4j.FileWatcher-1)   at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)
10:28:12,962 ERROR [stderr] (neo4j.FileWatcher-1)   ... 5 more 

meanwhile node in DB can be created by this code

try(Transaction trn = this.gdbs.beginTx()){
                this.gdbs.createNode(Label.label("Test"));
                trn.success();
}

Can you help me to fix this problem?

Victor
  • 8,309
  • 14
  • 80
  • 129

1 Answers1

0

All JDK classes are not exposed to a deployment by default, add dependencies in jboss-deployment-structure.xml file as below

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
    <deployment>
        <dependencies>
            <system export="true">
                <paths>
                    <path name="com/sun/nio/file"/>
                </paths>
            </system>
        </dependencies>
    </deployment>
</jboss-deployment-structure>
Gaurang
  • 106
  • 7