Configuration error during EntityManagerFactory creation

Hi,
We are trying to migrate to Hibernate 6.5.2 version and as part of this we are trying to use EntityManagers and EntityManagerFactory instead of the SessionFactory.

For creating the EntityManagerFactory, we are using this method which takes in a customer persistenceUnitInfo class and a map as arguments.

EntityManagerFactory entityManagerFactory = Bootstrap.getEntityManagerFactoryBuilder(persistenceUnitInfo, properties).build();

After resolving all the compile time issues, we are running into this runtime issue right now -

com.fasterxml.jackson.databind.Module: com.fasterxml.jackson.datatype.jsr310.JavaTimeModule not a subtype

Here is the full stack trace for your reference -

com.fasterxml.jackson.databind.Module: com.fasterxml.jackson.datatype.jsr310.JavaTimeModule not a subtype
	at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:593)
	at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1244)
	at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1273)
	at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1309)
	at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1393)
	at com.fasterxml.jackson.databind.ObjectMapper.findModules(ObjectMapper.java:1160)
	at com.fasterxml.jackson.databind.ObjectMapper.findModules(ObjectMapper.java:1144)
	at com.fasterxml.jackson.databind.ObjectMapper.findAndRegisterModules(ObjectMapper.java:1194)
	at org.hibernate.type.format.jackson.JacksonXmlFormatMapper.createXmlMapper(JacksonXmlFormatMapper.java:48)
	at org.hibernate.type.format.jackson.JacksonXmlFormatMapper.<init>(JacksonXmlFormatMapper.java:38)
	at org.hibernate.type.format.jackson.JacksonIntegration.<clinit>(JacksonIntegration.java:17)
	at org.hibernate.boot.internal.SessionFactoryOptionsBuilder.lambda$determineJsonFormatMapper$7(SessionFactoryOptionsBuilder.java:833)
	at org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.resolveStrategy(StrategySelectorImpl.java:220)
	at org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.resolveDefaultableStrategy(StrategySelectorImpl.java:180)
	at org.hibernate.boot.internal.SessionFactoryOptionsBuilder.determineJsonFormatMapper(SessionFactoryOptionsBuilder.java:829)
	at org.hibernate.boot.internal.SessionFactoryOptionsBuilder.<init>(SessionFactoryOptionsBuilder.java:313)
	at org.hibernate.boot.internal.SessionFactoryBuilderImpl.<init>(SessionFactoryBuilderImpl.java:50)
	at org.hibernate.boot.internal.DefaultSessionFactoryBuilderService.createSessionFactoryBuilder(DefaultSessionFactoryBuilderService.java:26)
	at org.hibernate.boot.internal.MetadataImpl.getSessionFactoryBuilder(MetadataImpl.java:169)
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1502)

After searching online regarding this issue I have found that we need to register the JavaTimeModule() in this manner -

ObjectMapper objectMapper = new ObjectMapper();
objectMapper.registerModule(new JavaTimeModule());

And use this dependency GitHub - FasterXML/jackson-modules-java8: Set of support modules for Java 8 datatypes (Optionals, date/time) and features (parameter names)
to resolve the issue.

I tried adding this code, just before creating the EntityManagerFactory but its not working. Looking at the stacktrace, it seems that the issue is arising from inside the hibernate jars. So I was wondering if there was a way to register this module using some API exposed by hibernate?
If not please let me know any alternatives for this.

The problem is that you are using conflicting Jackson versions for different artifacts. Maybe Jackson is even leaked onto your class path by a framework that you are using. Ensure the versions align.

Thanks a lot @beikov !
After investigating, I did find a couple of versions of jackson and I eliminated one of them and that resolved the issue.