Neo4J 4 + Apoc : Unable to set up injection for procedure 'Static' - neo4j

Getting the following error on neo4j server startup with the apoc plugin.
Have copied the jar to the plugins folder.
Caused by:
org.neo4j.kernel.api.exceptions.ComponentInjectionException: Unable to
set up injection for procedure 'Static', the field 'apocConfig' has
type 'class apoc.ApocConfig' which is not a known injectable component
Neo4j version: 4.0.4
Apoc version: 4.0.0.13
What could be the problem?

I would suggest reviewing the installation procedure to see if you missed any steps,
https://neo4j.com/docs/operations-manual/current/installation/linux/
Also, double check the java version that neo4j is using, and check if there are any other local java environment factors specific to this install. class paths, other jars, etc.

We were having the same issue with neo4j 4.x and custom plugin folder.
Updating custom plugin folder in neo4j config didn't work, we had to add folder (or extension) into java CP (classpath) as well.
It worked in 3.x neo4j version without adding a folder into the classpath.
Try to make sure that you have plugins folder listed in -cp and might work for you.

Similar to Ilija's problem, our embedded database (using Eclipse with the Maven plugin) did not like our custom plugin folder.
Since the database was for setup and then deployment (effectively 2 separate things), we could move the database from the default Neo4j directory after it was setup.
As a test, you could delete the contents of your plugin folder and see if it works then.

Related

Neo4J crashes after installing APOC plugin

I'm trying to install the APOC Full jar file (4.2.0.6) to my Neo4J instance that's running in a Google Compute VM. To do so, I've installed the JAR file from GitHub releases to the /plugins folder. Each time I restart or run the environment it crashes with the following output to logs:
"Some jar procedure files (apoc-4.2.0.6-all.jar) are invalid, see log for details."
There's really no additional details provided...
If I copy the default APOC Core library found withing /labs, it works. I've tried to download this same file from Github and it fails. I've verified that the same user/group permissions are applied to the downloaded file as well.
Any ideas?
This usually happens for two reasons:
First is version mismatch. You can check which version you should use based on the version matrix, which is available at: https://github.com/neo4j-contrib/neo4j-apoc-procedures#version-compatibility-matrix. Unfortunately, it is not always up to date, but the APOC versions are if I understand correctly:
APOC 4.1.x.x -> Neo4j 4.1.x
APOC 4.2.x.x.-> Neo4j 4.2.x
APOC 4.3.x.x -> Neo4j 4.3.x
If I had to guess, you are probably using Neo4j 4.3 or 4.1 and using an APOC that is designed to work with Neo4j 4.2.
The other issue is that sometimes you have multiple APOC plugin files in the plugin folders, so that will also crash Neo4j.

Is apoc.rel.startNode removed from apoc 4.2.0.0?

I have neo4j 4.2.1 & apoc 4.2.0.0 installed on my mac. When I run the example on https://neo4j.com/labs/apoc/4.2/overview/apoc.rel/apoc.rel.startNode/ in neo4j desktop, I get the following error:
Unknown function 'apoc.rel.startNode' (line 4, column 8 (offset: 204))
"RETURN apoc.rel.startNode(rel) AS startNode"
I am able to successfully run the example on https://neo4j.com/labs/apoc/4.2/overview/apoc.rel/apoc.rel.type/
Does anyone know what is wrong? Thanks!
In 4.x, APOC core procs/functions are bundled with Neo4j and can be moved from the labs folder to the plugins folder for installation. It's possible that the function in question wasn't included in this core library.
You can look for and download the appropriate full version of APOC here, that will include functions and procedures beyond what is contained in the APOC core library.
https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases
Make sure you remove the existing jar when you add in the full jar, as if you try to start up with both in the plugins folder you'll encounter errors.

Error when tring to execute apoc.refactor.mergeNodes

I have neo4j version server 3.5.18 and I've installed apoc version 3.5.0.11. I think that I have correctly modified the conf file in this way
dbms.directories.plugins=/Users/lx2pwnd/Desktop/dev/neo4j-community-3.5.18/plugins
...
dbms.security.procedures.unrestricted=algo.*,apoc.*
...
dbms.security.procedures.whitelist=apoc.coll.*,apoc.load.*
But when I try to execute a query which contains CALL apoc.refactor.mergeNodes(..) i get this error:
There is no procedure with the name `apoc.refactor.mergeNodes` registered for this database instance. Please ensure you've spelled the procedure name correctly and that the procedure is properly deployed.
What's wrong ?
I believe the plugins path needs to be relative to the neo4j installation directory. This is safer, since different neo4j versions can be installed simultaneously, and they may need different plugin versions.
Try changing the dbms.directories.plugins value back to plugins, putting the APOC jar file in the existing plugins directory under your neo4j installation directory, and restarting neo4j.

Quartz versioning issue with jboss

I m having quartz 1.7.3 in .grails/plugins folder in development environment
where in grails/web-inf/lib i have quartz-1.8.4.jar version
It works properly in development sts 3.1.0 IDE version
When i moved the same to production environment by creating war directory in the war folder it includes both 1.7.3 and quartz-1.8.4.jar files at .war/web-inf/lib/
where in jboss/server/default/lib contains quartz.jar (i.e. 1.5.2 comes with by default jboss)
now i m facing issue in invoking quartz jobs on start up and afterwards
same thing is working without changing anything in other server only i m facing the compatibility after putting logs in config.groovy i came to know the error.
I tried to put one jar from 1.7 or 1.8 in web-inf/lib still didn't worked
I did put the 1.5.2 version in web-inf/lib folder still i m facing compatibility issue
Any idea/suggestions
If i remember,
You need to check the quatz tables in the db, may in the other server ther not exist in the db or somting like that..
Tables are starting QURTZ_?
There is somting like 5-7 tables in the db.
There was versioning issue as more than one jar of diff versions were getting conflicting came to know after switching to logging in the system. As there were one more jar included in jboss-web-deplyer/lib directory after removing that jar the problem got resolved.
Thanks for the help.

How to create plugin in neo4j?

I created plugin in neo4j by next steps:
1) create *.class from *.java (copile with Eclipse)
2) put *.class into .../org/neo4j/server/plugins/
3) create *.jar (using jar)
4) put into *.jar/META-INF/services/ file "org.neo4j.server.plugins.ServerPlugin" with text "org.neo4j.server.plugins.TransportRouter".
5) put *.jar into .../neo4j/plugins/
6) restart server
But my plugin do not see in "extensions" ("curl localhost:7474/db/data/").
Why?
TIA, Eugeny.
Adding this answer for the benefit of others. I had similar problem but it was not a issue with the code. You need to make sure neo4j server is stopped before you copy the jar in plugins directory. If you copy it before its stopped then restart it. It will not work. I tried this on both 1.8.2 and 1.9.2
Simple steps to be added for installing plugin
Stop the neo4j server
Copy the plugin jar file in plugins directory.
start the neo4j server
Your plugin should be detected. This issue was reproducible with the example plugin GetAll as well. Hope this helps others.
Eugeny can you list the content of the jar jar tf your-jar.jar and the source code of your class.
Do you depend on any other libraries?
please see the Neo4j manual for the needed steps.
Problem was solved.
It's my error in initialization of my class:
public TransportRouter( EmbeddedReadOnlyGraphDatabase graphdb ) {
It was replaced by:
public TransportRouter() {

Resources