Springboot空项目启动时报错

Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'inMemoryDatabaseShutdownExecutor' defined in class path resource 
[org/springframework/boot/devtools/autoconfigure/DevToolsDataSourceAutoConfiguration.class]: Unsatisfied dependency expressed through method 'inMemoryDatabaseShutdownExecutor' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource 
[org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is 
org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is 
org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
上面的错加上@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
2018-12-06 17:01:23.248  WARN 11028 --- [  restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.session.SessionAutoConfiguration$ServletSessionRepositoryImplementationValidator': Invocation of init method failed; nested exception is org.springframework.boot.autoconfigure.session.NonUniqueSessionRepositoryException: Multiple session repository candidates are available, set the 'spring.session.store-type' property accordingly
2018-12-06 17:01:23.249  INFO 11028 --- [  restartedMain] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown
2018-12-06 17:01:23.269  INFO 11028 --- [  restartedMain] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2018-12-06 17:01:23.323  INFO 11028 --- [  restartedMain] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-12-06 17:01:23.339 ERROR 11028 --- [  restartedMain] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Multiple Spring Session store implementations are available on the classpath:
    - org.springframework.session.jdbc.JdbcOperationsSessionRepository
    - org.springframework.session.data.redis.RedisOperationsSessionRepository


Action:

Consider any of the following:
    - Define the `spring.session.store-type` property to the store you want to use
    - Review your classpath and remove the unwanted store implementation(s)

上面的错springboot集成springsession利用redis来实现session共享

所以没有配置redis的代码和properties,但是pom中 引入了redis;要配置spring.session.store-type=none

猜你喜欢

转载自blog.csdn.net/voidL123/article/details/84861138