Within Eclipse I am able to run a Spring Boot application using Run As > Java Application > Application - xxx
where xxx = projectname
. Using this way to run the application works. Started Application in 5.091 seconds (JVM running for 5.445)
Now as this is working, I want to be able to run the application outside Eclipse. Is this possible?
What I have tried
I made an application build file using Run As > Maven install
. This fills up the target
folder with among other things a project-0.0.1-SNAPSHOT.jar
and project-0.0.1-SNAPSHOT.jar.original
file.
I searched over the internet and found that it is possible to run those files using java -jar project.jar
. Unfortunatelly this gives the following error output:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private javax.sql.DataSource org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration.dataSource; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfiguration$NonEmbeddedConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).
Question
Does anybody know another way to run the Spring Boot application outside Eclipse or know how to fix this error?