Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
12-06-2022 02:33 AM
Hi,
I'm trying to migrate from Neo 4.x to 5.x. My test suite uses the test harness (org.neo4j.test:neo4j-harness:5.2.0) to test the queries my application uses. Some of the queries use APOC procedures and functions.
Prior to 5.x, I could use APOC in the test harness by including a dependency on the APOC fat-jar, (e.g. org.neo4j.procedure.apoc.4.4.0.9:all). Following 5.x, the APOC repos are split into core and extended, so I expected the new Maven coordinates to be e.g. org.neo4j.procedure.apoc-core.5.2.1:all, but I see that there's no 5.x fat-jar published to Maven Central. Using the regular jar (org.neo4j.procedure.apoc-core.5.2.1), I get a runtime exception when the test harness tries to start the database, caused by a java.lang.NoClassDefFoundError: apoc/result/NodeResult.
This looks like a missing dependency that previously I would have got from the fat-jar. Is there a new way of running the test harness with APOC in 5.x?
01-31-2023 02:32 AM
Hi @mos20
For APOC core to work,
you have to install the compatible version (in your case 5.2.1) of the apoc-core (from here: https://mvnrepository.com/artifact/org.neo4j.procedure/apoc-core) and apoc-common (from here: https://mvnrepository.com/artifact/org.neo4j.procedure/apoc-common) packages.
Can you try to see if it works with the apoc-common package?
This is because, as you can see on this page: https://mvnrepository.com/artifact/org.neo4j.procedure,
in 5.x the APOC library has been split into multiple maven packages.
Until 4.x there was only one package, the first in the list, i.e. "org.neo4j.procedure » apoc",
while 5.x has been separated into the other 5 packages.
To install apoc core and/or apoc extended, you must first install "apoc-common".
Then, if you also want to use extended functions/procedures (i.e these: https://neo4j.com/labs/apoc/5/overview/),
you should also install the "apoc-extended" package.
The other packages are not strictly necessary, as one contains the test utilities and the other basically contains a compatible version of neo4j community.
01-31-2023 11:22 AM
APOC 5 has been broken into core and extended versions. You can download the extended jar from here:
https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases
All the sessions of the conference are now available online