admin管理员组文章数量:1794759
springboot报错“Consider revisiting the conditions above or defining a bean of type 'javax.sql.。。。
报错名称
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.
报错原因 用了spring-boot-starter-data-jpa 同时 springbootApplication注解为: @SpringBootApplication(exclude = DataSourceAutoConfiguration.class )
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> 解决方案1 @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class , HibernateJpaAutoConfiguration.class}) 方案2 @SpringBootApplication()本文标签: 报错conditionsdefiningSpringBootrevisiting
版权声明:本文标题:springboot报错“Consider revisiting the conditions above or defining a bean of type &#039;javax.sql.。。。 内容由林淑君副主任自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.xiehuijuan.com/baike/1686551832a80970.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论