2016-08-02 1 views
0

J'essaye de simplement persister un objet dans la base de données et ensuite le récupérer pour vérifier qu'il a fonctionné. J'ai eu la même erreur ces derniers jours et je ne sais pas quel est le problème. J'ai remarqué que lorsque je supprime l'annotation @Bean de la fonction de démonstration dans Application.java, elle ne génère pas d'erreur, mais elle ne persiste pas avec succès dans la base de données.Erreur Spring JPA de démarrage: Pourquoi ne puis-je pas utiliser Command Line Runner pour conserver un objet dans la base de données?

J'ai joint tous les fichiers pertinents ci-dessous.

Ceci est mon objet de données:

package dataObjects; 

import javax.persistence.Column; 
import javax.persistence.Entity; 
import javax.persistence.Id; 
import javax.persistence.Table; 

@Entity 
@Table(name="LoadMethod") 
public class LoadMethodDO { 

    private String mediaId; 
    private String activeInd; 
    private String loadMethod; 
    private String formatMapCd; 
    private String detailTransactionReportInd; 
    private String accountManaged; 

    public LoadMethodDO(){} 

    public LoadMethodDO(String mediaId, String loadMethod){ 
     this.mediaId = mediaId; 
     this.loadMethod = loadMethod; 
    } 
    @Id 
    @Column(name="Media_ID", length = 7) 
    public String getMediaId() { 
     return mediaId; 
    } 
    public void setMediaId(String mediaId) { 
     this.mediaId = mediaId; 
    } 
    @Column(name="ActInd") 
    public String getActiveInd() { 
     return activeInd; 
    } 
    public void setActiveInd(String activeInd) { 
     this.activeInd = activeInd; 
    } 
    @Column(name="LoadMthdCd") 
    public String getLoadMethod() { 
     return loadMethod; 
    } 
    public void setLoadMethod(String loadMethod) { 
     this.loadMethod = loadMethod; 
    } 
    @Column(name="FormatMapCd") 
    public String getFormatMapCd() { 
     return formatMapCd; 
    } 
    public void setFormatMapCd(String formatter) { 
     this.formatMapCd = formatter; 
    } 
    @Column(name="DtlTransRcdInd") 
    public String getDetailTransactionReportInd() { 
     return detailTransactionReportInd; 
    } 
    public void setDetailTransactionReportInd(String detailTransactionReportInd) { 
     this.detailTransactionReportInd = detailTransactionReportInd; 
    } 
    @Column(name="AcctMngdInd") 
    public String getAccountManaged() { 
     return accountManaged; 
    } 
    public void setAccountManaged(String accountManaged) { 
     this.accountManaged = accountManaged; 
    } 
} 

Ceci est mon fichier référentiel:

package repositories; 

import org.springframework.data.repository.CrudRepository; 
import dataObjects.LoadMethodDO; 

public interface LoadMethodRepository extends CrudRepository<LoadMethodDO, String>{ 

} 

Ceci est mon dossier de candidature qui devrait persister l'objet:

package testApplication; 

import org.slf4j.Logger; 
import org.slf4j.LoggerFactory; 
import org.springframework.boot.CommandLineRunner; 
import org.springframework.boot.SpringApplication; 
import org.springframework.boot.autoconfigure.SpringBootApplication; 
import org.springframework.cache.annotation.EnableCaching; 
import org.springframework.context.annotation.Bean; 
import org.springframework.context.annotation.Configuration; 
import org.springframework.data.jpa.repository.config.EnableJpaRepositories; 

import dataObjects.LoadMethodDO; 
import repositories.LoadMethodRepository; 

@SpringBootApplication 
@EnableJpaRepositories 
@EnableCaching 
public class Application { 

    private static final Logger log = LoggerFactory.getLogger(Application.class); 

    public static void main(String[] args) { 
     System.out.println("*****************"); 
     SpringApplication.run(DBController.class, args); 
    } 

    @Bean 
    public CommandLineRunner demo(LoadMethodRepository repository) { 
     return (args) -> { 
      // save 
      repository.save(new LoadMethodDO("12345678", "1234567")); 
      // fetch 
      LoadMethodDO temp = repository.findOne("1234567"); 
      System.out.println(temp.getMediaId()); 

     }; 
    } 

} 

C'est mon code d'erreur:

***************** 

    . ____   _   __ _ _ 
