Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2022-09-05 19:27:49.236 ERROR 5314 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
*************************** APPLICATION FAILED TO START ***************************
Description:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
Action:
Consider the following: If you want an embedded database (H2, HSQL or Derby), please put it on the classpath. If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
@Configuration publicclassRedisConfig{ @Bean public RedisTemplate<String,Object> redisTemplate(RedisConnectionFactory factory){ //一般使用<String,Object> RedisTemplate<String,Object> template = new RedisTemplate<>(); template.setConnectionFactory(factory);
//Json序列化配置 Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class); ObjectMapper om = new ObjectMapper(); om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL); jackson2JsonRedisSerializer.setObjectMapper(om);
//String 序列化 StringRedisSerializer stringRedisSerializer = new StringRedisSerializer();