Skip to content

javers.findChanges() throws java.lang.IllegalArgumentException: Version is not a positive number. #1121

Closed

Description

@ALP011216

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

Activity

  1. bartoszwalacik commented on Aug 3, 2021

    @bartoszwalacik
    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

  2. narsereg commented on Sep 15, 2021

    @narsereg
    Contributor

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

    narsereg@68d6718

  3. bartoszwalacik commented on Nov 13, 2021

    @bartoszwalacik
    Member

    fixed in 6.5.0

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions