No accessor to set property @org.springframework.data.annotation.Id() [DATAMONGO-2125] #2993
Labels
in: core
Issues in core support
in: repository
Repositories abstraction
status: declined
A suggestion or change that we don't feel we should currently apply
type: bug
A general bug
Ebram Sherif opened DATAMONGO-2125 and commented
So I am using spring boot parent starter 2.1.0 and I have some model like this written in kotlinn
then I try to insert it using
it does actually insert the object into the DB but I get a runtime error
// Caused by: java.lang.UnsupportedOperationException: No accessor to set property @org.springframework.data.annotation.Id()private final java.lang.String com.person.id!Caused by: java.lang.UnsupportedOperationException: No accessor to set property @org.springframework.data.annotation.Id()private final java.lang.String com.person.id! at com.person_Accessor_sjnbwf.setProperty(Unknown Source) at org.springframework.data.mapping.model.ConvertingPropertyAccessor.setProperty(ConvertingPropertyAccessor.java:61) at org.springframework.data.mongodb.core.EntityOperations$AdaptibleMappedEntity.populateIdIfNecessary(EntityOperations.java:605) at org.springframework.data.mongodb.core.MongoTemplate.populateIdIfNecessary(MongoTemplate.java:2569) at org.springframework.data.mongodb.core.MongoTemplate.doInsert(MongoTemplate.java:1219) at org.springframework.data.mongodb.core.MongoTemplate.insert(MongoTemplate.java:1150) at org.springframework.data.mongodb.repository.support.SimpleMongoRepository.insert(SimpleMongoRepository.java:244) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 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:359) at org.springframework.data.repository.core.support.RepositoryComposition.invoke(RepositoryComposition.java:200) at org.springframework.data.repository.core.support.RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.invoke(RepositoryFactorySupport.java:644) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:608) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.lambda$invoke$3(RepositoryFactorySupport.java:595) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:595) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:59) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.data.repository.core.support.MethodInvocationValidator.invoke(MethodInvocationValidator.java:99) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
I was using 2.0.6 for spring boot parent starter and it was returning the object normally but just by updating the POM to 2.1.0 now im facing this
Affects: 2.1.2 (Lovelace SR2)
Issue Links:
("is duplicated by")
The text was updated successfully, but these errors were encountered: