Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hibernate Search error on startup even if it is disabled #23873

Closed
fastluca opened this issue Feb 22, 2022 · 3 comments · Fixed by #23903
Closed

Hibernate Search error on startup even if it is disabled #23873

fastluca opened this issue Feb 22, 2022 · 3 comments · Fixed by #23903
Labels
area/hibernate-search Hibernate Search kind/bug Something isn't working
Milestone

Comments

@fastluca
Copy link

Describe the bug

I've an application which imports another dependency containing some entities indexed by hibernate-search using the quarkus extension.
I'm trying to disable all stuff related to hibernate search because I will not use them in the context of this application using the following properties:

quarkus.hibernate-search-orm.enabled=false quarkus.hibernate-search-orm.elasticsearch.version=7.0 quarkus.hibernate-search-orm.elasticsearch.version-check.enabled=false

However, on the application startup, I have the following stacktrace:

2022-02-22 13:27:11,555 INFO  [io.qua.dat.dep.dev.DevServicesDatasourceProcessor] (build-30) Dev Services for the default datasource (postgresql) started.
__  ____  __  _____   ___  __ ____  ______ 
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ 
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/   
2022-02-22 13:27:11,915 INFO  [org.hib.spa.int.SpatialService] (Quarkus Main Thread) HHH80000001: hibernate-spatial integration enabled : true
2022-02-22 13:27:11,920 DEBUG [org.hib.sea.map.orm.boo.imp.HibernateSearchPreIntegrationService] (Quarkus Main Thread) HSEARCH000034: Hibernate Search version 6.1.0.Final
2022-02-22 13:27:12,539 WARN  [io.qua.run.log.LoggingSetupRecorder] (Quarkus Main Thread) Log level TRACE for category 'it.friendshome.api.common.filter' set below minimum logging level DEBUG, promoting it to DEBUG
2022-02-22 13:27:12,539 WARN  [io.qua.run.log.LoggingSetupRecorder] (Quarkus Main Thread) Log level TRACE for category 'org.hibernate.search' set below minimum logging level DEBUG, promoting it to DEBUG
2022-02-22 13:27:12,539 WARN  [io.qua.run.log.LoggingSetupRecorder] (Quarkus Main Thread) Log level TRACE for category 'org.zalando.logbook' set below minimum logging level DEBUG, promoting it to DEBUG
2022-02-22 13:27:12,618 INFO  [org.fly.cor.int.lic.VersionPrinter] (Quarkus Main Thread) Flyway Community Edition 8.4.2 by Redgate
2022-02-22 13:27:12,618 INFO  [org.fly.cor.int.dat.bas.BaseDatabaseType] (Quarkus Main Thread) Database: jdbc:postgresql://localhost:49154/default (PostgreSQL 13.5)
2022-02-22 13:27:12,639 INFO  [org.fly.cor.int.sch.JdbcTableSchemaHistory] (Quarkus Main Thread) Creating Schema History table "public"."flyway_schema_history" ...
2022-02-22 13:27:12,659 INFO  [org.fly.cor.int.com.DbMigrate] (Quarkus Main Thread) Current version of schema "public": << Empty Schema >>
2022-02-22 13:27:12,669 INFO  [org.fly.cor.int.com.DbMigrate] (Quarkus Main Thread) Migrating schema "public" to version "1.1.0 - initial schema"
2022-02-22 13:27:12,701 INFO  [org.fly.cor.int.com.DbMigrate] (Quarkus Main Thread) Successfully applied 1 migration to schema "public", now at version v1.1.0 (execution time 00:00.049s)
2022-02-22 13:27:12,788 DEBUG [org.hib.sea.map.orm.boo.imp.HibernateSearchPreIntegrationService] (JPA Startup Thread: <default>) HSEARCH000034: Hibernate Search version 6.1.0.Final
2022-02-22 13:27:12,790 DEBUG [org.hib.sea.map.orm.boo.imp.HibernateSearchPreIntegrationService] (JPA Startup Thread: <default>) Hibernate Search is disabled through configuration properties.
2022-02-22 13:27:13,188 ERROR [io.qua.run.Application] (Quarkus Main Thread) Failed to start application (with profile dev): org.hibernate.search.util.common.SearchException: HSEARCH800001: Hibernate Search was not initialized.
	at org.hibernate.search.mapper.orm.mapping.impl.HibernateSearchContextProviderService.get(HibernateSearchContextProviderService.java:51)
	at org.hibernate.search.mapper.orm.Search.getSearchMapping(Search.java:125)
	at org.hibernate.search.mapper.orm.Search.mapping(Search.java:41)
	at io.quarkus.hibernate.search.orm.elasticsearch.runtime.HibernateSearchElasticsearchRecorder$1.get(HibernateSearchElasticsearchRecorder.java:81)
	at io.quarkus.hibernate.search.orm.elasticsearch.runtime.HibernateSearchElasticsearchRecorder$1.get(HibernateSearchElasticsearchRecorder.java:71)
	at org.hibernate.search.mapper.orm.mapping.SearchMapping_6189e729d431a839ffe3252b51c1f273d9999c59_Synthetic_Bean.create(Unknown Source)
	at org.hibernate.search.mapper.orm.mapping.SearchMapping_6189e729d431a839ffe3252b51c1f273d9999c59_Synthetic_Bean.create(Unknown Source)
	at io.quarkus.arc.impl.AbstractSharedContext.createInstanceHandle(AbstractSharedContext.java:101)
	at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:29)
	at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:26)
	at io.quarkus.arc.impl.LazyValue.get(LazyValue.java:26)
	at io.quarkus.arc.impl.ComputingCache.computeIfAbsent(ComputingCache.java:69)
	at io.quarkus.arc.impl.AbstractSharedContext.get(AbstractSharedContext.java:26)
	at org.hibernate.search.mapper.orm.mapping.SearchMapping_6189e729d431a839ffe3252b51c1f273d9999c59_Synthetic_Bean.get(Unknown Source)
	at org.hibernate.search.mapper.orm.mapping.SearchMapping_6189e729d431a839ffe3252b51c1f273d9999c59_Synthetic_Bean.get(Unknown Source)
	at io.quarkus.arc.impl.ArcContainerImpl.beanInstanceHandle(ArcContainerImpl.java:428)
	at io.quarkus.arc.impl.ArcContainerImpl.beanInstanceHandle(ArcContainerImpl.java:441)
	at io.quarkus.arc.impl.ArcContainerImpl.instanceHandle(ArcContainerImpl.java:412)
	at io.quarkus.arc.impl.ArcContainerImpl.instance(ArcContainerImpl.java:229)
	at io.quarkus.hibernate.search.orm.elasticsearch.runtime.devconsole.HibernateSearchSupplier.searchMapping(HibernateSearchSupplier.java:27)
	at io.quarkus.hibernate.search.orm.elasticsearch.runtime.devconsole.HibernateSearchSupplier.get(HibernateSearchSupplier.java:18)
	at io.quarkus.hibernate.search.orm.elasticsearch.runtime.devconsole.HibernateSearchSupplier.get(HibernateSearchSupplier.java:14)
	at io.quarkus.vertx.http.runtime.devmode.DevConsoleRecorder.addInfo(DevConsoleRecorder.java:33)
	at io.quarkus.deployment.steps.DevConsoleProcessor$runtimeTemplates308161071.deploy_0(Unknown Source)
	at io.quarkus.deployment.steps.DevConsoleProcessor$runtimeTemplates308161071.deploy(Unknown Source)
	at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
	at io.quarkus.runtime.Application.start(Application.java:101)
	at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:103)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:67)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:41)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:120)
	at io.quarkus.runner.GeneratedMain.main(Unknown Source)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at io.quarkus.runner.bootstrap.StartupActionImpl$1.run(StartupActionImpl.java:103)
	at java.base/java.lang.Thread.run(Thread.java:829)

