{"action":"created","issue":{"url":"https://api.github.com/repos/javers/javers/issues/511","repository_url":"https://api.github.com/repos/javers/javers","labels_url":"https://api.github.com/repos/javers/javers/issues/511/labels{/name}","comments_url":"https://api.github.com/repos/javers/javers/issues/511/comments","events_url":"https://api.github.com/repos/javers/javers/issues/511/events","html_url":"https://github.com/javers/javers/issues/511","id":212032927,"node_id":"MDU6SXNzdWUyMTIwMzI5Mjc=","number":511,"title":"Handling schema change (property type change) in javers","user":{"login":"anshuljaindc","id":6329176,"node_id":"MDQ6VXNlcjYzMjkxNzY=","avatar_url":"https://avatars2.githubusercontent.com/u/6329176?v=4","gravatar_id":"","url":"https://api.github.com/users/anshuljaindc","html_url":"https://github.com/anshuljaindc","followers_url":"https://api.github.com/users/anshuljaindc/followers","following_url":"https://api.github.com/users/anshuljaindc/following{/other_user}","gists_url":"https://api.github.com/users/anshuljaindc/gists{/gist_id}","starred_url":"https://api.github.com/users/anshuljaindc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anshuljaindc/subscriptions","organizations_url":"https://api.github.com/users/anshuljaindc/orgs","repos_url":"https://api.github.com/users/anshuljaindc/repos","events_url":"https://api.github.com/users/anshuljaindc/events{/privacy}","received_events_url":"https://api.github.com/users/anshuljaindc/received_events","type":"User","site_admin":false},"labels":[{"id":69930536,"node_id":"MDU6TGFiZWw2OTkzMDUzNg==","url":"https://api.github.com/repos/javers/javers/labels/enhancement","name":"enhancement","color":"009800","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-03-06T06:15:39Z","updated_at":"2018-07-13T07:47:33Z","closed_at":null,"author_association":"NONE","body":"I have my java class which consists of Map<String, String>. I am using javers sql repository for storing my auditing data. I recently changed schema of my property to Map<String, List<String>>. Now I am getting following exception on commits of the domain. I think Javers should internally handle any schema changes. \r\n\r\nCurrent javers version - 2.8.2\r\nStackoverflow link for question - http://stackoverflow.com/questions/42610035/handling-schema-change-in-javers-auditing\r\ncom.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING\r\nat com.google.gson.Gson.fromJson(Gson.java:826) ~[gson-2.4.jar:?]\r\nat com.google.gson.Gson.fromJson(Gson.java:879) ~[gson-2.4.jar:?]\r\nat com.google.gson.Gson$1.deserialize(Gson.java:129) ~[gson-2.4.jar:?]\r\nat org.javers.core.json.typeadapter.commit.CdoSnapshotStateDeserializer.decodePropertyValue(CdoSnapshotStateDeserializer.java:48) ~[javers-core-2.8.2.jar:?]\r\nat ..."},"comment":{"url":"https://api.github.com/repos/javers/javers/issues/comments/404754780","html_url":"https://github.com/javers/javers/issues/511#issuecomment-404754780","issue_url":"https://api.github.com/repos/javers/javers/issues/511","id":404754780,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDc1NDc4MA==","user":{"login":"f466162","id":25205812,"node_id":"MDQ6VXNlcjI1MjA1ODEy","avatar_url":"https://avatars2.githubusercontent.com/u/25205812?v=4","gravatar_id":"","url":"https://api.github.com/users/f466162","html_url":"https://github.com/f466162","followers_url":"https://api.github.com/users/f466162/followers","following_url":"https://api.github.com/users/f466162/following{/other_user}","gists_url":"https://api.github.com/users/f466162/gists{/gist_id}","starred_url":"https://api.github.com/users/f466162/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/f466162/subscriptions","organizations_url":"https://api.github.com/users/f466162/orgs","repos_url":"https://api.github.com/users/f466162/repos","events_url":"https://api.github.com/users/f466162/events{/privacy}","received_events_url":"https://api.github.com/users/f466162/received_events","type":"User","site_admin":false},"created_at":"2018-07-13T07:47:33Z","updated_at":"2018-07-13T07:47:33Z","author_association":"NONE","body":"Unfortunately I experience a similar issue with JaVers 3.10.2 after a schema change (was: reference to another Entity, now: String). Renaming attributes in Entities is not a solution; yet I got no clue what to do as migrating data would mean to lose the audit trail...\r\n\r\n```\r\n2018-07-12 23:40:45.834 ERROR 4914 --- [pool-2-thread-1] o.s.s.s.TaskUtils$LoggingErrorHandler    : Unexpected error occurred in scheduled task. [userId=ka0064, X-Tracking-Id=49c606a5-e60d-4f81-b088-1c9fec880c10, trackingId=49c606a5-e60d-4f81-b088-1c9fec880c10]\r\n\r\ncom.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected STRING but was BEGIN_OBJECT at path $\r\n\tat com.google.gson.Gson.fromJson(Gson.java:939)\r\n\tat com.google.gson.Gson.fromJson(Gson.java:994)\r\n\tat com.google.gson.internal.bind.TreeTypeAdapter$GsonContextImpl.deserialize(TreeTypeAdapter.java:162)\r\n\tat org.javers.core.json.typeadapter.commit.CdoSnapshotStateDeserializer.decodePropertyValue(CdoSnapshotStateDeserializer.java:48)\r\n\tat org.javers.core.json.typeadapter.commit.CdoSnapshotStateDeserializer.deserialize(CdoSnapshotStateDeserializer.java:39)\r\n\tat org.javers.core.json.typeadapter.commit.CdoSnapshotTypeAdapter.deserializeSnapshotState(CdoSnapshotTypeAdapter.java:71)\r\n\tat org.javers.core.json.typeadapter.commit.CdoSnapshotTypeAdapter.fromJson(CdoSnapshotTypeAdapter.java:57)\r\n\tat org.javers.core.json.typeadapter.commit.CdoSnapshotTypeAdapter.fromJson(CdoSnapshotTypeAdapter.java:21)\r\n\tat org.javers.core.json.JsonConverterBuilder.lambda$registerJsonTypeAdapterForType$4(JsonConverterBuilder.java:166)\r\n\tat com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:69)\r\n\tat com.google.gson.Gson.fromJson(Gson.java:927)\r\n\tat com.google.gson.Gson.fromJson(Gson.java:994)\r\n\tat com.google.gson.Gson.fromJson(Gson.java:967)\r\n\tat org.javers.core.json.JsonConverter.fromJson(JsonConverter.java:74)\r\n\tat org.javers.core.json.JsonConverter.fromSerializedSnapshot(JsonConverter.java:82)\r\n\tat org.javers.repository.sql.finders.CdoSnapshotFinder.lambda$fetchCdoSnapshots$3(CdoSnapshotFinder.java:94)\r\n\tat java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)\r\n\tat java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)\r\n\tat java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)\r\n\tat java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)\r\n\tat java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)\r\n\tat java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)\r\n\tat java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)\r\n\tat org.javers.common.collections.Lists.transform(Lists.java:68)\r\n\tat org.javers.repository.sql.finders.CdoSnapshotFinder.fetchCdoSnapshots(CdoSnapshotFinder.java:93)\r\n\tat org.javers.repository.sql.finders.CdoSnapshotFinder.lambda$getLatest$0(CdoSnapshotFinder.java:54)\r\n\tat java.util.Optional.map(Optional.java:215)\r\n\tat org.javers.repository.sql.finders.CdoSnapshotFinder.getLatest(CdoSnapshotFinder.java:52)\r\n\tat org.javers.repository.sql.JaversSqlRepository.getLatest(JaversSqlRepository.java:52)\r\n\tat org.javers.repository.api.JaversExtendedRepository.getLatest(JaversExtendedRepository.java:91)\r\n\tat java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)\r\n\tat java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1553)\r\n\tat java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)\r\n\tat java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)\r\n\tat java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)\r\n\tat java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)\r\n\tat java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)\r\n\tat org.javers.core.snapshot.SnapshotGraphFactory.createLatest(SnapshotGraphFactory.java:29)\r\n\tat org.javers.core.commit.CommitFactory.create(CommitFactory.java:72)\r\n\tat org.javers.core.JaversCore.commit(JaversCore.java:81)\r\n\tat org.javers.spring.jpa.JaversTransactionalDecorator.commit(JaversTransactionalDecorator.java:67)\r\n\tat org.javers.spring.jpa.JaversTransactionalDecorator$$FastClassBySpringCGLIB$$acb40bd0.invoke(<generated>)\r\n\tat org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)\r\n\tat org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746)\r\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)\r\n\tat org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294)\r\n\tat org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)\r\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)\r\n\tat org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)\r\n\tat org.javers.spring.jpa.JaversTransactionalDecorator$$EnhancerBySpringCGLIB$$6938c640.commit(<generated>)\r\n\tat org.javers.spring.auditable.aspect.springdata.OnSaveAuditChangeHandler.handle(OnSaveAuditChangeHandler.java:18)\r\n\tat org.javers.spring.auditable.aspect.springdata.AbstractSpringAuditableRepositoryAspect.applyVersionChanges(AbstractSpringAuditableRepositoryAspect.java:57)\r\n\tat org.javers.spring.auditable.aspect.springdata.AbstractSpringAuditableRepositoryAspect.lambda$onVersionEvent$0(AbstractSpringAuditableRepositoryAspect.java:38)\r\n\tat java.util.Optional.ifPresent(Optional.java:159)\r\n\tat org.javers.spring.auditable.aspect.springdata.AbstractSpringAuditableRepositoryAspect.onVersionEvent(AbstractSpringAuditableRepositoryAspect.java:35)\r\n\tat org.javers.spring.auditable.aspect.springdata.AbstractSpringAuditableRepositoryAspect.onSave(AbstractSpringAuditableRepositoryAspect.java:25)\r\n\tat org.javers.spring.auditable.aspect.springdatajpa.JaversSpringDataJpaAuditableRepositoryAspect.onSaveExecuted(JaversSpringDataJpaAuditableRepositoryAspect.java:34)\r\n\tat sun.reflect.GeneratedMethodAccessor106.invoke(Unknown Source)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:498)\r\n\tat org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644)\r\n\tat org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:626)\r\n\tat org.springframework.aop.aspectj.AspectJAfterReturningAdvice.afterReturning(AspectJAfterReturningAdvice.java:66)\r\n\tat org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:53)\r\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:174)\r\n\tat org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)\r\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)\r\n\tat org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)\r\n\tat com.sun.proxy.$Proxy161.save(Unknown Source)\r\n```"}}
{"actor":{"display_login":"f466162"}}