Neo4j 4.0 problem with apoc

After upgrading to Neo4j 4.0.0, a problem is occurred when apoc is added to my dependencies. In a maven project with only a Main file with the following content:

package mypackage;

import org.neo4j.configuration.GraphDatabaseSettings;
import org.neo4j.configuration.connectors.BoltConnector;
import org.neo4j.dbms.api.DatabaseManagementService;
import org.neo4j.dbms.api.DatabaseManagementServiceBuilder;
import org.neo4j.graphdb.GraphDatabaseService;


public class Main {
	public static void main(String[] args) {
		        DatabaseManagementService managementService = new DatabaseManagementServiceBuilder( new File("c:\\temp" ))
                .setConfig( BoltConnector.enabled, true )
        GraphDatabaseService graphDb = managementService.database( GraphDatabaseSettings.DEFAULT_DATABASE_NAME );

if I only have neo4j 4.0.0 in my dependencies, I get no errors. But, when I add


to my dependencies, I get:

java.lang.RuntimeException: Error starting database server at ...
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/text/lookup/StringLookup

Here is my pom.xml:

There seems to be a version conflict at commons-text (Its version is 1.2 in apoc, but the version used in neo4j-common seems to be 1.7).

I tried it in both Windows and Linux under Java 11.

1 Like

try to run call'apoc') in Neo4j. If it does not gives list of apoc function then it mean your APOC installation is not good.


This is not about Neo4j desktop. I want to use APOCs in Java. It used to work before upgrading Neo4j. Unfortunately, your answer does not seem to apply to my case.


Hi shayan,
did you solve the problem? I ran into an other problem with the apoc dependency does not even appear in the dependencies in eclipse.


Unfortunately, no! I stopped upgrading.