jhipster/jhipster-online

online-jhipster configuration issues

Closed this issue · 18 comments

Hi Team,
Please find below logs which i am getting while making online -jhipster up in my local:-----

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.ryantenney.metrics.spring.config.annotation.DelegatingMetricsConfiguration': Unsatisfied dependency expressed through method 'setMetricsConfigurers' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'metricsConfiguration': Unsatisfied dependency expressed through method 'setHikariDataSource' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is java.lang.IllegalStateException: Cannot load driver class: com.mysql.cj.jdbc.Driver
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:667)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:91)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:373)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1350)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:580)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:503)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:372)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1256)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1105)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:503)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:204)
at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:238)
at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:710)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:535)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)

Thanks in advances,
Regards,
Ravi kumar

Seems like you are trying to run the app without a DB, please read the documentation and follow it properly. Also please follow our issue submission guidelines so that we can help you better. There is not enough information in your ticket for us to look into it

Cannot load driver class: com.mysql.cj.jdbc.Driver

Could be a classpath issue, maybe related to your java version or to the way you run the app.
See https://github.com/jhipster/jhipster-online#quick-start-guide

\io\github\jhipster\online\config\AsyncConfiguration.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'io.github.jhipster.config.JHipsterProperties': Could not bind properties to 'JHipsterProperties' : prefix=jhipster, ignoreInvalidFields=false, ignoreUnknownFields=false; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'jhipster' to io.github.jhipster.config.JHipsterProperties
2019-07-31 15:28:09.886 ERROR 24564 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

Binding to target [Bindable@4a074920 type = io.github.jhipster.config.JHipsterProperties, value = 'provided', annotations = array[@org.springframework.boot.context.properties.ConfigurationProperties(value=jhipster, prefix=jhipster, ignoreInvalidFields=false, ignoreUnknownFields=false)]] failed:

Property: jhipster.clientapp.name
Value: jhonlineApp
Origin: class path resource [config/application.yml]:136:11
Reason: The elements [jhipster.clientapp.name,jhipster.logging.use-json-format] were left unbound.
Property: jhipster.logging.use-json-format
Value: false
Origin: class path resource [config/application-dev.yml]:107:22
Reason: The elements [jhipster.clientapp.name,jhipster.logging.use-json-format] were left unbound.

@RaviGithub555 Can you please create the related issue only once and comment there?
I am seeing this same comments at least 4 5 places. Otherwise, it confuses us on which issue to comment and also can't be tracked well.

@RaviGithub555 Cross posting is against our rules. Please don't do it again.

@RaviGithub555,
From your error message, I assume you have a property named jhipster.logging.use-json-format
in your src/main/resource/config/application.yml which does not have a corresponding property in target bean.

You can check this PR jhipster/generator-jhipster#9449 for json support in logs. It should work out-of-the-box unless you have changed the configs.

That being said, we can not tell much unless you provide more information and steps to reproduce this issue.

More on Guideline https://github.com/jhipster/generator-jhipster/blob/master/CONTRIBUTING.md

From your error message, I assume you have a property named jhipster.logging.use-json-format
in your Origin: class path resource [config/application.yml]:136:11 which do not have a corresponding Java field.

Or check it opposite way.

I have updated my previous comment.

Also, check on how spring boot property binding works at https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html#boot-features-external-config-yaml

@RaviGithub555 if you are expecting people to help you(for free) at least put in some effort to make it easier for the people trying to help you. If you expect people to spend effort to figure out your issues from cryptic error messages and code you post, I don't think you will get any help, here are some etiquettes you could follow

  • Place code and error message logs in markdown code blocks ``` ```
  • Provide as much as detail, more details the better, no one will complain about too many details
  • read error messages carefully first, you might have answers there already, otherwise it just shows you are lazy
  • Don't post the same stuff in multiple repos/multiple tickets its annoying
  • Don't ask people to help you code your solution, its not our job
  • Provide steps to reproduce the issue
  • Spend some time to read and follow guidelines we specify