Why I am getting this error?

Hello All,

We are migrating Neo4j from enterprise to community.
old setup
jdk 17, neo4j enterprise - 5.12
Now
jdk 25, neo4j - 2026.07.1

Could someone please have a look on priority..Its very urgent. I tried all possible things from my side.

Caused by: org.neo4j.kernel.extension.FailedToBuildExtensionException: Failed to build kernel extension Extension:ApocConfigExtensionFactory[ApocConfig] because it is compiled with a reference to a class, method, or field, that is not in the class path: 'Could not initialize class org.neo4j.cypher.internal.parser.v5.ast.factory.Cypher5AstLexer'. The most common cause of this problem, is that Neo4j has been upgraded without also upgrading all installed extensions, such as APOC. Make sure that all of your extensions are build against your specific version of Neo4j.
at org.neo4j.kernel.extension.ExtensionFailureStrategies.wrap(ExtensionFailureStrategies.java:56)
at org.neo4j.kernel.extension.ExtensionFailureStrategies$1.handle(ExtensionFailureStrategies.java:68)
at org.neo4j.kernel.extension.AbstractExtensions.init(AbstractExtensions.java:69)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:317)
... 13 more
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.neo4j.cypher.internal.parser.v5.ast.factory.Cypher5AstLexer
at org.neo4j.cypher.internal.parser.v5.ast.factory.Cypher5AstParser.newLexer(Cypher5AstParser.scala:63)
at org.neo4j.cypher.internal.parser.ast.AntlrAstParser.preparsedTokens(AntlrAstParser.scala:130)
at org.neo4j.cypher.internal.parser.ast.AntlrAstParser.parse(AntlrAstParser.scala:48)
at org.neo4j.cypher.internal.parser.ast.AntlrAstParser.parse$(AntlrAstParser.scala:39)
at org.neo4j.cypher.internal.parser.v5.ast.factory.Cypher5AstParser.parse(Cypher5AstParser.scala:39)
at org.neo4j.cypher.internal.parser.v5.ast.factory.Cypher5AstParser.expression(Cypher5AstParser.scala:48)
at org.neo4j.cypher.internal.evaluator.SimpleExpressionEvaluator.parseAndEvaluate(SimpleExpressionEvaluator.java:96)
at org.neo4j.cypher.internal.evaluator.SimpleExpressionEvaluator.evaluate(SimpleExpressionEvaluator.java:55)
at org.neo4j.procedure.impl.MapConverter.apply(MapConverter.java:41)
at org.neo4j.procedure.impl.MapConverter.apply(MapConverter.java:30)
at org.neo4j.procedure.impl.Cypher5TypeCheckers$DefaultValueConverter.defaultValue(Cypher5TypeCheckers.java:291)
at org.neo4j.procedure.impl.MethodSignatureCompiler.signatureFor(MethodSignatureCompiler.java:71)
at org.neo4j.procedure.impl.ProcedureCompiler.compileProcedure(ProcedureCompiler.java:293)
at org.neo4j.procedure.impl.ProcedureCompiler.compileProcedure(ProcedureCompiler.java:250)
at org.neo4j.procedure.impl.ProcedureCompiler.compileProcedure(ProcedureCompiler.java:421)
at org.neo4j.procedure.impl.GlobalProceduresRegistry$BulkRegistration.registerProcedure(GlobalProceduresRegistry.java:313)
at org.neo4j.graphdb.factory.module.edition.AbstractEditionModule.registerProcedures(AbstractEditionModule.java:107)
at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.lambda$setupProcedures$6(DatabaseManagementServiceFactory.java:415)
at org.neo4j.procedure.LazyProcedures.init(LazyProcedures.java:65)
at org.neo4j.procedure.LazyProcedures.registerComponent(LazyProcedures.java:115)
at apoc.ApocConfig.(ApocConfig.java:141)
at apoc.ApocConfigExtensionFactory.newInstance(ApocConfigExtensionFactory.java:58)
at apoc.ApocConfigExtensionFactory.newInstance(ApocConfigExtensionFactory.java:34)
at org.neo4j.kernel.extension.AbstractExtensions.newInstance(AbstractExtensions.java:134)
at org.neo4j.kernel.extension.AbstractExtensions.init(AbstractExtensions.java:63)
... 14 more
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.ExceptionInInitializerError [in thread "main"]
at org.neo4j.cypher.internal.parser.v5.ast.factory.Cypher5AstParser.newLexer(Cypher5AstParser.scala:63)
at org.neo4j.cypher.internal.parser.ast.AntlrAstParser.preparsedTokens(AntlrAstParser.scala:130)
at org.neo4j.cypher.internal.parser.ast.AntlrAstParser.parse(AntlrAstParser.scala:48)
at org.neo4j.cypher.internal.parser.ast.AntlrAstParser.parse$(AntlrAstParser.scala:39)
at org.neo4j.cypher.internal.parser.v5.ast.factory.Cypher5AstParser.parse(Cypher5AstParser.scala:39)
at org.neo4j.cypher.internal.parser.v5.ast.factory.Cypher5AstParser.expression(Cypher5AstParser.scala:48)
at org.neo4j.cypher.internal.evaluator.SimpleExpressionEvaluator.parseAndEvaluate(SimpleExpressionEvaluator.java:96)
at org.neo4j.cypher.internal.evaluator.SimpleExpressionEvaluator.evaluate(SimpleExpressionEvaluator.java:55)
at org.neo4j.procedure.impl.MapConverter.apply(MapConverter.java:41)
at org.neo4j.procedure.impl.MapConverter.apply(MapConverter.java:30)
at org.neo4j.procedure.impl.Cypher5TypeCheckers$DefaultValueConverter.defaultValue(Cypher5TypeCheckers.java:291)
at org.neo4j.procedure.impl.MethodSignatureCompiler.signatureFor(MethodSignatureCompiler.java:71)
at org.neo4j.procedure.impl.ProcedureCompiler.compileProcedure(ProcedureCompiler.java:293)
at org.neo4j.procedure.impl.ProcedureCompiler.compileProcedure(ProcedureCompiler.java:250)
at org.neo4j.procedure.impl.ProcedureCompiler.compileProcedure(ProcedureCompiler.java:421)
at org.neo4j.procedure.impl.GlobalProceduresRegistry$BulkRegistration.registerProcedure(GlobalProceduresRegistry.java:313)
at org.neo4j.graphdb.factory.module.edition.AbstractEditionModule.registerProcedures(AbstractEditionModule.java:107)
at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.lambda$setupProcedures$6(DatabaseManagementServiceFactory.java:415)
at org.neo4j.procedure.LazyProcedures.init(LazyProcedures.java:65)
at org.neo4j.procedure.LazyProcedures.registerComponent(LazyProcedures.java:115)
at apoc.ApocConfig.(ApocConfig.java:141)
at apoc.ApocConfigExtensionFactory.newInstance(ApocConfigExtensionFactory.java:58)
at apoc.ApocConfigExtensionFactory.newInstance(ApocConfigExtensionFactory.java:34)
at org.neo4j.kernel.extension.AbstractExtensions.newInstance(AbstractExtensions.java:134)
at org.neo4j.kernel.extension.AbstractExtensions.init(AbstractExtensions.java:63)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:317)
at org.neo4j.kernel.lifecycle.LifeSupport.init(LifeSupport.java:56)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:85)
at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.startDatabaseServer(DatabaseManagementServiceFactory.java:282)
at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.build(DatabaseManagementServiceFactory.java:225)
at org.neo4j.test.TestDatabaseManagementServiceBuilder.newDatabaseManagementService(TestDatabaseManagementServiceBuilder.java:145)
at org.neo4j.test.TestDatabaseManagementServiceBuilder.build0(TestDatabaseManagementServiceBuilder.java:135)
at