/\\/___'_ __ _ _(_)_ __ __ _ \ \ \ \ 
(()\___ | '_ | '_| | '_ \/ _` | \ \ \ \ 
\\/ ___)| |_)| | | | | || (_| | )))) 
    ' |____| .__|_| |_|_| |_\__, |//// 
=========|_|==============|___/=/_/_/_/ 
:: Spring Boot ::  (v1.3.6.RELEASE) 

2016-08-02 09:12:07.024 INFO 29732 --- [   main] testApplication.Application    : Starting Application on LR90KLWJY with PID 29732 (C:\Users\vincni\git\consumer_load_method\bin started by vincni in C:\Users\vincni\git\consumer_load_method) 
2016-08-02 09:12:07.040 INFO 29732 --- [   main] testApplication.Application    : No active profile set, falling back to default profiles: default 
2016-08-02 09:12:07.055 INFO 29732 --- [   main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.spring[email protected]543e710e: startup date [Tue Aug 02 09:12:07 PDT 2016]; root of context hierarchy 
2016-08-02 09:12:07.102 WARN 29732 --- [   main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'DBController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: repositories.LoadMethodRepository testApplication.DBController.lmr; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [repositories.LoadMethodRepository] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 
2016-08-02 09:12:07.118 ERROR 29732 --- [   main] o.s.boot.SpringApplication    : Application startup failed 

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'DBController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: repositories.LoadMethodRepository testApplication.DBController.lmr; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [repositories.LoadMethodRepository] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE] 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE] 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE] 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE] 
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE] 
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE] 
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE] 
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE] 
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE] 
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839) ~[spring-context-4.2.7.RELEASE.jar:4.2.7.RELEASE] 
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538) ~[spring-context-4.2.7.RELEASE.jar:4.2.7.RELEASE] 
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:760) [spring-boot-1.3.6.RELEASE.jar:1.3.6.RELEASE] 
    at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:360) [spring-boot-1.3.6.RELEASE.jar:1.3.6.RELEASE] 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:306) [spring-boot-1.3.6.RELEASE.jar:1.3.6.RELEASE] 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1185) [spring-boot-1.3.6.RELEASE.jar:1.3.6.RELEASE] 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1174) [spring-boot-1.3.6.RELEASE.jar:1.3.6.RELEASE] 
    at testApplication.Application.main(Application.java:25) [bin/:na] 
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: repositories.LoadMethodRepository testApplication.DBController.lmr; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [repositories.LoadMethodRepository] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:573) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE] 
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE] 
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE] 
    ... 16 common frames omitted 
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [repositories.LoadMethodRepository] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1373) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE] 
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1119) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE] 
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE] 
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:545) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE] 
    ... 18 common frames omitted 

