Neo4j Error - NoClassDefFoundError: Could not initialize class org.neo4j.internal.helpers.Exceptions

Hi,
I moved my working project from my current PC to another PC. I'm using an embedded Neo4j and I am trying to print the Nodes with JUNG. On my old PC it works fine, but now I have a problem with embedded Neo4j.

The following is an example of one of my functions. This function checks if a node with the specified name (passed in as the node parameter) exists. If not, the function tries to correct typos, and tries to find the node again. Neo4j has at the moment a problem with the function managementService.shutdown(). I checked the project setup from both PCs. The setups should be the same. I hope some one can help me fix this.

Function

public String is_Node_in_DB(String node) {
        boolean nodeexists = true;
        int retcnt = 0;
        
        Node n1 = null;

        String db_path = System.getProperty("user.dir") + "./Hagen_NLPToolbox_March2021/Hagen_NLPToolbox_March2021/cooccsdatabase";
        java.nio.file.Path path = Paths.get(db_path);
        if(Files.exists(path))
        {
            File database = new File(db_path);

            managementService = new DatabaseManagementServiceBuilder(database).build();
            graphDB = managementService.database(DEFAULT_DATABASE_NAME);

            System.out.println("database opened for querying");

            try (Transaction tx2 = graphDB.beginTx()) {     
            
                do {
                    n1 = tx2.findNode(Labels.SINGLE_NODE, "name", node);
                    if(n1 != null)
                    {// if node found break bevor improvements starts
                        break;
                    }
                    else if(retcnt ==2)
                    {
                        node = node.toUpperCase();
                    }
                    else if((retcnt == 2)&&(n1 == null))
                    {
                        break;
                    }
                    else if(Character.isUpperCase(node.charAt(0)))
                    { // check of typo lower letter improvements 
                        node = node.substring(0,1).toLowerCase() + node.substring(1);
                        retcnt = retcnt+1;

                    }
                    else if(Character.isLowerCase(node.charAt(0)))  
                    { // check of typo upper letter improvements
                        node = node.substring(0,1).toUpperCase() + node.substring(1);
                        retcnt = retcnt+1;
                    }
                }while(n1 == null);
            
                tx2.commit(); // success();
            }
            managementService.shutdown();
        }
        else
        {
            node = "";
        }
        return node;
    }

Log (with exception)

JRE Eclipse Adoptium/17.0.5 is not supported, advanced source lookup disabled.
 Eclipse debugger will use less precise source lookup implementation for this debug session, but everything else will continue to work otherwise.
