MBP icon indicating copy to clipboard operation
MBP copied to clipboard

Investigate strange logs on startup

Open schneijan opened this issue 4 years ago • 2 comments

2021-02-02 16:00:38.979  WARN   --- [           main] .m.c.i.MongoPersistentEntityIndexCreator : Automatic index creation will be disabled by default as of Spring Data MongoDB 3.x.
	Please use 'MongoMappingContext#setAutoIndexCreation(boolean)' or override 'MongoConfigurationSupport#autoIndexCreation()' to be explicit.
	However, we recommend setting up indices manually in an application ready block. You may use index derivation there as well.
	> -----------------------------------------------------------------------------------------
	> @EventListener(ApplicationReadyEvent.class)
	> public void initIndicesAfterStartup() {
	>
	>     IndexOperations indexOps = mongoTemplate.indexOps(DomainType.class);
	>
	>     IndexResolver resolver = new MongoPersistentEntityIndexResolver(mongoMappingContext);
	>     resolver.resolveIndexFor(DomainType.class).forEach(indexOps::ensureIndex);
	> }
	> -----------------------------------------------------------------------------------------

schneijan avatar Feb 02 '21 16:02 schneijan

There is not much we can do to get rid of this issue. A solution would probably to upgrade Mongo dependencies again: https://jira.spring.io/browse/DATAMONGO-2435

schneijan avatar Feb 10 '21 01:02 schneijan

@schneijan ok, I would say we do the update after the first release because we started the testing phase already. Probably we will need a new test phase after the upgrade of mongoDB.

ana-silva avatar Feb 19 '21 15:02 ana-silva