Expected behavior

If hibernate search is disabled, no check and initialization should be done.

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

Linux CH-ADN-3DVB3F3 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

openjdk version "11.0.13" 2021-10-19 OpenJDK Runtime Environment (build 11.0.13+8-Ubuntu-0ubuntu1.20.04) OpenJDK 64-Bit Server VM (build 11.0.13+8-Ubuntu-0ubuntu1.20.04, mixed mode)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.7.1.Final

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@fastluca fastluca added the kind/bug Something isn't working label Feb 22, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Feb 22, 2022

/cc @gsmet, @yrodiere

@quarkus-bot quarkus-bot bot added the area/hibernate-search Hibernate Search label Feb 22, 2022
@yrodiere
Copy link
Member

Thanks for reporting this.
The problem seems caused by the dev console, which attempts to use Hibernate Search even though Hibernate Search is disabled. Obviously this cannot work. I'll look into it.

@fastluca
Copy link
Author

As an additional info, using the following configuration the application starts but it runs all the async jobs for indexing:

#quarkus.hibernate-search-orm.enabled=false
quarkus.hibernate-search-orm.elasticsearch.version=7.0
quarkus.hibernate-search-orm.elasticsearch.version-check.enabled=false
quarkus.hibernate-search-orm.schema-management.strategy=none
quarkus.hibernate-search-orm.automatic-indexing.synchronization.strategy=async

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/hibernate-search Hibernate Search kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants