Я получаю следующую ошибку при запуске jar при использовании:
java -jar <jarPath>.jar server config.yml
Ошибка:
* Configuration at config.yml must not be empty
at io.dropwizard.configuration.ConfigurationParsingException$Builder.build(ConfigurationParsingException.java:279)
at io.dropwizard.configuration.BaseConfigurationFactory.build(BaseConfigurationFactory.java:85)
at io.dropwizard.cli.ConfiguredCommand.parseConfiguration(ConfiguredCommand.java:126)
at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:74)
at io.dropwizard.cli.Cli.run(Cli.java:79)
at io.dropwizard.Application.run(Application.java:94)
at com.flipkart.cx.taggingconsole.webapp.application.DataConsoleApp.main(DataConsoleApp.java:62)
Ответ - это мой конфигурационный файл, я новичок во всех это и попытка подключить мое приложение dropwizard к hibernate, используя config.yml, а не hibernate.cfg. xml.
Пожалуйста, посмотрите на файл config.yml
server:
applicationConnectors:
- type: http
port: 8800
adminConnectors:
- type: http
port: 9800
# Database settings.
database:
# the name of your JDBC driver
driverClass: com.mysql.jdbc.Driver
# the username
user: root
# the password
password: root1234
# the JDBC URL
url: jdbc:h2:./target/example
properties:
hibernate.dialect: org.hibernate.dialect.MySQLDialect
hibernate.connection.url: jdbc:mysql://localhost/test
hibernate.connection.driver_class: com.mysql.jdbc.Driver
hibernate.show_sql: false
hibernate.generate_statistics: false
hibernate.hbm2ddl.auto: update # validates schema when service is started
hibernate.current_session_context_class: thread