2016-08-02 09:12:07.118 INFO 29732 --- [   main] .b.l.ClasspathLoggingApplicationListener : Application failed to start with classpath: [file:/C:/Users/vincni/git/consumer_load_method/bin/, file:/C:/apps/Ivy/cache/org.apache.camel/camel-ftp/jars/camel-ftp-2.16.1.jar, file:/C:/apps/Ivy/cache/org.apache.camel/camel-core/bundles/camel-core-2.16.1.jar, file:/C:/apps/Ivy/cache/com.sun.xml.bind/jaxb-core/jars/jaxb-core-2.2.11.jar, file:/C:/apps/Ivy/cache/com.sun.xml.bind/jaxb-impl/jars/jaxb-impl-2.2.11.jar, file:/C:/apps/Ivy/cache/com.jcraft/jsch/jars/jsch-0.1.53.jar, file:/C:/apps/Ivy/cache/commons-net/commons-net/jars/commons-net-3.3.jar, file:/C:/apps/Ivy/cache/com.zaxxer/HikariCP/jars/HikariCP-2.4.7.jar, file:/C:/apps/Ivy/cache/org.slf4j/slf4j-api/jars/slf4j-api-1.7.21.jar, file:/C:/apps/Ivy/cache/org.springframework.boot/spring-boot-starter-data-jpa/jars/spring-boot-starter-data-jpa-1.3.6.RELEASE.jar, file:/C:/apps/Ivy/cache/org.springframework.boot/spring-boot-starter/jars/spring-boot-starter-1.3.6.RELEASE.jar, file:/C:/apps/Ivy/cache/org.springframework.boot/spring-boot/jars/spring-boot-1.3.6.RELEASE.jar, file:/C:/apps/Ivy/cache/org.springframework/spring-core/jars/spring-core-4.2.7.RELEASE.jar, file:/C:/apps/Ivy/cache/org.springframework/spring-context/jars/spring-context-4.2.7.RELEASE.jar, file:/C:/apps/Ivy/cache/org.springframework/spring-aop/jars/spring-aop-4.2.7.RELEASE.jar, file:/C:/apps/Ivy/cache/aopalliance/aopalliance/jars/aopalliance-1.0.jar, file:/C:/apps/Ivy/cache/org.springframework/spring-beans/jars/spring-beans-4.2.7.RELEASE.jar, file:/C:/apps/Ivy/cache/org.springframework/spring-expression/jars/spring-expression-4.2.7.RELEASE.jar, file:/C:/apps/Ivy/cache/org.springframework.boot/spring-boot-autoconfigure/jars/spring-boot-autoconfigure-1.3.6.RELEASE.jar, file:/C:/apps/Ivy/cache/org.springframework.boot/spring-boot-starter-logging/jars/spring-boot-starter-logging-1.3.6.RELEASE.jar, file:/C:/apps/Ivy/cache/ch.qos.logback/logback-classic/jars/logback-classic-1.1.7.jar, file:/C:/apps/Ivy/cache/ch.qos.logback/logback-core/jars/logback-core-1.1.7.jar, file:/C:/apps/Ivy/cache/org.slf4j/jcl-over-slf4j/jars/jcl-over-slf4j-1.7.21.jar, file:/C:/apps/Ivy/cache/org.slf4j/jul-to-slf4j/jars/jul-to-slf4j-1.7.21.jar, file:/C:/apps/Ivy/cache/org.slf4j/log4j-over-slf4j/jars/log4j-over-slf4j-1.7.21.jar, file:/C:/apps/Ivy/cache/org.yaml/snakeyaml/bundles/snakeyaml-1.16.jar, file:/C:/apps/Ivy/cache/org.springframework.boot/spring-boot-starter-aop/jars/spring-boot-starter-aop-1.3.6.RELEASE.jar, file:/C:/apps/Ivy/cache/org.aspectj/aspectjweaver/jars/aspectjweaver-1.8.9.jar, file:/C:/apps/Ivy/cache/org.springframework.boot/spring-boot-starter-jdbc/jars/spring-boot-starter-jdbc-1.3.6.RELEASE.jar, file:/C:/apps/Ivy/cache/org.apache.tomcat/tomcat-jdbc/jars/tomcat-jdbc-8.0.36.jar, file:/C:/apps/Ivy/cache/org.apache.tomcat/tomcat-juli/jars/tomcat-juli-8.0.36.jar, file:/C:/apps/Ivy/cache/org.springframework/spring-jdbc/jars/spring-jdbc-4.2.7.RELEASE.jar, file:/C:/apps/Ivy/cache/org.springframework/spring-tx/jars/spring-tx-4.2.7.RELEASE.jar, file:/C:/apps/Ivy/cache/org.hibernate/hibernate-entitymanager/jars/hibernate-entitymanager-4.3.11.Final.jar, file:/C:/apps/Ivy/cache/org.jboss.logging/jboss-logging/jars/jboss-logging-3.3.0.Final.jar, file:/C:/apps/Ivy/cache/org.jboss.logging/jboss-logging-annotations/jars/jboss-logging-annotations-1.2.0.Beta1.jar, file:/C:/apps/Ivy/cache/org.hibernate/hibernate-core/jars/hibernate-core-4.3.11.Final.jar, file:/C:/apps/Ivy/cache/dom4j/dom4j/jars/dom4j-1.6.1.jar, file:/C:/apps/Ivy/cache/xml-apis/xml-apis/jars/xml-apis-1.0.b2.jar, file:/C:/apps/Ivy/cache/org.hibernate.common/hibernate-commons-annotations/jars/hibernate-commons-annotations-4.0.5.Final.jar, file:/C:/apps/Ivy/cache/org.hibernate.javax.persistence/hibernate-jpa-2.1-api/jars/hibernate-jpa-2.1-api-1.0.0.Final.jar, file:/C:/apps/Ivy/cache/org.javassist/javassist/bundles/javassist-3.18.1-GA.jar, file:/C:/apps/Ivy/cache/antlr/antlr/jars/antlr-2.7.7.jar, file:/C:/apps/Ivy/cache/org.jboss/jandex/jars/jandex-1.1.0.Final.jar, file:/C:/apps/Ivy/cache/javax.transaction/javax.transaction-api/jars/javax.transaction-api-1.2.jar, file:/C:/apps/Ivy/cache/org.springframework.data/spring-data-jpa/jars/spring-data-jpa-1.9.4.RELEASE.jar, file:/C:/apps/Ivy/cache/org.springframework.data/spring-data-commons/jars/spring-data-commons-1.11.4.RELEASE.jar, file:/C:/apps/Ivy/cache/org.springframework/spring-orm/jars/spring-orm-4.2.7.RELEASE.jar, file:/C:/apps/Ivy/cache/org.springframework/spring-aspects/jars/spring-aspects-4.2.7.RELEASE.jar, file:/C:/apps/Ivy/cache/org.apache.camel/camel-jpa/jars/camel-jpa-2.10.0.jar, file:/C:/apps/Ivy/cache/org.apache.camel/camel-spring/bundles/camel-spring-2.10.0.jar, file:/C:/apps/Ivy/cache/org.apache.poi/poi/jars/poi-3.10.1.jar, file:/C:/apps/Ivy/cache/commons-codec/commons-codec/jars/commons-codec-1.5.jar, file:/C:/apps/Ivy/cache/org.apache.poi/poi-ooxml/jars/poi-ooxml-3.10.1.jar, file:/C:/apps/Ivy/cache/org.apache.poi/poi-ooxml-schemas/jars/poi-ooxml-schemas-3.10.1.jar, file:/C:/apps/Ivy/cache/org.apache.xmlbeans/xmlbeans/jars/xmlbeans-2.6.0.jar, file:/C:/apps/Ivy/cache/stax/stax-api/jars/stax-api-1.0.1.jar, file:/C:/apps/Ivy/cache/com.microsoft.sqlserver/sqljdbc4/jars/sqljdbc4-4.0.jar, file:/C:/ExternalJARS/ojdbc7.jar, file:/C:/Users/vincni/workspace/workspace_lmt/libraries/EclipseLink%202.5.2/eclipselink/jlib/eclipselink.jar, file:/C:/Users/vincni/workspace/workspace_lmt/libraries/EclipseLink%202.5.2/eclipselink/jlib/jpa/javax.persistence_2.1.0.v201304241213.jar, file:/C:/Users/vincni/workspace/workspace_lmt/libraries/EclipseLink%202.5.2/eclipselink/jlib/jpa/org.eclipse.persistence.jpa.modelgen_2.5.2.v20140319-9ad6abd.jar, file:/C:/Users/vincni/workspace/workspace_lmt/libraries/EclipseLink%202.5.2/eclipselink/jlib/jpa/org.eclipse.persistence.jpars_2.5.2.v20140319-9ad6abd.jar, file:/C:/Users/vincni/workspace/workspace_lmt/libraries/EclipseLink%202.5.2/eclipselink/jlib/moxy/com.sun.tools.xjc_2.2.0.jar, file:/C:/Users/vincni/workspace/workspace_lmt/libraries/EclipseLink%202.5.2/eclipselink/jlib/moxy/com.sun.xml.bind_2.2.0.v201004141950.jar, file:/C:/Users/vincni/workspace/workspace_lmt/libraries/EclipseLink%202.5.2/eclipselink/jlib/moxy/javax.activation_1.1.0.v201108011116.jar, file:/C:/Users/vincni/workspace/workspace_lmt/libraries/EclipseLink%202.5.2/eclipselink/jlib/moxy/javax.mail_1.4.0.v201005080615.jar, file:/C:/Users/vincni/workspace/workspace_lmt/libraries/EclipseLink%202.5.2/eclipselink/jlib/moxy/javax.xml.bind_2.2.0.v201105210648.jar, file:/C:/Users/vincni/workspace/workspace_lmt/libraries/EclipseLink%202.5.2/eclipselink/jlib/moxy/javax.xml.stream_1.0.1.v201004272200.jar] 

