My project blockchain2graph is using spring-boot-starter-data-neo4j and is running well with Spring Boot 2.0.0.M5.

If I change the pom.xml to change the spring boot release to 2.0.0.RC1, at the first call to a save method I have this exception :

15:02:49 - [02-20 15:02] An error occurred while processing block : Can not set java.lang.Long field com.oakinvest.b2g.domain.bitcoin.BitcoinBlock.id to com.oakinvest.b2g.domain.bitcoin.BitcoinBlock
java.lang.IllegalArgumentException: Can not set java.lang.Long field com.oakinvest.b2g.domain.bitcoin.BitcoinBlock.id to com.oakinvest.b2g.domain.bitcoin.BitcoinBlock
    at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167)
    at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171)
    at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:58)
    at sun.reflect.UnsafeObjectFieldAccessorImpl.get(UnsafeObjectFieldAccessorImpl.java:36)
    at java.lang.reflect.Field.get(Field.java:393)
    at org.neo4j.ogm.metadata.FieldInfo.read(FieldInfo.java:378)
    at org.neo4j.ogm.metadata.FieldInfo.readProperty(FieldInfo.java:437)
    at org.neo4j.ogm.utils.EntityUtils.identity(EntityUtils.java:50)
    at org.neo4j.ogm.context.MappingContext.nativeId(MappingContext.java:490)
    at org.neo4j.ogm.context.EntityGraphMapper.getNodeBuilder(EntityGraphMapper.java:282)
    at org.neo4j.ogm.context.EntityGraphMapper.mapEntity(EntityGraphMapper.java:220)
    at org.neo4j.ogm.context.EntityGraphMapper.map(EntityGraphMapper.java:129)
    at org.neo4j.ogm.session.delegates.SaveDelegate.save(SaveDelegate.java:80)
    at org.neo4j.ogm.session.delegates.SaveDelegate.save(SaveDelegate.java:40)
    at org.neo4j.ogm.session.Neo4jSession.save(Neo4jSession.java:469)
    at sun.reflect.GeneratedMethodAccessor63.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.data.neo4j.transaction.SharedSessionCreator$SharedSessionInvocationHandler.invoke(SharedSessionCreator.java:131)
    at com.sun.proxy.$Proxy119.save(Unknown Source)
    at org.springframework.data.neo4j.repository.support.SimpleNeo4jRepository.save(SimpleNeo4jRepository.java:73)
    at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.data.repository.core.support.RepositoryComposition$RepositoryFragments.invoke(RepositoryComposition.java:377)
    at org.springframework.data.repository.core.support.RepositoryComposition.invoke(RepositoryComposition.java:200)
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.invoke(RepositoryFactorySupport.java:629)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:593)
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:578)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
    at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:59)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
    at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
    at org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:61)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
    at com.sun.proxy.$Proxy125.save(Unknown Source)
    at com.oakinvest.b2g.util.bitcoin.batch.BitcoinBatchTemplate.lambda$execute$0(BitcoinBatchTemplate.java:154)
    at java.util.Optional.ifPresent(Optional.java:159)
    at com.oakinvest.b2g.util.bitcoin.batch.BitcoinBatchTemplate.execute(BitcoinBatchTemplate.java:148)
    at com.oakinvest.b2g.util.bitcoin.batch.BitcoinBatchTemplate$$FastClassBySpringCGLIB$$3c4ea6c2.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:747)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689)
    at com.oakinvest.b2g.batch.bitcoin.BitcoinBatch$$EnhancerBySpringCGLIB$$12d65d2b.execute(<generated>)
    at sun.reflect.GeneratedMethodAccessor56.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:65)
    at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

You can reproduce the problem with the current development branch.

note that the unit test (mvn test) are working with both releases

Comment From: wilkinsona

This is a duplicate of https://github.com/neo4j/neo4j-ogm/issues/444. You can avoid the problem either by removing DevTools or by upgrading Neo4j OGM to 3.1. A comment on that issue states that OGM 3.1 is compatible with the latest Spring Data Neo4j release so we should consider upgrading.

Comment From: straumat

I'm really sorry. Seems I did not search well. Upgrading to 3.1 creates a bug with parallelStream. I reported it to neo4j : https://github.com/neo4j/neo4j-ogm/issues/469

Removing devtools make it work. Thanks

Comment From: roc41d

This is a duplicate of neo4j/neo4j-ogm#444. You can avoid the problem either by removing DevTools or by upgrading Neo4j OGM to 3.1. A comment on that issue states that OGM 3.1 is compatible with the latest Spring Data Neo4j release so we should consider upgrading.

I removed DevTools and everything works fine now Thanks @wilkinsona