jhipster - mongoProperties properties are null -


i'm newbie jhipster. created gateway project mongodb. started jhipster-registry , mongodb in docker. there no other microservice. when debugged gateway project, found below error:

caused by: java.lang.illegalargumentexception: database name must not empty @ org.springframework.util.assert.hastext(assert.java:168) @ org.springframework.data.mongodb.core.simplemongodbfactory.<init>(simplemongodbfactory.java:142) @ org.springframework.data.mongodb.core.simplemongodbfactory.<init>(simplemongodbfactory.java:93) @ org.springframework.data.mongodb.config.abstractmongoconfiguration.mongodbfactory(abstractmongoconfiguration.java:114) @ com.xx.cloud.demo.config.databaseconfiguration$$enhancerbyspringcglib$$65a29278.cglib$mongodbfactory$6(<generated>) @ com.xx.cloud.demo.config.databaseconfiguration$$enhancerbyspringcglib$$65a29278$$fastclassbyspringcglib$$7563f63.invoke(<generated>) @ org.springframework.cglib.proxy.methodproxy.invokesuper(methodproxy.java:228) @ org.springframework.context.annotation.configurationclassenhancer$beanmethodinterceptor.intercept(configurationclassenhancer.java:356) @ com.xx.cloud.demo.config.databaseconfiguration$$enhancerbyspringcglib$$65a29278.mongodbfactory(<generated>) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:498) @ org.springframework.beans.factory.support.simpleinstantiationstrategy.instantiate(simpleinstantiationstrategy.java:162) ... 182 common frames omitted 

i put breakpoint within method getdatabasename() in databaseconfiguration.java class , debug getwayapp.java. found properties of mongoproperties null except url value 'mongodb://localhost/test'. configured data in application-dev.yml this:

data:     cassandra:         contactpoints: localhost         protocolversion: v4         compression: lz4         keyspacename: gateway         repositories:             enabled: false         mongodb:          host: localhost          port: 27017          uri: mongodb://localhost:27017          database: jhipstermongodbsampleapplication 

but same result of didn't configure it.

how , should configure mongodb in gateway? in advance.

you put mongodb block under cassandra, reduce indentation.

also don't forget application properties should defined in registry production deployment.


Comments