Upgrading Eclipse to the latest version will likely make this warning go away.java.io.FileNotFoundException: \Users\+user+\eclipse-workspace-2\DB-Suche\Dokto.json (Das System kann den angegebenen Pfad nicht finden)
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/Dokto/.m2/repository/ch/qos/logback/logback-classic/1.2.10/logback-classic-1.2.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/Dokto/eclipse-workspace-2/DB-Suche/Neo4jDB/Neo4jDB/lib/tika-app-1.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/Dokto/eclipse-workspace-2/DB-Suche/Neo4jDB/Neo4jDB/Neo4jLibs/slf4j-nop-1.7.30.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/Dokto/eclipse-workspace-2/DB-Suche/Neo4jDB/Neo4jDB/JUNGLibs/slf4j.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
Processing took 0 seconds.
16:08:07.640 [AWT-EventQueue-0] DEBUG reactor.util.Loggers - Using Slf4j logging framework
16:08:07.646 [AWT-EventQueue-0] DEBUG reactor.core.publisher.Hooks - Hooking new default : onErrorDropped
16:08:08.944 [AWT-EventQueue-0] DEBUG i.n.u.i.l.InternalLoggerFactory - Using SLF4J as the default logging framework
16:08:08.946 [AWT-EventQueue-0] DEBUG io.netty.util.ResourceLeakDetector - -Dio.netty.leakDetection.level: simple
16:08:08.946 [AWT-EventQueue-0] DEBUG io.netty.util.ResourceLeakDetector - -Dio.netty.leakDetection.targetRecords: 4
16:08:08.965 [AWT-EventQueue-0] DEBUG i.n.util.internal.PlatformDependent0 - -Dio.netty.noUnsafe: false
16:08:08.965 [AWT-EventQueue-0] DEBUG i.n.util.internal.PlatformDependent0 - Java version: 17
16:08:08.966 [AWT-EventQueue-0] DEBUG i.n.util.internal.PlatformDependent0 - sun.misc.Unsafe.theUnsafe: available
16:08:08.967 [AWT-EventQueue-0] DEBUG i.n.util.internal.PlatformDependent0 - sun.misc.Unsafe.copyMemory: available
16:08:08.967 [AWT-EventQueue-0] DEBUG i.n.util.internal.PlatformDependent0 - sun.misc.Unsafe.storeFence: available
16:08:08.968 [AWT-EventQueue-0] DEBUG i.n.util.internal.PlatformDependent0 - java.nio.Buffer.address: available
16:08:08.968 [AWT-EventQueue-0] DEBUG i.n.util.internal.PlatformDependent0 - direct buffer constructor: unavailable: Reflective setAccessible(true) disabled
16:08:08.969 [AWT-EventQueue-0] DEBUG i.n.util.internal.PlatformDependent0 - java.nio.Bits.unaligned: available, true
16:08:08.970 [AWT-EventQueue-0] DEBUG i.n.util.internal.PlatformDependent0 - jdk.internal.misc.Unsafe.allocateUninitializedArray(int): unavailable: class io.netty.util.internal.PlatformDependent0$7 cannot access class jdk.internal.misc.Unsafe (in module java.base) because module java.base does not export jdk.internal.misc to unnamed module @660fd534
16:08:08.970 [AWT-EventQueue-0] DEBUG i.n.util.internal.PlatformDependent0 - java.nio.DirectByteBuffer.<init>(long, int): unavailable
16:08:08.970 [AWT-EventQueue-0] DEBUG i.n.util.internal.PlatformDependent - sun.misc.Unsafe: available
16:08:08.971 [AWT-EventQueue-0] DEBUG i.n.util.internal.PlatformDependent - maxDirectMemory: 2097152000 bytes (maybe)
16:08:08.971 [AWT-EventQueue-0] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.tmpdir: C:\Users\Dokto\AppData\Local\Temp (java.io.tmpdir)
16:08:08.971 [AWT-EventQueue-0] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.bitMode: 64 (sun.arch.data.model)
16:08:08.971 [AWT-EventQueue-0] DEBUG i.n.util.internal.PlatformDependent - Platform: Windows
16:08:08.972 [AWT-EventQueue-0] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.maxDirectMemory: -1 bytes
16:08:08.972 [AWT-EventQueue-0] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.uninitializedArrayAllocationThreshold: -1
16:08:08.973 [AWT-EventQueue-0] DEBUG io.netty.util.internal.CleanerJava9 - java.nio.ByteBuffer.cleaner(): available
16:08:08.973 [AWT-EventQueue-0] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.noPreferDirect: false
16:08:08.973 [AWT-EventQueue-0] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.numHeapArenas: 16
16:08:08.973 [AWT-EventQueue-0] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.numDirectArenas: 16
16:08:08.973 [AWT-EventQueue-0] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.pageSize: 8192
16:08:08.974 [AWT-EventQueue-0] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.maxOrder: 9
16:08:08.974 [AWT-EventQueue-0] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.chunkSize: 4194304
16:08:08.974 [AWT-EventQueue-0] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.smallCacheSize: 256
16:08:08.974 [AWT-EventQueue-0] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.normalCacheSize: 64
16:08:08.974 [AWT-EventQueue-0] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.maxCachedBufferCapacity: 32768
16:08:08.974 [AWT-EventQueue-0] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.cacheTrimInterval: 8192
16:08:08.974 [AWT-EventQueue-0] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.cacheTrimIntervalMillis: 0
16:08:08.974 [AWT-EventQueue-0] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.useCacheForAllThreads: false
16:08:08.974 [AWT-EventQueue-0] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.maxCachedByteBuffersPerChunk: 1023
16:08:08.979 [AWT-EventQueue-0] DEBUG i.n.u.i.InternalThreadLocalMap - -Dio.netty.threadLocalMap.stringBuilder.initialSize: 1024
16:08:08.979 [AWT-EventQueue-0] DEBUG i.n.u.i.InternalThreadLocalMap - -Dio.netty.threadLocalMap.stringBuilder.maxSize: 4096
database opened for querying
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Could not initialize class org.neo4j.internal.helpers.Exceptions
    at org.neo4j.kernel.lifecycle.LifeSupport.shutdown(LifeSupport.java:188)
    at org.neo4j.dbms.database.DatabaseManagementServiceImpl.shutdown(DatabaseManagementServiceImpl.java:131)
    at core.Cooccs.is_Node_in_DB(Cooccs.java:2949)
    at main.DBPlot.check_User_Input(DBPlot.java:1554)
    at main.DBPlot.add_Cluster_to_Graph(DBPlot.java:1752)
    at main.DBPlot.actionPerformed(DBPlot.java:274)
    at java.desktop/javax.swing.JTextField.fireActionPerformed(JTextField.java:525)
    at java.desktop/javax.swing.JTextField.postActionEvent(JTextField.java:740)
    at java.desktop/javax.swing.JTextField$NotifyAction.actionPerformed(JTextField.java:856)
    at java.desktop/javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1810)
    at java.desktop/javax.swing.JComponent.processKeyBinding(JComponent.java:2947)
    at java.desktop/javax.swing.JComponent.processKeyBindings(JComponent.java:2995)
    at java.desktop/javax.swing.JComponent.processKeyEvent(JComponent.java:2909)
    at java.desktop/java.awt.Component.processEvent(Component.java:6403)
    at java.desktop/java.awt.Container.processEvent(Container.java:2266)
    at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5001)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
    at java.desktop/java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1952)
    at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:883)
    at java.desktop/java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1150)
    at java.desktop/java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:1020)
    at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:848)
    at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4882)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
    at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2780)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:716)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:746)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:744)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:743)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
emphasized text

Do you use a package manager like maven or gradle for your build setup? If not you should.

It would automatically pull the correct transitive dependencies from the main artifact that you pull in.

Hi @michael.hunger,
yes im using package manager maven.
I added also all needed *.jar Libs. Maybe for the understanding.
I have an overall project DB-Plot, which combines the embedded Neo4j project with JUNG.

Don't add the libs manually you will definitely miss some, let the package manager take care of it.

Hi @michael.hunger,
i reworked the maven issues. At the moment, i can see the child project is using mentioned neo4j jar files. But now i got the same error
Could not initialize class org.neo4j.internal.helpers.Exceptions
I know the version neo4j Version is a bit old, 4.1.3. Has this neo4j 4.1.3 a special dependencie to an special JDK Version ??