NullPointerException when trying to parse parseUnboundedValueObject of a Map<String, Object>
See original GitHub issueClear description of my expectations versus reality
I am using Javers with SpringBoot and Mongo DB. The object I’m saving in the Mongo DB is not of a flat structure. In fact it is quite complex:
public class A { private final B b; private final C c; private final Map<String, List<E>> map; }
My repository class looks like this:
`
@JaversSpringDataAuditable
public interface ARepository extends MongoRepository<A, String>{
@Query(value = "{'b.id' : ?0 }")
public Optional<A> findById(String id);
}
` I have simple service where I’d like to retrieve some info about object: who created/when etc
` @Service @RequiredArgsConstructor public class AService { private final Javers javers;
public String getInitSnapshot(String id) {
QueryBuilder query = QueryBuilder.byClass(A.class);
List<CdoSnapshot> snapshots = javers.findSnapshots(query.build());
return javers.getJsonConverter().toJson(snapshots);
}
} `
And I have a tests to try it out:
` @ActiveProfiles(“test”) @SpringBootTest @Slf4j class AServiceTest { @Autowired private ARepository repository;
@Autowired
private AService service;
@Test
void testJavers() {
repository.save(buildEntity());
String info = service.getInitSnapshot("id");
log.info(info);
assertNotNull(info);
}
} `
Well, this doesn’t work. When Javers try to parse UnboundedValueObjectId of a Map<String, List<E>> .
Steps To Reproduce I have a **runnable test case ** which isolates the bug and allows Javers Core Team to easily reproduce it. I have pushed this test case to my fork of this repository:
Please feel free to fork out https://github.com/xytrams/javers-error
Javers’ Version 6.1.1
Additional context … Would be great if it could be fixed/dealt with.
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (11 by maintainers)

Top Related StackOverflow Question
https://github.com/javers/javers/pull/1104 I tried to do my best to demonstrate the problem
@bartoszwalacik can you give links with examples java test spring jpa + javers