Closed wilkinsona closed 7 years ago
@wilkinsona: We are making changes to the Configuration
in order to remove the static Components
class. It appears we don't have a test for this situation. I will add it to the https://github.com/neo4j/neo4j-ogm/tree/refactor/remove-components before merging.
The results of this merge will mean users can either a) Not supply a properties file and simply call new Configuration.Builder()
b) supply a file and load it through new Components.Builder(ConfigurationSource)
. Users can then override the initial values through the builder before calling build()
.
In this release we want to emphasis configuration via code and letting users supply their own configuration source. If that happens to be a ClasspathConfigurationSource
then they can use that but we will be avoiding "autoconfiguration" as of 3.0.
HTH
@wilkinsona This should work if you build from source. We are having issues with one of our driver tests that is taking a long time. You should be able to keep going if you mvn install for now.
@wilkinsona Can you update and check if this is still occurring (from SDN snapshot)?
@mangrish This seems to have been fixed as part of the removal of Components
. Thanks.
Expected Behavior
A
NullPointerException
is not thrown when callingnew SessionFactory(Configuration, String...)
Current Behavior
A
NullPointerException
is thrown when callingnew SessionFactory(Configuration, String...)
:Possible Solution
The underlying problem appears to be that
Components.driver()
is still called, butComponents
has not been initialized with theConfiguration
instance. This initialisation was removed in https://github.com/neo4j/neo4j-ogm/commit/7b2b21e5cf82661f227733e7f0855b7c41dae47b which is entitled "Making Configuration the default mechanism for settings rather than Components". It looks like the move to a Configuration-based mechanism is incomplete.Steps to Reproduce (for bugs)
The following code will reproduce the problem if there's no
ogm.properties
file on the classpath:The problem can be worked around by calling
Components.configure(Configuration)
prior to creating theSession Factory
:Context
I am trying to upgrade Spring Boot 2.0 snapshots to use OGM 3.0 snapshots as required by Spring Data Neo4J 5.0 snapshots.
Your Environment