zhegui7212
zhegui7212
2017-10-20 01:21

spring boot使用JPA,不采用 继承,运行报错求大神指导

50
  • spring
  • jpa

图片说明![图片说明](https://img-ask.csdn.net/upload/201710/20/1508462407_199217.png)图片说明

目录结构如上图所示,请问我应该怎么配置使用,扫描包需要配置子目录吗?
启动异常如下,求大神指点:
Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2017-10-20 09:19:48.906 ERROR 13288 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

Parameter 0 of constructor in org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration required a bean of type 'javax.sql.DataSource' that could not be found.
- Bean method 'dataSource' not loaded because @ConditionalOnProperty (spring.datasource.jndi-name) did not find property 'jndi-name'
- Bean method 'dataSource' not loaded because @ConditionalOnBean (types: org.springframework.boot.jta.XADataSourceWrapper; SearchStrategy: all) did not find any beans

Action:

Consider revisiting the conditions above or defining a bean of type 'javax.sql.DataSource' in your configuration.

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

4条回答