Skip to content

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

Closed
@ALP011216

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

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