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

NPE at org.neo4j.ogm.metadata.MetaData.entityType [DATAGRAPH-1194] #1756

Closed
spring-projects-issues opened this issue Feb 7, 2019 · 6 comments
Assignees
Labels
status: invalid An issue that we don't feel is valid

Comments

@spring-projects-issues
Copy link

shubham opened DATAGRAPH-1194 and commented

Recently upgraded to : 

Spring boot 2.0.8.RELEASE

spring-data-neo4j:jar:5.0.13.RELEASE

neo4j-ogm-bolt-driver:jar:3.1.6

Neo4j 3.3.1

Code changes : 

  1. Updated the model classes with
@Id @GeneratedValue

wherever @GraphId was present.

 The application runs perfectly fine on my local machine ( Mac ) but the following is observed in logs  during startup when deployed on the server

  1.  `
2019-02-07 05:37:38.239  WARN 16645 --- [           main] o.s.d.n.mapping.Neo4jPersistentProperty  : Owning ClassInfo is null for property: private java.lang.String com.domain.object

`

  1. `
o.s.d.neo4j.mapping.Neo4jMappingContext  : No class information found in OGM meta-data for class com.domain.object so treating as simple type for SD Commons

`

The spring boot application starts but throws following runtime exception when trying to access data from Neo4j

`

2019-02-07 05:37:54.692 ERROR 16645 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause
 
java.lang.NullPointerException: null
at org.neo4j.ogm.metadata.MetaData.entityType(MetaData.java:296)
at org.neo4j.ogm.session.Neo4jSession.entityType(Neo4jSession.java:642)

`

 


Affects: 5.0.13 (Kay SR13)

Reference URL: https://stackoverflow.com/questions/37470971/classpath-scanning-in-spring-boot-jar-not-working

@spring-projects-issues
Copy link
Author

shubham commented

Fixed by adding this dependency

 

<dependency>
 <groupId>io.github.lukehutch</groupId>
 <artifactId>fast-classpath-scanner</artifactId>
 <version>3.1.13</version>
 </dependency>

@spring-projects-issues
Copy link
Author

nioertel commented

Lovelace-SR5 is also affected

@spring-projects-issues
Copy link
Author

Michael Simons commented

5.2 (Moore) uses OGM 3.2 which uses ClassGraph, the successor to FastClasspathScanner.

5.1 (Loveloce) uses OGM 3.1 which uses FastClasspathScanner and is not compatible with ClassGraph. FastClasspathScanner became ClassGraph with FastClasspathScanner 3.1.14. That artifact redirects to ClassGraph.

We will update OGM 3.1 to use the latest compatible FastClasspathScanner which is, as shubham correctly identified as 3.1.13.

As this is an OGM issue, I'm gonna close that one here and we track it over there:
neo4j/neo4j-ogm#708

@spring-projects-issues
Copy link
Author

Michael Simons commented

This is an OGM issue

@spring-projects-issues
Copy link
Author

Michael Simons commented

For the readers that stumble upon this issue: While FastClasspathScanner 3.1.13 can be used with Neo4j OGM 3.1 / Spring Data Lovelace, you might ran into issues. While OGM compiles with it and the tests themselves are green in regards of the scanning result, we have repeatable JVM crashes with 3.1.13.

So my advice is, if you ran into issues, to see if an upgrade to
Spring Boot 2.2 / Spring Data Moore / OGM 3.2 is feasible for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

2 participants