[neo4j] error report when visiting neo4j in spring boot project

Spring boot project uses spring-data-neo4j to connect with neo4j. It can start and access the database normally when running locally all the time. If you write dockerfile well and run on the server with docker compose, you will report an error, such as:

Caused by: java.lang.NullPointerException: null
    at org.neo4j.ogm.MetaData.entityType(MetaData.java:280) 

The reasons are as follows:

stay pom.xml To solve the problem, add dependency to

 <!--Not adding this package to run in docker will report an error-->

Read More: