1. 程式人生 > >啟動springBoot,使用h2內嵌資料庫,修改hibernate方言

啟動springBoot,使用h2內嵌資料庫,修改hibernate方言

啟動springBoot報錯 修改hibernate方言即可,類似問題同樣可以解決
  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.4.7.RELEASE)

2017-11-28 22:41:49.811  INFO 10844 --- [           main] icroserviceSimpleProviderUserApplication : Starting MicroserviceSimpleProviderUserApplication on DESKTOP-MSJTVDP with PID 10844 (C:\Users\hasee\Desktop\microservice-simple-provider-user\target\classes started by Hang W in C:\Users\hasee\Desktop\microservice-simple-provider-user)
2017-11-28 22:41:49.813  INFO 10844 --- [           main] icroserviceSimpleProviderUserApplication : No active profile set, falling back to default profiles: default
2017-11-28 22:41:49.861  INFO 10844 --- [           main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot
[email protected]
33b74f: startup date [Tue Nov 28 22:41:49 CST 2017]; root of context hierarchy 2017-11-28 22:41:51.426 INFO 10844 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8443 (http) 2017-11-28 22:41:51.436 INFO 10844 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2017-11-28 22:41:51.437 INFO 10844 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.15 2017-11-28 22:41:51.541 INFO 10844 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/miss] : Initializing Spring embedded WebApplicationContext 2017-11-28 22:41:51.541 INFO 10844 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1683 ms 2017-11-28 22:41:51.663 INFO 10844 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/] 2017-11-28 22:41:51.666 INFO 10844 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*] 2017-11-28 22:41:51.667 INFO 10844 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*] 2017-11-28 22:41:51.667 INFO 10844 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*] 2017-11-28 22:41:51.667 INFO 10844 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*] 2017-11-28 22:41:51.929 INFO 10844 --- [ main] o.s.jdbc.datasource.init.ScriptUtils : Executing SQL script from URL [file:/C:/Users/hasee/Desktop/microservice-simple-provider-user/target/classes/schema.sql] 2017-11-28 22:41:51.944 INFO 10844 --- [ main] o.s.jdbc.datasource.init.ScriptUtils : Executed SQL script from URL [file:/C:/Users/hasee/Desktop/microservice-simple-provider-user/target/classes/schema.sql] in 15 ms. 2017-11-28 22:41:51.946 INFO 10844 --- [ main] o.s.jdbc.datasource.init.ScriptUtils : Executing SQL script from URL [file:/C:/Users/hasee/Desktop/microservice-simple-provider-user/target/classes/data.sql] 2017-11-28 22:41:51.951 INFO 10844 --- [ main] o.s.jdbc.datasource.init.ScriptUtils : Executed SQL script from URL [file:/C:/Users/hasee/Desktop/microservice-simple-provider-user/target/classes/data.sql] in 5 ms. 2017-11-28 22:41:52.004 INFO 10844 --- [ main] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default' 2017-11-28 22:41:52.018 INFO 10844 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [ name: default ...] 2017-11-28 22:41:52.084 INFO 10844 --- [ main] org.hibernate.Version : HHH000412: Hibernate Core {5.0.12.Final} 2017-11-28 22:41:52.086 INFO 10844 --- [ main] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found 2017-11-28 22:41:52.087 INFO 10844 --- [ main] org.hibernate.cfg.Environment : HHH000021: Bytecode provider name : javassist 2017-11-28 22:41:52.121 INFO 10844 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.1.Final} 2017-11-28 22:41:52.217 WARN 10844 --- [ main] o.h.e.j.e.i.JdbcEnvironmentInitiator : HHH000342: Could not obtain connection to query metadata : Unable to resolve name [h2] as strategy [org.hibernate.dialect.Dialect] 2017-11-28 22:41:52.219 WARN 10844 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] 2017-11-28 22:41:52.220 INFO 10844 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat] 2017-11-28 22:41:52.228 INFO 10844 --- [ main] utoConfigurationReportLoggingInitializer : Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled. 2017-11-28 22:41:52.234 ERROR 10844 --- [ main] o.s.boot.SpringApplication : Application startup failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1628) ~[spring-beans-4.3.9.RELEASE.jar:4.3.9.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555) ~[spring-beans-4.3.9.RELEASE.jar:4.3.9.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.9.RELEASE.jar:4.3.9.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.9.RELEASE.jar:4.3.9.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.9.RELEASE.jar:4.3.9.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.9.RELEASE.jar:4.3.9.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.9.RELEASE.jar:4.3.9.RELEASE] at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1078) ~[spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:857) ~[spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) ~[spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE] at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.4.7.RELEASE.jar:1.4.7.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:762) [spring-boot-1.4.7.RELEASE.jar:1.4.7.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:372) [spring-boot-1.4.7.RELEASE.jar:1.4.7.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) [spring-boot-1.4.7.RELEASE.jar:1.4.7.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1187) [spring-boot-1.4.7.RELEASE.jar:1.4.7.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1176) [spring-boot-1.4.7.RELEASE.jar:1.4.7.RELEASE] at com.miss.cloud.microservicesimpleprovideruser.MicroserviceSimpleProviderUserApplication.main(MicroserviceSimpleProviderUserApplication.java:10) [classes/:na] Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:264) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final] at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:228) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final] at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:207) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final] at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:51) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final] at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:94) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final] at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:237) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final] at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:207) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final] at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.handleTypes(MetadataBuildingProcess.java:352) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final] at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:111) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final] at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:847) ~[hibernate-entitymanager-5.0.12.Final.jar:5.0.12.Final] at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:874) ~[hibernate-entitymanager-5.0.12.Final.jar:5.0.12.Final] at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:60) ~[spring-orm-4.3.9.RELEASE.jar:4.3.9.RELEASE] at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:353) ~[spring-orm-4.3.9.RELEASE.jar:4.3.9.RELEASE] at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:370) ~[spring-orm-4.3.9.RELEASE.jar:4.3.9.RELEASE] at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:359) ~[spring-orm-4.3.9.RELEASE.jar:4.3.9.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687) ~[spring-beans-4.3.9.RELEASE.jar:4.3.9.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624) ~[spring-beans-4.3.9.RELEASE.jar:4.3.9.RELEASE] ... 16 common frames omitted Caused by: org.hibernate.boot.registry.selector.spi.StrategySelectionException: Unable to resolve name [h2] as strategy [org.hibernate.dialect.Dialect]
at org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.selectStrategyImplementor(StrategySelectorImpl.java:113) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final] at org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.resolveDefaultableStrategy(StrategySelectorImpl.java:162) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final] at org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.resolveDefaultableStrategy(StrategySelectorImpl.java:126) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final] at org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.resolveStrategy(StrategySelectorImpl.java:120) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final] at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.constructDialect(DialectFactoryImpl.java:74) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final] at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.buildDialect(DialectFactoryImpl.java:51) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final] at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:137) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final] at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:35) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final] at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:88) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final] at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:254) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final] ... 32 common frames omitted
application.properties配置檔案加上即可 spring.jpa.database-platform=org.hibernate.dialect.H2Dialect

