Hibernate Search + Elastic Search - Create Index method not found error

Hi All,
Iam working on HIBERNATE search + Elastic search Project , (stable version )
but on startup my spring boot app is giving the following error
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘entityManagerFactory’ defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is java.util.ServiceConfigurationError: org.hibernate.search.elasticsearch.schema.impl.ElasticsearchSchemaAccessor: org.hibernate.search.elasticsearch.schema.impl.ElasticsearchSchemaAccessor Unable to get public no-arg constructor
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1108) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:868) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) ~[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) ~[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
at com.acra.crashanalytics.Application.main(Application.java:10) ~[classes/:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) ~[spring-boot-devtools-2.2.5.RELEASE.jar:2.2.5.RELEASE]
Caused by: java.util.ServiceConfigurationError: org.hibernate.search.elasticsearch.schema.impl.ElasticsearchSchemaAccessor: org.hibernate.search.elasticsearch.schema.impl.ElasticsearchSchemaAccessor Unable to get public no-arg constructor
at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:581) ~[na:na]
at java.base/java.util.ServiceLoader.getConstructor(ServiceLoader.java:672) ~[na:na]
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1232) ~[na:na]
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1264) ~[na:na]
at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1299) ~[na:na]
at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1384) ~[na:na]
at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.loadJavaServices(ClassLoaderServiceImpl.java:459) ~[hibernate-core-5.2.8.Final.jar:5.2.8.Final]
at org.hibernate.search.cfg.impl.DelegatingClassLoaderService.loadJavaServices(DelegatingClassLoaderService.java:74) ~[hibernate-search-orm-5.7.0.Final.jar:5.7.0.Final]
at org.hibernate.search.engine.service.impl.StandardServiceManager.createAndCacheWrapper(StandardServiceManager.java:183) ~[hibernate-search-engine-5.7.0.Final.jar:5.7.0.Final]
at org.hibernate.search.engine.service.impl.StandardServiceManager.requestService(StandardServiceManager.java:87) ~[hibernate-search-engine-5.7.0.Final.jar:5.7.0.Final]
at org.hibernate.search.elasticsearch.schema.impl.DefaultElasticsearchSchemaCreator.start(DefaultElasticsearchSchemaCreator.java:36) ~[hibernate-search-elasticsearch-5.7.0.Final.jar:5.7.0.Final]
at org.hibernate.search.engine.service.impl.StandardServiceManager$ServiceWrapper.startService(StandardServiceManager.java:303) ~[hibernate-search-engine-5.7.0.Final.jar:5.7.0.Final]
at org.hibernate.search.engine.service.impl.StandardServiceManager$ServiceWrapper.startVirtual(StandardServiceManager.java:268) ~[hibernate-search-engine-5.7.0.Final.jar:5.7.0.Final]
at org.hibernate.search.engine.service.impl.StandardServiceManager.createAndCacheWrapper(StandardServiceManager.java:205) ~[hibernate-search-engine-5.7.0.Final.jar:5.7.0.Final]
at org.hibernate.search.engine.service.impl.StandardServiceManager.requestService(StandardServiceManager.java:87) ~[hibernate-search-engine-5.7.0.Final.jar:5.7.0.Final]
at org.hibernate.search.elasticsearch.impl.ElasticsearchIndexManager.initialize(ElasticsearchIndexManager.java:138) ~[hibernate-search-elasticsearch-5.7.0.Final.jar:5.7.0.Final]
at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManager(IndexManagerHolder.java:287) ~[hibernate-search-engine-5.7.0.Final.jar:5.7.0.Final]
at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManager(IndexManagerHolder.java:544) ~[hibernate-search-engine-5.7.0.Final.jar:5.7.0.Final]
at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManagers(IndexManagerHolder.java:513) ~[hibernate-search-engine-5.7.0.Final.jar:5.7.0.Final]
at org.hibernate.search.indexes.impl.IndexManagerHolder.buildEntityIndexBinding(IndexManagerHolder.java:100) ~[hibernate-search-engine-5.7.0.Final.jar:5.7.0.Final]
at org.hibernate.search.spi.SearchIntegratorBuilder.initDocumentBuilders(SearchIntegratorBuilder.java:369) ~[hibernate-search-engine-5.7.0.Final.jar:5.7.0.Final]
at org.hibernate.search.spi.SearchIntegratorBuilder.buildNewSearchFactory(SearchIntegratorBuilder.java:202) ~[hibernate-search-engine-5.7.0.Final.jar:5.7.0.Final]
at org.hibernate.search.spi.SearchIntegratorBuilder.buildSearchIntegrator(SearchIntegratorBuilder.java:120) ~[hibernate-search-engine-5.7.0.Final.jar:5.7.0.Final]
at org.hibernate.search.hcore.impl.HibernateSearchSessionFactoryObserver.sessionFactoryCreated(HibernateSearchSessionFactoryObserver.java:75) ~[hibernate-search-orm-5.7.0.Final.jar:5.7.0.Final]
at org.hibernate.internal.SessionFactoryObserverChain.sessionFactoryCreated(SessionFactoryObserverChain.java:35) ~[hibernate-core-5.2.8.Final.jar:5.2.8.Final]
at org.hibernate.internal.SessionFactoryImpl.(SessionFactoryImpl.java:366) ~[hibernate-core-5.2.8.Final.jar:5.2.8.Final]
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:445) ~[hibernate-core-5.2.8.Final.jar:5.2.8.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:889) ~[hibernate-core-5.2.8.Final.jar:5.2.8.Final]
at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:58) ~[spring-orm-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) ~[spring-orm-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:391) ~[spring-orm-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:378) ~[spring-orm-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341) ~[spring-orm-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1855) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1792) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
… 21 common frames omitted
Caused by: java.lang.NoClassDefFoundError: io/searchbox/action/Action
at java.base/java.lang.Class.getDeclaredConstructors0(Native Method) ~[na:na]
at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3137) ~[na:na]
at java.base/java.lang.Class.getConstructor0(Class.java:3342) ~[na:na]
at java.base/java.lang.Class.getConstructor(Class.java:2151) ~[na:na]
at java.base/java.util.ServiceLoader$1.run(ServiceLoader.java:659) ~[na:na]
at java.base/java.util.ServiceLoader$1.run(ServiceLoader.java:656) ~[na:na]
at java.base/java.security.AccessController.doPrivileged(Native Method) ~[na:na]
at java.base/java.util.ServiceLoader.getConstructor(ServiceLoader.java:667) ~[na:na]
… 54 common frames omitted
Caused by: java.lang.ClassNotFoundException: io.searchbox.action.Action
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ~[na:na]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[na:na]
… 62 common frames omitted

Hello,

It says right here:

The class io.searchbox.action.Action was not found. It is missing from your classpath.

Check your dependencies. If you’re using Maven or a similar build tool you probably excluded io.searchbox:jest or io.searchbox:jest-common from your dependencies, or forced it to an incompatible version. If you’re building your classpath manually, well, you forgot to include this JAR.

1 Like