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.findChanges() throws java.lang.IllegalArgumentException: Version is not a positive number. #1121

Closed
ALP011216 opened this issue Jul 9, 2021 · 4 comments

Comments

@ALP011216
Copy link

I want to integrate Javers on a database which is already in use.

If I mark an entity as deleted with javers.commitShallowDelete (for example Customer) for which no INITIAL snapshot is yet stored,

javers.findChanges(QueryBuilder.byClass(Customer.class).build());

throws the following exception:

java.lang.IllegalArgumentException: Version is not a positive number.
	at org.javers.common.validation.Validate.argumentCheck(Validate.java:43)
	at org.javers.repository.api.SnapshotIdentifier.<init>(SnapshotIdentifier.java:16)
	at org.javers.repository.api.SnapshotIdentifier.previous(SnapshotIdentifier.java:35)
	at org.javers.core.snapshot.SnapshotDiffer.calculateDiffs(SnapshotDiffer.java:43)
	at org.javers.repository.api.JaversExtendedRepository.getChangesIntroducedBySnapshots(JaversExtendedRepository.java:181)
	at org.javers.repository.api.JaversExtendedRepository.getChangeHistory(JaversExtendedRepository.java:49)
	at org.javers.repository.jql.ChangesQueryRunner.queryForChanges(ChangesQueryRunner.java:34)
	at org.javers.repository.jql.QueryRunner.queryForChanges(QueryRunner.java:46)
	at org.javers.core.JaversCore.findChanges(JaversCore.java:206)

Javers' Version
6.2.3

@bartoszwalacik
Copy link
Member

@bartoszwalacik
Copy link
Member

thanks for reporting but this issue won't be analyzed if you don't provide a failing test case - see https://github.com/javers/javers/blob/master/CONTRIBUTING.md#guidelines-for-bug-reporting

@narsereg
Copy link
Contributor

@bartoszwalacik Hi. I experience the same problem. So this test is failing now.

narsereg@68d6718

@bartoszwalacik
Copy link
Member

fixed in 6.5.0

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

No branches or pull requests

3 participants