Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
04-30-2020 04:00 AM
Hi
I'm developing an app using Neo4j 3.5.14 database and Neo4j-OGM. Whilst developing the POC i hand crafted the CRUD operations using Cypher and the java driver 1.7.5. It worked fine. Now as we move to formalising the app we want to exploit Neo4j-ogm.
The Maven based dependencies we have created for the project are as below.
Very early in the app execution we are getting this exception (see below) being thrown from deep inside the driver. Any bright ideas about the cause of this ??
Thanks in advance
04-30-2020 07:30 AM
This looks like a classpath problem coming from a duplicated java driver dependency in different versions.
As you can see in the exception log there are some internal calls going on in the driver. From the changes in the driver, I can see that the method was introduced in the 4.0 version and is not available in the 1.7 line of the driver.
The list in eclipse looks pretty ok, so I would suggest doing a mvn dependency:tree
on your project and looking at the neo4j-java-driver versions.
05-03-2020 05:16 AM
Hi Gerrit,
ignore my earlier posts. I have done some more digging and can now identify what i think is the root cause.
In summary
(Attachment Synopsis of Neo4j OGM problem.pdf is missing)
(Attachment trial.zip is missing)
05-03-2020 08:26 AM
Thanks for the detailed analysis. Could you please attach those files (again?)
05-03-2020 01:03 PM
Hi Gerrit - which files - the pdf & zip that got rejected or the bundle of txt and png files??
05-03-2020 01:10 PM
Hi Gerrit - which files - the pdf & zip that got rejected or the bundle of txt and png files??
cheers
Rod| gerrit.meier Gerrit Meier Neo4j Staff
May 3 |
- | - |
rcbs0357:
(Attachment Synopsis of Neo4j OGM problem.pdf is missing)
(Attachment trial.zip is missing)
Thanks for the detailed analysis. Could you please attach those files (again?)
Visit Topic or reply to this email to respond.
In Reply To
| rcbs0357
May 3 |
- | - |
Hi Gerrit, ignore my earlier posts. I have done some more digging and can now identify what i think is the root cause. In summary your earlier observation re conflicting multiple drivers (1.7.5 & 4.0.1) was spot on - many thanks. Unfortunately that revealed another exception - ExceptionIninitial…
Visit Topic or reply to this email to respond.
To unsubscribe from these emails, click here.
(Attachment Synopsis of Neo4j OGM problem.pdf is missing)
(Attachment trial.zip is missing)
05-03-2020 09:18 AM
Hi Gerrit,
Try again - this time with just png and text files.
Instead of the pdf you have...Synopsis of Neo4j OGM problem - page 1 through to Synopsis of Neo4j OGM problem - page 7
Instead of the zipped Eclipse project you have...
Class1.java.txt
Class2.java.txt
DomainmodelFactory.java.txt
FactoryInterface.java.txt
Neo4JSessionFactory.java.txt
stuff.java.txt
pom.xml.txt
logback-test.xml.txt
POM_Dependencies.png
trial_Project_package_Structure.png
cheers Rod.
Class1.java.txt (1.11 KB)
DomainmodelFactory.java.txt (1.25 KB)
FactoryInterface.java.txt (211 Bytes)
Class2.java.txt (818 Bytes)
Neo4JSessionFactory.java.txt (630 Bytes)
stuff.java.txt (757 Bytes)
pom.xml.txt (2.41 KB)
logback-test.xml.txt (614 Bytes)
04-30-2020 11:07 AM
Firstly - many thanks for your swift response - really appreciated.
I have run an mvn dependency tree against the project and i do NOT see a smoking gun.
The output is attached. as you can see the only neo4j-java-driver is 4.0.1.
04-30-2020 12:49 PM
Hi, well I think i found part of the problem - the project had a dependant project in the build path andthat dependant project was built with 1.7.5.
I've cleaned that up and observed that maven is no longer trying to drag 1.7.5 into the local repo.
BUT..
there is still a problem in the same area of code though the exception has now changed to "ExceptionInInitializerError".
So i am in a bit of a double bind and any suggestions would be gratefully received
Many thanks
05-01-2020 11:07 AM
Take a closer look at org.neo4j.ogm.session.SessionFactory.java#232 SessionFactory.unwrap()
05-03-2020 05:11 AM
Hi Gerrit,
ignore my earlier posts. I have done some more digging and can now identify what i think is the root cause.
In summary
05-03-2020 10:10 PM
You are accessing Neo4JSessionFactory#createNeo4JSession
before it was completely initialized.
Starting with the new SessionFactory
in this class, Neo4j-OGM begins to scan for entities and encounters Class2
with the static field of type DomainmodelFactory
and its initialization call.
The DomainmodelFactory
needs the Session mySession
field that gets set via Neo4JSessionFactory.createNeo4JSession()
. This access returns null because the initialization process is not yet completed. Your code is still in the first step and as a consequence the graphSessionFactory
in Neo4JSessionFactory
is not yet set.
To solve this, you should really avoid using all those static references in your code.
05-04-2020 04:31 AM
Thank you Gerrit - that was the problem - a case of me weaving tangled webs when first practising OGM.
All the sessions of the conference are now available online