尝试使用spring boot项目生成db表

时间:2016-08-29 02:22:59

标签: java-ee spring-boot

org.springframework.beans.factory.BeanCreationException:创建名称为' entityManagerFactory'的bean时出错在类路径资源中定义[org / springframework / boot / autoconfigure / orm / jpa / HibernateJpaAutoConfiguration.class]:调用init方法失败;嵌套异常是org.hibernate.boot.registry.selector.spi.StrategySelectionException:无法将名称[org.hibernate.dialect.MYSQL5Dialect]解析为策略[org.hibernate.dialect.Dialect]     在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578)〜[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]     在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)〜[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]     在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)〜[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]     at org.springframework.beans.factory.support.AbstractBeanFactory $ 1.getObject(AbstractBeanFactory.java:306)〜[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]     在org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)〜[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]     在org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)〜[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]     在org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)〜[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]     在org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1051)〜[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]     在org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:828)〜[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]     在org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537)〜[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]     at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)~ [spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]     在org.springframework.boot.SpringApplication.refresh(SpringApplication.java:752)[spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]     在org.springframework.boot.SpringApplication.doRun(SpringApplication.java:347)[spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]     在org.springframework.boot.SpringApplication.run(SpringApplication.java:295)[spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]     在org.springframework.boot.SpringApplication.run(SpringApplication.java:1112)[spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]     在org.springframework.boot.SpringApplication.run(SpringApplication.java:1101)[spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]     at tn.enis.BanqueSiApplication.main(BanqueSiApplication.java:10)[classes /:na] 引起:org.hibernate.boot.registry.selector.spi.StrategySelectionException:无法将名称[org.hibernate.dialect.MYSQL5Dialect]解析为策略[org.hibernate.dialect.Dialect]     在org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.selectStrategyImplementor(StrategySelectorImpl.java:128)~ [hibernate-core-4.3.11.Final.jar:4.3.11.Final]     在org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.resolveDefaultableStrategy(StrategySelectorImpl.java:155)〜[hibernate-core-4.3.11.Final.jar:4.3.11.Final]     在org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.resolveStrategy(StrategySelectorImpl.java:136)〜[hibernate-core-4.3.11.Final.jar:4.3.11.Final]     在org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.constructDialect(DialectFactoryImpl.java:78)〜[hibernate-core-4.3.11.Final.jar:4.3.11.Final]     在org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.buildDialect(DialectFactoryImpl.java:68)〜[hibernate-core-4.3.11.Final.jar:4.3.11.Final]     在org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:165)〜[hibernate-core-4.3.11.Final.jar:4.3.11.Final]     在org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:111)〜[hibernate-core-4.3.11.Final.jar:4.3.11.Final]     在org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:234)〜[hibernate-core-4.3.11.Final.jar:4.3.11.Final]     在org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206)〜[hibernate-core-4.3.11.Final.jar:4.3.11.Final]     在org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1887)〜[hibernate-core-4.3.11.Final.jar:4.3.11.Final]     在org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1845)〜[hibernate-core-4.3.11.Final.jar:4.3.11.Final]     在org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl $ 4.perform(EntityManagerFactoryBuilderImpl.java:857)~ [hibernate-entitymanager-4.3.11.Final.jar:4.3.11.Final]     在org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl $ 4.perform(EntityManagerFactoryBuilderImpl.java:850)~ [hibernate-entitymanager-4.3.11.Final.jar:4.3.11.Final]     在org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:425)〜[hibernate-core-4.3.11.Final.jar:4.3.11.Final]     在org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:849)〜[hibernate-entitymanager-4.3.11.Final.jar:4.3.11.Final]     在org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:60)〜[spring-orm-4.2.3.RELEASE.jar:4.2.3.RELEASE]     在org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:343)〜[spring-orm-4.2.3.RELEASE.jar:4.2.3.RELEASE]     在org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:318)〜[spring-orm-4.2.3.RELEASE.jar:4.2.3.RELEASE]     在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)〜[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]     在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)〜[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]     ...省略了16个常见帧

1 个答案:

答案 0 :(得分:2)

你的方言中有一个大写的“Y”。将其更改为org.hibernate.dialect.MySQL5Dialect,应该修复。