# Missing Bean when using Hibernate Search as Jar?

**URL:** <https://discourse.hibernate.org/t/missing-bean-when-using-hibernate-search-as-jar/6678>\
**Category:** Hibernate Search\
**Created:** [September 21, 2022, 3:38pm UTC](https://discourse.hibernate.org/t/missing-bean-when-using-hibernate-search-as-jar/6678 "2022-09-21T15:38:40Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![yrodiere](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/yrodiere/32/1760_2.png) [@yrodiere](https://discourse.hibernate.org/u/yrodiere)\
**Post date:** [September 21, 2022, 4:11pm UTC](https://discourse.hibernate.org/t/missing-bean-when-using-hibernate-search-as-jar/6678/2 "2022-09-21T16:11:44Z")

</div>

I confirm something is probably wrong with your setup.

The core of the problem is this:

```auto
Caused by: org.hibernate.search.engine.environment.bean.spi.BeanNotFoundException: HSEARCH000578: No
 beans defined for type 'org.hibernate.search.mapper.orm.coordination.common.spi.CoordinationStrateg
y' and name 'none' in Hibernate Search's internal registry.

```

Hibernate Search has an internal registry of (named) beans that should always be available, and in your case some beans that should be there seem to be missing.

The way this particular bean get registered is through the class `org.hibernate.search.mapper.orm.impl.HibernateOrmBeanConfigurer`, which should get loaded automatically through the service-loader thanks to the file `META-INF/services/org.hibernate.search.engine.environment.bean.spi.BeanConfigurer` which you can find in the hibernate-search-mapper-orm JAR.

If I had to guess, I would say that when you say “I export it to a jar file”, you are somehow shading all libraries into your JAR (putting all classes and resources into the same JAR), and for some reason the thing that does the shading does not correctly concatenate files in `META-INF/services`, but instead just takes one at random. Am I right?

If I’m wrong, I would suggest running the application with that “generate JAR” in debug mode and putting a breakpoint in `org.hibernate.search.engine.environment.bean.impl.BeanResolverImpl#create` to see what’s going on (which `BeanConfigurer` instances are found, in particular).

---

_[View the full topic](https://discourse.hibernate.org/t/missing-bean-when-using-hibernate-search-as-jar/6678)._