@java.sandeep007

The error message reports

Caused by: org.neo4j.kernel.extension.FailedToBuildExtensionException: Failed to build kernel extension Extension:ApocConfigExtensionFactory[ApocConfig] because it is compiled with a reference to a class, method, or field, that is not in the class path: 'Could not initialize class org.neo4j.cypher.internal.parser.v5.ast.factory.Cypher5AstLexer'. The most common cause of this problem, is that Neo4j has been upgraded without also upgrading all installed extensions, such as APOC. Make sure that all of your extensions are build against your specific version of Neo4j.
at

what apoc jar file is currently in your plugins directory?

Can you return the output of a directory listing from plugins/

@java.sandeep007

I am unable to reproduce the error with a fresh install of Neo4j Community 2026.07.1 and with APOC. Note I am on java 21 whereas you are on java 25 ( though i dont think is the source of the failure) and as evidence


 java --version
openjdk 21.0.10 2026-01-20 LTS
OpenJDK Runtime Environment Zulu21.48+17-CA (build 21.0.10+7-LTS)
OpenJDK 64-Bit Server VM Zulu21.48+17-CA (build 21.0.10+7-LTS, mixed mode, sharing)


neo4j@ubuntu24:~/single/community$ ls -al
total 255748
drwxrwxr-x 2 neo4j neo4j      4096 Sep  4 14:20 .
drwxrwxr-x 5 neo4j neo4j      4096 Sep  4 14:17 ..
-rw-rw-r-- 1 neo4j neo4j 261873147 Sep  4 14:20 neo4j-community-2026.07.1-unix.tar.gz
neo4j@ubuntu24:~/single/community$ tar xzf neo4j-community-2026.07.1-unix.tar.gz
neo4j@ubuntu24:~/single/community$ cd neo4j-community-2026.07.1/labs/
neo4j@ubuntu24:~/single/community/neo4j-community-2026.07.1/labs$ cp apoc-2026.07.1-core.jar ../plugins/
neo4j@ubuntu24:~/single/community/neo4j-community-2026.07.1/labs$ cd ../bin

