Hello,
I'm using Spring Boot 2.6.2 (comes with spring-data-neo4j:6.2.0 and neo4j-cypher-dsl:2021.4.1), I'm having the following error
java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key assertions.node-required
at java.base/java.util.ResourceBundle.getObject(ResourceBundle.java:564) ~[na:na]
at java.base/java.util.ResourceBundle.getString(ResourceBundle.java:521) ~[na:na]
at org.neo4j.cypherdsl.core.Functions.id(Functions.java:57) ~[neo4j-cypher-dsl-2021.4.1.jar:2021.4.1]
at org.neo4j.cypherdsl.core.AbstractNode.internalId(AbstractNode.java:96) ~[neo4j-cypher-dsl-2021.4.1.jar:2021.4.1]
at org.springframework.data.neo4j.core.mapping.CypherGenerator.prepareSaveOf(CypherGenerator.java:337) ~[spring-data-neo4j-6.2.0.jar:6.2.0]
at org.springframework.data.neo4j.core.Neo4jTemplate.lambda$saveImpl$2(Neo4jTemplate.java:394) ~[spring-data-neo4j-6.2.0.jar:6.2.0]
at org.springframework.data.neo4j.core.DefaultNeo4jClient$RunnableStatement.runWith(DefaultNeo4jClient.java:208) ~[spring-data-neo4j-6.2.0.jar:6.2.0]
at org.springframework.data.neo4j.core.DefaultNeo4jClient$DefaultRecordFetchSpec.one(DefaultNeo4jClient.java:453) ~[spring-data-neo4j-6.2.0.jar:6.2.0]
at org.springframework.data.neo4j.core.Neo4jTemplate.saveImpl(Neo4jTemplate.java:398) ~[spring-data-neo4j-6.2.0.jar:6.2.0]
at org.springframework.data.neo4j.core.Neo4jTemplate.save(Neo4jTemplate.java:343) ~[spring-data-neo4j-6.2.0.jar:6.2.0]
at org.springframework.data.neo4j.repository.support.SimpleNeo4jRepository.save(SimpleNeo4jRepository.java:119) ~[spring-data-neo4j-6.2.0.jar:6.2.0]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:564) ~[na:na]
at org.springframework.data.repository.core.support.RepositoryMethodInvoker$RepositoryFragmentMethodInvoker.lambda$new$0(RepositoryMethodInvoker.java:289) ~[spring-data-commons-2.6.0.jar:2.6.0]
at org.springframework.data.repository.core.support.RepositoryMethodInvoker.doInvoke(RepositoryMethodInvoker.java:137) ~[spring-data-commons-2.6.0.jar:2.6.0]
at org.springframework.data.repository.core.support.RepositoryMethodInvoker.invoke(RepositoryMethodInvoker.java:121) ~[spring-data-commons-2.6.0.jar:2.6.0]
at org.springframework.data.repository.core.support.RepositoryComposition$RepositoryFragments.invoke(RepositoryComposition.java:529) ~[spring-data-commons-2.6.0.jar:2.6.0]
at org.springframework.data.repository.core.support.RepositoryComposition.invoke(RepositoryComposition.java:285) ~[spring-data-commons-2.6.0.jar:2.6.0]
at org.springframework.data.repository.core.support.RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.invoke(RepositoryFactorySupport.java:638) ~[spring-data-commons-2.6.0.jar:2.6.0]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.14.jar:5.3.14]
at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.doInvoke(QueryExecutorMethodInterceptor.java:163) ~[spring-data-commons-2.6.0.jar:2.6.0]
at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.invoke(QueryExecutorMethodInterceptor.java:138) ~[spring-data-commons-2.6.0.jar:2.6.0]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.14.jar:5.3.14]
at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:80) ~[spring-data-commons-2.6.0.jar:2.6.0]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.14.jar:5.3.14]
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) ~[spring-tx-5.3.14.jar:5.3.14]
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388) ~[spring-tx-5.3.14.jar:5.3.14]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) ~[spring-tx-5.3.14.jar:5.3.14]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.14.jar:5.3.14]
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:137) ~[spring-tx-5.3.14.jar:5.3.14]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.14.jar:5.3.14]
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) ~[spring-aop-5.3.14.jar:5.3.14]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.14.jar:5.3.14]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215) ~[spring-aop-5.3.14.jar:5.3.14]
at com.sun.proxy.$Proxy198.save(Unknown Source) ~[na:na]
at com.acme.FooBarDao.save(FooBarDao.java:82) ~[classes/:na]
...
The FooBarDao.java:82 line is a simple call to the node repository as the following
fooBarNodeRepository.save(fooBarNode);
the FooBarNodeRepository is a simple node repository as the following:
public interface FooBarNodeRepository extends Neo4jRepository<FooBarNode, Long> {
Optional<FooBarNode> findByGid(String gid);
void deleteByGid(String gid);
@Query("MATCH (n:FooBar) WHERE n.gid = $gid RETURN id(n)")
Long getIdByGid(String gid);
}
The same code was working with no issue under Spring Boot 2.5.2
I've done some debugging, the exception is thrown from org.neo4j.cypherdsl.core.Functions line 57 as the below
Assertions.notNull(node, Cypher.messages.getString(MessageKeys.ASSERTIONS_NODE_REQUIRED));
node is not null, and for some reason Cypher.messages are not being loaded