# Are you aware of uncomptability between hibernate-enhance-maven-plugin and elasticsearch?

**URL:** <https://discuss.elastic.co/t/are-you-aware-of-uncomptability-between-hibernate-enhance-maven-plugin-and-elasticsearch/276574>\
**Category:** Elasticsearch\
**Created:** [June 21, 2021, 7:00pm UTC](https://discuss.elastic.co/t/are-you-aware-of-uncomptability-between-hibernate-enhance-maven-plugin-and-elasticsearch/276574 "2021-06-21T19:00:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![guigui0824](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guigui0824/32/78407_2.png) [@guigui0824](https://discuss.elastic.co/u/guigui0824)\
**Post date:** [June 21, 2021, 7:00pm UTC](https://discuss.elastic.co/t/are-you-aware-of-uncomptability-between-hibernate-enhance-maven-plugin-and-elasticsearch/276574/1 "2021-06-21T19:00:28Z")

</div>

Hi, i work on a spring-boot project (version 2.3.8.RELEASE) with Hibernate (version 5.4.27.Final) and elasticsearch (spring-boot-starter-data-elasticsearch).

I want to enable bytecode enhancement lazy loading to increase performance of my @OneToOne relationships.

I added the hibernate-enhance-maven-plugin to my configuration following this [Hibernate LazyToOne annotation article](https://vladmihalcea.com/hibernate-lazytoone-annotation/).

But when i start my application i got the following error stacktrace :

```auto
Caused by: java.lang.IllegalStateException: Expected to be able to resolve a type but got null! This usually stems from types implementing raw Map or Collection interfaces!
	at org.springframework.data.util.TypeInformation.getRequiredActualType(TypeInformation.java:184)
	at org.springframework.data.mapping.model.AbstractPersistentProperty.getActualType(AbstractPersistentProperty.java:286)
	at org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchPersistentProperty.initDateConverter(SimpleElasticsearchPersistentProperty.java:122)
	at org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchPersistentProperty.<init>(SimpleElasticsearchPersistentProperty.java:91)
	at org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext.createPersistentProperty(SimpleElasticsearchMappingContext.java:53)
	at org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext.createPersistentProperty(SimpleElasticsearchMappingContext.java:34)
	at org.springframework.data.mapping.context.AbstractMappingContext$PersistentPropertyCreator.createAndRegisterProperty(AbstractMappingContext.java:542)
	at org.springframework.data.mapping.context.AbstractMappingContext$PersistentPropertyCreator.doWith(AbstractMappingContext.java:520)
	at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils.java:705)
	at org.springframework.data.mapping.context.AbstractMappingContext.addPersistentEntity(AbstractMappingContext.java:389)
	at java.base/java.util.Collections$SingletonSet.forEach(Collections.java:4797)
	at org.springframework.data.mapping.context.AbstractMappingContext$PersistentPropertyCreator.createAndRegisterProperty(AbstractMappingContext.java:562)
	at org.springframework.data.mapping.context.AbstractMappingContext$PersistentPropertyCreator.doWith(AbstractMappingContext.java:520)
  ...

```

If I remove all ElasticSearchRepositories of my application, it works normally and @LazyToOne fields are well lazy loaded.

Did you ever see anything like this ?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [June 22, 2021, 7:53am UTC](https://discuss.elastic.co/t/are-you-aware-of-uncomptability-between-hibernate-enhance-maven-plugin-and-elasticsearch/276574/2 "2021-06-22T07:53:34Z")

</div>

You might have more luck with the forums of spring data or enhancer, as this looks a bit out of the scope of being an Elasticsearch but rather a java enhancement issue.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 20, 2021, 7:54am UTC](https://discuss.elastic.co/t/are-you-aware-of-uncomptability-between-hibernate-enhance-maven-plugin-and-elasticsearch/276574/3 "2021-07-20T07:54:07Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