相關推薦

啟動springBoot使用h2資料庫修改hibernate方言

啟動springBoot報錯 修改hibernate方言即可,類似問題同樣可以解決 . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '

SpringBoot使用H2數據庫

只需要 java [] url roo cat service user 接口規範 1.驅動 我們知道,JDBC是JDK自帶的接口規範,不同的數據庫有不同的實現,只需要引入相應的驅動包即可。 在使用MySQL數據庫時,引入的是MySQL驅動,相應的,使用H2數據庫時,也需要

Java設置PPT的扇形圖Excel聯動

public tchar .info range close ide creates enc return /** * 設置餅圖的主方法 * @param slide 圖表 * @param index 圖標位置 * @param data 需要設置的數據 * @

3層map迴圈接收不到返回值

如程式碼所示:必須寫3個return,而非是在最裡面寫一個return。 Object.keys(publishSelectObj).map((key) => { let i

iView頁面Modal中Tabs重新顯示Modal時預設選中Tabs的第一項

文件中說啟用面板的name用value,頁面第一次載入的時候可以,放在modal裡就不好使了,每次開啟的時候總顯示上一次離開時的介面。 真正能用的是 this.$refs.tabs.activeKey = 'name1' ,此方法也可以動態設定Tabs頁面。 html: <

Spring Boot資料庫的使用(H2

Spring FrameWork提供對於SQL資料庫提供了非常廣泛的支援,從直接使用JdbcTemplate的JDBC到類似Hibernate等完備的ORM技術。Spring Data提供一個額外的功能, 直接從介面建立Repository實現, 並使用約定從你

vue + iview頁面Modal中Tabs重新顯示Modal時預設選中Tabs的第一項

<Modal v-model="modal.visible" width="80%" transfer :title="modal.title" footer-hide> <Tabs ref="tabs" :animated="false">

騷操作win10linux核心調bash

Windows loves Linux,新版win10中,已經內嵌linux系統,可以直接通過cmd 呼叫power shell ,然後是直接使用 bash 1.開啟開發者模式 1.1進

osgqt直接使用q creater視覺化生成的Ui檔案

 這裡原理跟我之前文章的訊號槽的使用類似,通過qt的uic對ui檔案轉換成.h檔案,匯入到專案中使用。  1.生成ui檔案,這個不用說什麼  2.將ui檔案放入工程目錄,輸入類似如下  3.然後編譯工程,會生成ui_textUI.h檔案,將其匯入工程  4.然後按照不同

mongodb$where指令碼

在使用mongodb的時候,有遇到這種情況,查詢某個欄位長度大於10的記錄。 由於mongodb是json文件結構,要找出有問題的資料也不容易, 有些情況下,可以劃分為垃圾資料, 1、一些欄位的長度超出不正常範圍的時候。 2、型別與你預想的不一致,如應該為NumberInt

在CSDN—Markdown中使用HTML增加Markdown的功能。

總結: 一、設定字號、字型、顏色 <font size="3" color="red">This is some text!</font> <font size="2" color="blue">This is som

Mac 使用natappNginx網穿透生成外網可訪問域名

以下內容基於Mac ##natapp使用 使用natapp工具,官網連結https://natapp.cn 下載完成後,根據官方教程進行配置,連結如下: https://natapp.cn/article/natapp_newbie 下載下來的檔案不可直接執行,先執行chmod

Android中用命令列檢視資料庫SQLite3的一些注意事項

進入手機模擬器的shell環境    連線好手機模擬器後,通過Android Studio的Teminal終端直接進入shell環境          adb shell //進入手機模擬器的shell環境 s

IO流讀取資料檔案將資料寫入資料庫並記錄資料匯入日誌

流程分析: 資料型別: ROUTE_ID,LXBM,ROAD_NAME,SRC_LON,SRC_LAT,DEST_LON,DEST_LAT 10000,G50,滬渝高速,115.8605349,30.08934467,115.5437817,30.08898601 10001,G

content內容padding邊距board邊框margin外邊距

圖解CSS padding、margin、border屬性 W3C組織建議把所有網頁上的對像都放在一個盒(box)中,設計師可以通過建立定義來控制這個盒的屬性,這些對像包括段落、列表、標題、圖片以及層。盒模型主要定義四個區域:內容(content)、內邊距(p

CSS 塊級元素block 元素 inline以及行塊級元素inline-block

block元素(div、p、h1~h6、ul、ol、dl、li、dd、table、hr、blockquote、address、table、menu、pre,HTML5新增的header、section、aside、footer等) 從瀏覽器的顯示結果可以看出,塊級元素新開啟一行(即

Android除錯工具模板UI應用懸浮窗動態顯示記憶體佔用

EnDebugBubble 一個良好的Debug工具入口,是每個app所必備的,對於凌亂的除錯工具整理和除錯功能的統一使用方法,需要一個外觀整潔,內部具體的顯示容器。 傳統方案 方案一:一般的除錯工

CDH 5.3.9(parcels)叢集中hive0.13.0升級到hive-1.2.1步驟全升級hive元資料庫資料不丟失

2.將安裝包傳到叢集所有節點上 3.所有節點root使用者下  cd /opt/cloudera/parcels/CDH/lib/hive mkdir lib121 5.所有節點將解壓出來hive/lib下所有檔案拷貝到lib121 6.Coudera 介面

函式的預設值函數函式過載

函式預設值 c++在函式方面比c多了個預設值,實際是當給函式不傳引數是該函式就會使用預設值對引數進行賦值,當然預設值是從右向左依次賦值 void sum(int a,int b=2,int c=3) {} int main() { sum(1);//因為a無預設值,所以要傳引數 } 函式預設

C++ Hook(鉤子)程式設計通過聯彙編使類成員函式代替全域性函式(靜態函式)

程式語言:C/C++ 編譯環境:Visual Studio 2008 核心方法::通過內聯彙編,構造類物件獨享的函式(委託),完成了類成員函式到普通全域性函式的轉化,並在Windows Hook(鉤子)程式設計中得到成功的實踐。 關鍵字:C++,委託,內聯彙編,Hook,成