Somehow the @EnableAutoconfiguration
of JPA were passing two paths to get scanned, because the database configuration was in sub folder which makes sense.
com.testOrg
com.testOrg.configuration
org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager
on line 520 is adding converters multiple times based on the number of scanned configuration paths found,
I think for other classes we do not have check for duplicacy but for Converters we do have check if it gets registered multiple times than throw Exception see. com.testOrg.configuration.MetadataBuilderImpl.java
line 907
To solve this, I moved my DatabaseConfiguration class out of "com.testOrg.configuration"
folder to main and hence only one class to register.
I hope this might be helpful for someone.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…