Message de console si je retire @bean devant la fonction demo. Je pensais que cela pourrait être intéressant à voir, mais je suis presque sûr à 100% que le haricot devrait être là. Il ne persiste pas quoi que ce soit sans elle et toutes les sources que je l'ai vu, dit en ligne pour mettre l'annotation @bean il:

***************** 

    . ____   _   __ _ _ 
/\\/___'_ __ _ _(_)_ __ __ _ \ \ \ \ 
(()\___ | '_ | '_| | '_ \/ _` | \ \ \ \ 
\\/ ___)| |_)| | | | | || (_| | )))) 
    ' |____| .__|_| |_|_| |_\__, |//// 
=========|_|==============|___/=/_/_/_/ 
:: Spring Boot ::  (v1.3.6.RELEASE) 

2016-08-02 09:41:56.284 INFO 34864 --- [   main] testApplication.Application    : Starting Application on LR90KLWJY with PID 34864 (C:\Users\vincni\git\consumer_load_method\bin started by vincni in C:\Users\vincni\git\consumer_load_method) 
2016-08-02 09:41:56.300 INFO 34864 --- [   main] testApplication.Application    : No active profile set, falling back to default profiles: default 
2016-08-02 09:41:56.347 INFO 34864 --- [   main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.spring[email protected]15bfd87: startup date [Tue Aug 02 09:41:56 PDT 2016]; root of context hierarchy 
2016-08-02 09:41:58.537 INFO 34864 --- [   main] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default' 
2016-08-02 09:41:58.538 INFO 34864 --- [   main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [ 
    name: default 
    ...] 
2016-08-02 09:41:58.638 INFO 34864 --- [   main] org.hibernate.Version     : HHH000412: Hibernate Core {4.3.11.Final} 
2016-08-02 09:41:58.638 INFO 34864 --- [   main] org.hibernate.cfg.Environment   : HHH000206: hibernate.properties not found 
2016-08-02 09:41:58.638 INFO 34864 --- [   main] org.hibernate.cfg.Environment   : HHH000021: Bytecode provider name : javassist 
2016-08-02 09:41:58.794 INFO 34864 --- [   main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {4.0.5.Final} 
2016-08-02 09:41:58.855 WARN 34864 --- [   main] o.h.e.j.d.i.StandardDialectResolver  : HHH000385: Unknown Microsoft SQL Server major version [12] using SQL Server 2000 dialect 
2016-08-02 09:41:58.862 INFO 34864 --- [   main] org.hibernate.dialect.Dialect   : HHH000400: Using dialect: org.hibernate.dialect.SQLServerDialect 
2016-08-02 09:41:58.935 INFO 34864 --- [   main] o.h.h.i.ast.ASTQueryTranslatorFactory : HHH000397: Using ASTQueryTranslatorFactory 
2016-08-02 09:41:59.013 INFO 34864 --- [   main] org.hibernate.tool.hbm2ddl.SchemaUpdate : HHH000228: Running hbm2ddl schema update 
2016-08-02 09:41:59.013 INFO 34864 --- [   main] org.hibernate.tool.hbm2ddl.SchemaUpdate : HHH000102: Fetching database metadata 
2016-08-02 09:41:59.013 INFO 34864 --- [   main] org.hibernate.tool.hbm2ddl.SchemaUpdate : HHH000396: Updating schema 
2016-08-02 09:41:59.013 INFO 34864 --- [   main] org.hibernate.tool.hbm2ddl.SchemaUpdate : HHH000232: Schema update complete 
2016-08-02 09:41:59.248 INFO 34864 --- [   main] o.s.j.e.a.AnnotationMBeanExporter  : Registering beans for JMX exposure on startup 
2016-08-02 09:41:59.259 INFO 34864 --- [   main] testApplication.Application    : Started Application in 3.326 seconds (JVM running for 3.833) 
2016-08-02 09:41:59.261 INFO 34864 --- [  Thread-2] s.c.a.AnnotationConfigApplicationContext : Closing org.spring[email protected]15bfd87: startup date [Tue Aug 02 09:41:56 PDT 2016]; root of context hierarchy 
2016-08-02 09:41:59.263 INFO 34864 --- [  Thread-2] o.s.j.e.a.AnnotationMBeanExporter  : Unregistering JMX-exposed beans on shutdown 
2016-08-02 09:41:59.263 INFO 34864 --- [  Thread-2] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default' 

Répondre

0

Ceci est parce que votre entité, les référentiels et les applications sont dans des emballages différents et vous n'avez pas mentionné démarrage au printemps pour analyser les paquets pour les entités et d'autres configurations.

@SpringBootApplication 
@EnableJpaRepositories(basePackages = { "repositories" }) 
@EntityScan(basePackages = { "dataObjects" }) 
public class Application 

Note: Par défaut, il analysera les cours et les sous-répertoires de SpringBootApplication classe annotée. Si vous conservez toutes vos entités et répertoires (autres composants) dans les sous-packages de la classe annotée SpringBootApplication, vous n'avez pas besoin de mentionner les noms des packages à analyser.

+0

C'était tout. Je vous remercie! – user3321551