Remove the login/password from the MDB URI in the application.properties file. Use mongodb://localhost instead as you are making people use a local docker instance.
Also remove quarkus.mongodb.database = fruits from the properties file because it's confusing and not used apparently.
Looks like only jnosql.document.database = fruits really works and avoids the following error.
ERROR [io.qua.run.Application] (Quarkus Main Thread) Failed to start application (with profile [dev]): java.lang.RuntimeException: Failed to start quarkus
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:111)
at io.quarkus.runtime.Quarkus.run(Quarkus.java:71)
at io.quarkus.runtime.Quarkus.run(Quarkus.java:44)
at io.quarkus.runtime.Quarkus.run(Quarkus.java:124)
at io.quarkus.runner.GeneratedMain.main(Unknown Source)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at io.quarkus.runner.bootstrap.StartupActionImpl$1.run(StartupActionImpl.java:113)
at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: jakarta.data.exceptions.MappingException: Please, inform the database filling up the property DOCUMENT_DATABASE
at io.quarkiverse.jnosql.core.runtime.AbstractManagerProducer.lambda$apply$0(AbstractManagerProducer.java:29)
at java.base/java.util.Optional.orElseThrow(Optional.java:403)
at io.quarkiverse.jnosql.core.runtime.AbstractManagerProducer.apply(AbstractManagerProducer.java:29)
at io.quarkiverse.jnosql.document.runtime.DocumentManagerProducer.get(DocumentManagerProducer.java:30)
at io.quarkiverse.jnosql.document.runtime.DocumentManagerProducer_ProducerMethod_get_rMRZDVEIhDpSaAKguklTxGkPO5U_Bean.doCreate(Unknown Source)
at io.quarkiverse.jnosql.document.runtime.DocumentManagerProducer_ProducerMethod_get_rMRZDVEIhDpSaAKguklTxGkPO5U_Bean.create(Unknown Source)
at io.quarkiverse.jnosql.document.runtime.DocumentManagerProducer_ProducerMethod_get_rMRZDVEIhDpSaAKguklTxGkPO5U_Bean.create(Unknown Source)
at io.quarkus.arc.impl.AbstractSharedContext.createInstanceHandle(AbstractSharedContext.java:119)
at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:38)
at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:35)
at io.quarkus.arc.generator.Default_jakarta_enterprise_context_ApplicationScoped_ContextInstances.c21(Unknown Source)
at io.quarkus.arc.generator.Default_jakarta_enterprise_context_ApplicationScoped_ContextInstances.computeIfAbsent(Unknown Source)
at io.quarkus.arc.impl.AbstractSharedContext.get(AbstractSharedContext.java:35)
at io.quarkus.arc.impl.ClientProxies.getApplicationScopedDelegate(ClientProxies.java:21)
at org.eclipse.jnosql.communication.semistructured.DocumentManagerProducer_ProducerMethod_get_rMRZDVEIhDpSaAKguklTxGkPO5U_ClientProxy.arc$delegate(Unknown Source)
at org.eclipse.jnosql.communication.semistructured.DocumentManagerProducer_ProducerMethod_get_rMRZDVEIhDpSaAKguklTxGkPO5U_ClientProxy.select(Unknown Source)
at org.eclipse.jnosql.mapping.semistructured.AbstractSemiStructuredTemplate.executeQuery(AbstractSemiStructuredTemplate.java:265)
at org.eclipse.jnosql.mapping.semistructured.AbstractSemiStructuredTemplate.select(AbstractSemiStructuredTemplate.java:162)
at org.eclipse.jnosql.mapping.document.DefaultDocumentTemplate_ClientProxy.select(Unknown Source)
at com.mongodb.FruitRepositoryLiteDocument.countBy(FruitRepositoryLiteDocument.java:191)
at com.mongodb.FruitRepositoryLiteDocument_ClientProxy.countBy(Unknown Source)
at com.mongodb.SetupDatabase.onStart(SetupDatabase.java:28)
at com.mongodb.SetupDatabase_Observer_onStart_hmEtoFow52LrBsIhR-v_hzSi0NE.notify(Unknown Source)
at io.quarkus.arc.impl.EventImpl$Notifier.notifyObservers(EventImpl.java:351)
at io.quarkus.arc.impl.EventImpl$Notifier.notify(EventImpl.java:333)
at io.quarkus.arc.impl.EventImpl.fire(EventImpl.java:80)
at io.quarkus.arc.runtime.ArcRecorder.fireLifecycleEvent(ArcRecorder.java:155)
at io.quarkus.arc.runtime.ArcRecorder.handleLifecycleEvents(ArcRecorder.java:106)
at io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy_0(Unknown Source)
at io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy(Unknown Source)
... 11 more
Hi,
Remove the login/password from the MDB URI in the
application.properties
file. Usemongodb://localhost
instead as you are making people use a local docker instance.Also remove
quarkus.mongodb.database = fruits
from the properties file because it's confusing and not used apparently.Looks like only
jnosql.document.database = fruits
really works and avoids the following error.Thanks, Maxime.