Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JaVers should not throw exceptions when a Property is added or removed to a Class which has already persisted snapshots #232

clxthomas opened this issue Oct 20, 2015 · 4 comments


Copy link

@clxthomas clxthomas commented Oct 20, 2015


comitting a class (Farm), from which a property (ownersWife) is removed (in the comitted version the property is stored), the following exception is thrown:

Exception in thread "main" JaversException: PROPERTY_NOT_FOUND JaVers runtime error - property 'ownersWife' not found in class 'de.complex.sandbox.javers.Farm'
at org.javers.core.metamodel.clazz.ManagedClass.getProperty(
at org.javers.core.metamodel.object.CdoSnapshotBuilder.withChangedProperties(
at org.javers.repository.sql.finders.CdoSnapshotObjectMapper.createObject(
at org.javers.repository.sql.finders.CdoSnapshotObjectMapper.createObject(
at org.polyjdbc.core.query.TransactionalQueryRunner.queryCollection(
at org.polyjdbc.core.query.TransactionalQueryRunner.queryList(
at org.javers.repository.sql.finders.CdoSnapshotFinder.queryForCdoSnapshots(
at org.javers.repository.sql.finders.CdoSnapshotFinder.getLatest(
at org.javers.repository.sql.JaversSqlRepository.getLatest(
at org.javers.repository.api.JaversExtendedRepository.getLatest(
at org.javers.core.snapshot.GraphShadowFactory.createLatestShadow(
at org.javers.core.snapshot.GraphSnapshotFacade.createLatestShadow(
at org.javers.core.commit.CommitFactory.create(
at org.javers.core.JaversCore.commit(
at de.complex.sandbox.javers.Application.main(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at com.intellij.rt.execution.application.AppMain.main(

Maybe this relates to #178? Are there some workarounds or planned fixes for that?

Copy link

@KodeMunkie KodeMunkie commented Nov 25, 2015

I'd like to know about this too. Other frameworks like Envers for Hibernate, as far as I know, do not do this (but don't take my word for it :) ).
It would be nice that this (and any similar cases) copied the Envers behaviour and/or attempted a best effort saving what data it has, but warn/error in the logs and/or even in the (best effort) audit record. Unless you're a bank or similar and need to prevent saves without auditing it would be nice if this option was configurable - i.e. on/off. Throwing an unchecked exception (possibly on production) may be un-necessary for systems where auditing is a secondary concern (i.e. nice to have/see who made changes but don't really require them).

Copy link

@bartoszwalacik bartoszwalacik commented Nov 25, 2015

duplicate to #178

Copy link

@bartoszwalacik bartoszwalacik commented Nov 25, 2015

Guys, I konw that this exception could be a bloker.
I'm working on a new feature which solves this issue. In the next JaVers version (1.4.0)
you would be able to refactor your property names (and also class names) freely.

Copy link

@bartoszwalacik bartoszwalacik commented Dec 10, 2015

good news, JaVers 1.4.0-RC1 is ready, it gives you @TypeName annotation
and support for domain classes refactoring.
Check it out and give me feedback, does it solve your issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.