neo4j@ubuntu24:~/single/community/neo4j-community-2026.07.1/bin$ ./neo4j start
Directories in use:
home:         /home/neo4j/single/community/neo4j-community-2026.07.1
config:       /home/neo4j/single/community/neo4j-community-2026.07.1/conf
logs:         /home/neo4j/single/community/neo4j-community-2026.07.1/logs
plugins:      /home/neo4j/single/community/neo4j-community-2026.07.1/plugins
import:       /home/neo4j/single/community/neo4j-community-2026.07.1/import
data:         /home/neo4j/single/community/neo4j-community-2026.07.1/data
certificates: /home/neo4j/single/community/neo4j-community-2026.07.1/certificates
licenses:     /home/neo4j/single/community/neo4j-community-2026.07.1/licenses
run:          /home/neo4j/single/community/neo4j-community-2026.07.1/run
Starting Neo4j.
Started neo4j (pid:1491). It is available at http://localhost:7474
There may be a short delay until the server is ready.


neo4j@ubuntu24:~/single/community/neo4j-community-2026.07.1/bin$ ./cypher-shell
username: neo4j
password:
fPassword change required
new password:
confirm password:
Connected to Neo4j using Bolt protocol version 6.1 at neo4j://localhost:7687 as user neo4j.
Type :help for a list of available commands or :exit to exit the shell.
Note that Cypher queries must end with a semicolon.
neo4j@neo4j> create (n:Person {id:1});
0 rows
ready to start consuming query after 205 ms, results consumed after another 0 ms
Created 1 node, set 1 property, added 1 label
neo4j@neo4j> return apoc.version();
+----------------+
| apoc.version() |
+----------------+
| "2026.07.1"    |
+----------------+

1 row