亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

org.hibernate.HibernateException:

org.hibernate.HibernateException:

臨摹微笑 2019-09-02 10:52:16
我正在嘗試運行一個spring-boot應用程序,它通過spring-jpa使用hibernate,但是我收到了錯誤我的pom.xml文件是這樣的:<parent>    <groupId>org.springframework.boot</groupId>    <artifactId>spring-boot-starter-parent</artifactId>    <version>1.1.8.RELEASE</version></parent><dependencies>    <dependency>        <groupId>org.springframework.boot</groupId>        <artifactId>spring-boot-starter-web</artifactId>    </dependency>    <dependency>        <groupId>org.springframework.boot</groupId>        <artifactId>spring-boot-starter-actuator</artifactId>    </dependency>    <dependency>        <groupId>org.springframework.security</groupId>        <artifactId>spring-security-web</artifactId>       </dependency>    <dependency>        <groupId>org.springframework.security</groupId>        <artifactId>spring-security-config</artifactId>    </dependency>    <dependency>        <groupId>org.springframework.security</groupId>        <artifactId>spring-security-taglibs</artifactId>    </dependency>    <dependency>        <groupId>org.springframework.boot</groupId>        <artifactId>spring-boot-starter-data-jpa</artifactId>    </dependency>    <dependency>        <groupId>commons-dbcp</groupId>        <artifactId>commons-dbcp</artifactId>    </dependency></dependencies>我的hibernate配置是(方言配置在這個類的最后一個方法中):@Configuration@EnableTransactionManagement@ComponentScan({ "com.spring.app" })public class HibernateConfig {   @Bean   public LocalSessionFactoryBean sessionFactory() {      LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean();      sessionFactory.setDataSource(restDataSource());      sessionFactory.setPackagesToScan(new String[] { "com.spring.app.model" });      sessionFactory.setHibernateProperties(hibernateProperties());      return sessionFactory;   }我在這做錯了什么?
查看完整描述

3 回答

?
梵蒂岡之花

TA貢獻1900條經驗 獲得超5個贊

在數據庫服務器啟動時啟動應用程序(使用Spring Boot)時,我遇到了類似的問題。


Hibernate可以確定自動使用的正確方言,但為了做到這一點,它需要與數據庫的實時連接。


查看完整回答
反對 回復 2019-09-02
  • 3 回答
  • 0 關注
  • 1149 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號