Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClassNotFoundException with APOC when running with embedded Java API and custom procedure classloader #676

Open
DirkMahler opened this issue Oct 9, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@DirkMahler
Copy link

DirkMahler commented Oct 9, 2023

jQAssistant uses the Java API of Neo4j 4.4.x in embedded mode and allows registration of custom procedures (e.g. APOC), internally mapped to:

GlobalProcedures.registerProcedure(procedureType);

The procedureType is loaded using a custom classloader having the classloader which provides the Neo4j classes as parent. The registration itself is successful, but trying to use the procedure

call apoc.help('help')

fails with

Neo.ClientError.Procedure.ProcedureCallFailed
Failed to invoke procedure `apoc.help`: Caused by: java.lang.NoClassDefFoundError: apoc/help/Help

The issue seems to be related to the hard-coded classloader used in https://github.com/neo4j/neo4j/blob/4.4/community/procedure/src/main/java/org/neo4j/procedure/impl/ProcedureCompilation.java#L840, I replaced it locally with the TCCL and everything is fine. If required I can provide a PR, but we'd need to align how to create a test for it (doesn't seem trivial).
Let me know if I should provide a demonstrator project with instructions on how to reproduce.

Neo4j Version: 4.4.26
Operation System: Win10 (probably any)
API: Embedded Java API/ Cypher

@DirkMahler DirkMahler added the bug Something isn't working label Oct 9, 2023
@hedengran
Copy link

Hi @DirkMahler, thank you for the report. We are looking into it, and will get back to you.

@mnd999 mnd999 transferred this issue from neo4j/neo4j Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants