2017-05-24 4 views
-4

ich die folgende Ausnahme bin immer:„Anwendung konnte nicht gestartet werden“

2017-05-24 09:41:40.779 INFO 4412 --- [   main] com.develop.NewApplication    : Starting NewApplication on DESKTOP-4GP5JJA with PID 4412 (started by Athira S in C:\Users\Athira S\workspace\new) 
2017-05-24 09:41:40.779 INFO 4412 --- [   main] com.develop.NewApplication    : No active profile set, falling back to default profiles: default 
2017-05-24 09:41:40.857 INFO 4412 --- [   main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.spring[email protected]6a28ffa4: startup date [Wed May 24 09:41:40 EDT 2017]; root of context hierarchy 
2017-05-24 09:41:41.886 INFO 4412 --- [   main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring 
2017-05-24 09:41:42.198 WARN 4412 --- [   main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration': Unsatisfied dependency expressed through constructor 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$Tomcat.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.tomcat.jdbc.pool.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). 
2017-05-24 09:41:42.214 INFO 4412 --- [   main] utoConfigurationReportLoggingInitializer : 

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled. 
2017-05-24 09:41:42.214 ERROR 4412 --- [   main] o.s.b.d.LoggingFailureAnalysisReporter : 

*************************** 
APPLICATION FAILED TO START 
*************************** 

Description: 

Cannot determine embedded database driver class for database type NONE 

Action: 

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). 
+0

Bitte bearbeiten Sie Ihre Frage nicht so, dass vorhandene Antworten ungültig werden. Erstellen Sie stattdessen eine neue Frage. – Matt

Antwort

0

ich Ihre Frage nicht finden können. Für diesen Fehler sollten Sie eine Art eingebetteten jdbc-Treiber jar, wie H2, sqlite, in Ihrem Pom hinzugefügt haben. Für H2 ist:

<dependency> 
    <groupId>com.h2database</groupId> 
    <artifactId>h2</artifactId> 
</dependency> 

Sie haben keine Version benötigen, wenn Sie spring-boot-starter-parent als Eltern verwenden.

0

Sie es zu tun mit einer Feder Boot-Anwendung Angenommen, Sie haben zwei Lösungen:

OPTION 1. Wenn Sie eine Datenbank haben, können Sie bis zu Ihrer Anwendung anschließen, die Eigenschaften Gruppe Datenquelle für den Frühling eingestellt:

Probe application.properties:

spring.datasource.url=jdbc://mysql://localhost:3306/dbname 
spring.datasource.username=db_username 
spring.datasource.password=db_password 

(Die gleichen Eigenschaften Gruppe in yml eingestellt werden kann, wenn man das :)

verwenden

Probe application.yml:

spring: 
    datasource: 
    url: jdbc:mysql://localhost:3306/dbname 
    username: db_username 
    password: db_password 

OPTION 2.Wenn nicht haben eine Datenbank

Entfernen Sie die Abhängigkeit von Feder-boot-Starter-jdbc [verbinden oder Spring-Boot-Starter-jpa als der JDBC-Starter ist eine Abhängigkeit des Starters jpa]

Wenn Sie Maven verwenden, sieht diese Abhängigkeit wie folgt aus:

<dependency> 
    <groupId>org.springframework.boot</groupId> 
    <artifactId>spring-boot-starter-jdbc</artifactId> 
</dependency> 

In gradle, es so etwas wie dieses würde:

compile 'org.springframework.boot:spring-boot-starter-jdbc'

Wenn dies für Sie nicht der Fall ist, bitte etwas mehr Kontext (wie Ihre pom.xml hinzufügen | build.gradle und/oder application.properties | application.yml, damit wir mehr von dem sehen können, was vor sich geht.

Verwandte Themen