zoukankan      html  css  js  c++  java
  • springboot与缓存

    1.使用缓存减轻数据库的压力, 承受高的并发量

    2.验证码三分钟有效, 把这些临时的数据放在缓存中

    JSR-107

    为了规定缓存的规范 ,javaee发布的jsr-107

    Java Caching定义了5个核心接口,分别是CachingProvider, CacheManager, Cache, Entry和Expiry。
    •CachingProvider(缓存提供者): 定义了创建、配置、获取、管理和控制多个CacheManager。一个应用可以在运行期访问多个CachingProvider。
    •CacheManager  :定义了创建、配置、获取、管理和控制多个唯一命名的Cache,这些Cache存在于CacheManager的上下文中。一个CacheManager  :仅被一个CachingProvider所拥有。
    •Cache                 :是一个类似Map的数据结构并临时存储以Key为索引的值。一个Cache仅被一个CacheManager所拥有。
    •Entry                    :是一个存储在Cache中的key-value对。
    •Expiry                :每一个存储在Cache中的条目有一个定义的有效期。一旦超过这个时间,条目为过期的状态。一旦过期,条目将不可访问、更新和删除。缓存有效期可以通过ExpiryPolicy设置。

    用户使用缓存,可以通过cacheprovider 获取到cachemanager 

    整个交互应该是这样的

    spring 的缓存抽象

    使用jsr107 开发难度还是挺大的,spring从3.1开始定义了Spring从3.1开始定义了org.springframework.cache.Cache和org.springframework.cache.CacheManager接口来统一不同的缓存技术;并支持使用JCache(JSR-107)注解简化我们开发;

    •Cache接口为缓存的组件规范定义,包含缓存的各种操作集合;

    •Cache接口下Spring提供了各种xxxCache的实现;如RedisCache,EhCacheCache , ConcurrentMapCache等;

    •每次调用需要缓存功能的方法时,Spring会检查检查指定参数的指定的目标方法是否已经被调用过;如果有就直接从缓存中获取方法调用后的结果,如果没有就调用方法并缓存结果后返回给用户。下次调用直接从缓存中获取。

    •使用Spring缓存抽象时我们需要关注以下两点;

    1、确定方法需要被缓存以及他们的缓存策略

    2、从缓存中读取之前缓存存储的数据

    Cache

    缓存接口,定义缓存操作。实现有:RedisCache、EhCacheCache、ConcurrentMapCache等

    CacheManager

    缓存管理器,管理各种缓存(Cache)组件

    @Cacheable

    主要针对方法配置,能够根据方法的请求参数对其结果进行缓存 (get)

    @CacheEvict

    清空缓存  (delete)

    @CachePut

    保证方法被调用,又希望结果被缓存。(update)

    @EnableCaching

    开启基于注解的缓存

    keyGenerator

    缓存数据时key生成策略

    HelloWorld

    我们写一个正常的没有缓存的程序, 也就是说每次请求查询一次数据库 

    Mapper

    1.  
      package com.zzq.springboot01cache.mapper;
    2.  
       
    3.  
      import com.zzq.springboot01cache.entity.Employee;
    4.  
      import org.apache.ibatis.annotations.*;
    5.  
       
    6.  
      @Mapper
    7.  
      public interface EmployeeMapper {
    8.  
       
    9.  
      @Select("SELECT * FROM employee WHERE id = #{id}")
    10.  
      public Employee getEmpById(Integer id);
    11.  
       
    12.  
      @Update("UPDATE employee SET lastName=#{lastName},email=#{email},gender=#{gender},d_id=#{dId} WHERE id=#{id}")
    13.  
      public void updateEmp(Employee employee);
    14.  
       
    15.  
      @Delete("DELETE FROM employee WHERE id=#{id}")
    16.  
      public void deleteEmpById(Integer id);
    17.  
       
    18.  
      @Insert("INSERT INTO employee(lastName,email,gender,d_id) VALUES(#{lastName},#{email},#{gender},#{dId})")
    19.  
      public void insertEmployee(Employee employee);
    20.  
       
    21.  
      @Select("SELECT * FROM employee WHERE lastName = #{lastName}")
    22.  
      Employee getEmpByLastName(String lastName);
    23.  
      }

    Service

    1.  
      public Employee getEmployeeById(Integer id){
    2.  
      System.out.println("查询员工"+id);
    3.  
      return employeeMapper.getEmpById(id);
    4.  
      }

    Controller

    1.  
      @GetMapping("/emp/{id}")
    2.  
      public Employee getEmpById(@PathVariable("id") Integer id){
    3.  
      return employeeService.getEmployeeById(id);
    4.  
      }

    这样的话我们每次请求都会查询一次数据库,在service 中写的打印语句也就会被打印,下面我们使用缓存

    1.在springbootapplication启动类上加上开启缓存的注解

        @EnableCaching

    1.  
      @EnableCaching
    2.  
      @MapperScan(basePackages = {"com.zzq.springboot01cache.mapper"})
    3.  
      @SpringBootApplication
    4.  
      public class Springboot01CacheApplication {
    5.  
       
    6.  
      public static void main(String[] args) {
    7.  
      SpringApplication.run(Springboot01CacheApplication.class, args);
    8.  
      }
    9.  
      }

    2.在我们需要缓存的方法上加上对应的注解, 具体加什么注解, 看上面的截图

    1.  
      @Cacheable(cacheNames = "emp")
    2.  
      public Employee getEmployeeById(Integer id){
    3.  
      System.out.println("查询员工"+id);
    4.  
      return employeeMapper.getEmpById(id);
    5.  
      }

    这个时候就会发现,只会打印输出语句一次,

    一个springboot 的缓存简单的缓存机制就完成了

    springboot 缓存原理

    凡是springboot 的东西我们就看自动配置,xxxautoconfigruaction  

    CacheAutoConfiguration

    上面标注了这么多东西

    1.  
      @Configuration
    2.  
      @ConditionalOnClass(CacheManager.class)
    3.  
      @ConditionalOnBean(CacheAspectSupport.class)
    4.  
      @ConditionalOnMissingBean(value = CacheManager.class, name = "cacheResolver")
    5.  
      @EnableConfigurationProperties(CacheProperties.class)
    6.  
      @AutoConfigureBefore(HibernateJpaAutoConfiguration.class)
    7.  
      @AutoConfigureAfter({ CouchbaseAutoConfiguration.class, HazelcastAutoConfiguration.class,
    8.  
      RedisAutoConfiguration.class })
    9.  
      @Import(CacheConfigurationImportSelector.class)

    @configuration  标注配置类

    @ConditionalOnClass  当容器中有CacheManager 的时候

    @ConditionalOnBean  当容器中有CacheAspectSupport这个组件的时候

    @ConditionalOnMissingBean 容器中没有名字是cacheResolver 的CacheManager 这个类型的类的时候

    @EnacbleConfigurationProperties  自动装配注解, 

    @autoConfigureBefore  在这个类开始只配置之前发生的配置类

    @autoConfigureAfter 在这个类配置之后发生的事情

    @Import 导入CacheConfigurationImportSlector 这个类

    CacheConfigurationImportSlector

    1.  
      */
    2.  
      static class CacheConfigurationImportSelector implements ImportSelector {
    3.  
       
    4.  
      @Override
    5.  
      public String[] selectImports(AnnotationMetadata importingClassMetadata) {
    6.  
      CacheType[] types = CacheType.values();
    7.  
      String[] imports = new String[types.length];
    8.  
      for (int i = 0; i < types.length; i++) {
    9.  
      imports[i] = CacheConfigurations.getConfigurationClass(types[i]);
    10.  
      }
    11.  
      return imports;
    12.  
      }
    13.  
       
    14.  
      }

    看源码这是一个内部类最终返回了所有的导入的组件 我们debug 看下

    org.springframework.boot.autoconfigure.cache.GenericCacheConfiguration

    org.springframework.boot.autoconfigure.cache.JCacheCacheConfiguration

    org.springframework.boot.autoconfigure.cache.EhCacheCacheConfiguration

    org.springframework.boot.autoconfigure.cache.HazelcastCacheConfiguration

    org.springframework.boot.autoconfigure.cache.InfinispanCacheConfiguration

    org.springframework.boot.autoconfigure.cache.CouchbaseCacheConfiguration

    org.springframework.boot.autoconfigure.cache.RedisCacheConfiguration

    org.springframework.boot.autoconfigure.cache.CaffeineCacheConfiguration

    org.springframework.boot.autoconfigure.cache.SimpleCacheConfiguration

    org.springframework.boot.autoconfigure.cache.NoOpCacheConfiguration

    导入了10个CacheConfiguration 导入10 中缓存的配置,说明springboot 会自动的配置这10 中缓存

    下面我们就看下他默认使用的是什么缓存

    吧springboot 调成debug 模式,这样就可以显示在启动的时候自动配置类的情况

    我们看日志

    1.  
      ============================
    2.  
      CONDITIONS EVALUATION REPORT
    3.  
      ============================
    4.  
       
    5.  
      积极的匹配
    6.  
      Positive matches:
    7.  
      -----------------
    8.  
       
    9.  
      CacheAutoConfiguration matched:
    10.  
      - @ConditionalOnClass found required class 'org.springframework.cache.CacheManager'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    11.  
      - @ConditionalOnBean (types: org.springframework.cache.interceptor.CacheAspectSupport; SearchStrategy: all) found bean 'cacheInterceptor'; @ConditionalOnMissingBean (names: cacheResolver; types: org.springframework.cache.CacheManager; SearchStrategy: all) did not find any beans (OnBeanCondition)
    12.  
       
    13.  
      CacheAutoConfiguration#cacheManagerCustomizers matched:
    14.  
      - @ConditionalOnMissingBean (types: org.springframework.boot.autoconfigure.cache.CacheManagerCustomizers; SearchStrategy: all) did not find any beans (OnBeanCondition)
    15.  
       
    16.  
      CodecsAutoConfiguration matched:
    17.  
      - @ConditionalOnClass found required class 'org.springframework.http.codec.CodecConfigurer'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    18.  
       
    19.  
      CodecsAutoConfiguration.JacksonCodecConfiguration matched:
    20.  
      - @ConditionalOnClass found required class 'com.fasterxml.jackson.databind.ObjectMapper'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    21.  
       
    22.  
      CodecsAutoConfiguration.JacksonCodecConfiguration#jacksonCodecCustomizer matched:
    23.  
      - @ConditionalOnBean (types: com.fasterxml.jackson.databind.ObjectMapper; SearchStrategy: all) found bean 'jacksonObjectMapper' (OnBeanCondition)
    24.  
       
    25.  
      DataSourceAutoConfiguration matched:
    26.  
      - @ConditionalOnClass found required classes 'javax.sql.DataSource', 'org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    27.  
       
    28.  
      DataSourceAutoConfiguration.PooledDataSourceConfiguration matched:
    29.  
      - AnyNestedCondition 1 matched 1 did not; NestedCondition on DataSourceAutoConfiguration.PooledDataSourceCondition.PooledDataSourceAvailable PooledDataSource found supported DataSource; NestedCondition on DataSourceAutoConfiguration.PooledDataSourceCondition.ExplicitType @ConditionalOnProperty (spring.datasource.type) did not find property 'type' (DataSourceAutoConfiguration.PooledDataSourceCondition)
    30.  
      - @ConditionalOnMissingBean (types: javax.sql.DataSource,javax.sql.XADataSource; SearchStrategy: all) did not find any beans (OnBeanCondition)
    31.  
       
    32.  
      DataSourceConfiguration.Hikari matched:
    33.  
      - @ConditionalOnClass found required class 'com.zaxxer.hikari.HikariDataSource'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    34.  
      - @ConditionalOnProperty (spring.datasource.type=com.zaxxer.hikari.HikariDataSource) matched (OnPropertyCondition)
    35.  
      - @ConditionalOnMissingBean (types: javax.sql.DataSource; SearchStrategy: all) did not find any beans (OnBeanCondition)
    36.  
       
    37.  
      DataSourceJmxConfiguration matched:
    38.  
      - @ConditionalOnProperty (spring.jmx.enabled=true) matched (OnPropertyCondition)
    39.  
       
    40.  
      DataSourceJmxConfiguration.Hikari matched:
    41.  
      - @ConditionalOnClass found required class 'com.zaxxer.hikari.HikariDataSource'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    42.  
      - @ConditionalOnSingleCandidate (types: javax.sql.DataSource; SearchStrategy: all) found a primary bean from beans 'dataSource' (OnBeanCondition)
    43.  
       
    44.  
      DataSourcePoolMetadataProvidersConfiguration.HikariPoolDataSourceMetadataProviderConfiguration matched:
    45.  
      - @ConditionalOnClass found required class 'com.zaxxer.hikari.HikariDataSource'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    46.  
       
    47.  
      DataSourceTransactionManagerAutoConfiguration matched:
    48.  
      - @ConditionalOnClass found required classes 'org.springframework.jdbc.core.JdbcTemplate', 'org.springframework.transaction.PlatformTransactionManager'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    49.  
       
    50.  
      DataSourceTransactionManagerAutoConfiguration.DataSourceTransactionManagerConfiguration matched:
    51.  
      - @ConditionalOnSingleCandidate (types: javax.sql.DataSource; SearchStrategy: all) found a primary bean from beans 'dataSource' (OnBeanCondition)
    52.  
       
    53.  
      DataSourceTransactionManagerAutoConfiguration.DataSourceTransactionManagerConfiguration#transactionManager matched:
    54.  
      - @ConditionalOnMissingBean (types: org.springframework.transaction.PlatformTransactionManager; SearchStrategy: all) did not find any beans (OnBeanCondition)
    55.  
       
    56.  
      DevToolsDataSourceAutoConfiguration matched:
    57.  
      - DevTools DataSource Condition found auto-configured DataSource (DevToolsDataSourceAutoConfiguration.DevToolsDataSourceCondition)
    58.  
       
    59.  
      DispatcherServletAutoConfiguration matched:
    60.  
      - @ConditionalOnClass found required class 'org.springframework.web.servlet.DispatcherServlet'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    61.  
      - found ConfigurableWebEnvironment (OnWebApplicationCondition)
    62.  
       
    63.  
      DispatcherServletAutoConfiguration.DispatcherServletConfiguration matched:
    64.  
      - @ConditionalOnClass found required class 'javax.servlet.ServletRegistration'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    65.  
      - Default DispatcherServlet did not find dispatcher servlet beans (DispatcherServletAutoConfiguration.DefaultDispatcherServletCondition)
    66.  
       
    67.  
      DispatcherServletAutoConfiguration.DispatcherServletRegistrationConfiguration matched:
    68.  
      - @ConditionalOnClass found required class 'javax.servlet.ServletRegistration'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    69.  
      - DispatcherServlet Registration did not find servlet registration bean (DispatcherServletAutoConfiguration.DispatcherServletRegistrationCondition)
    70.  
       
    71.  
      DispatcherServletAutoConfiguration.DispatcherServletRegistrationConfiguration#dispatcherServletRegistration matched:
    72.  
      - @ConditionalOnBean (names: dispatcherServlet; types: org.springframework.web.servlet.DispatcherServlet; SearchStrategy: all) found bean 'dispatcherServlet' (OnBeanCondition)
    73.  
       
    74.  
      EmbeddedWebServerFactoryCustomizerAutoConfiguration.TomcatWebServerFactoryCustomizerConfiguration matched:
    75.  
      - @ConditionalOnClass found required classes 'org.apache.catalina.startup.Tomcat', 'org.apache.coyote.UpgradeProtocol'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    76.  
       
    77.  
      ErrorMvcAutoConfiguration matched:
    78.  
      - @ConditionalOnClass found required classes 'javax.servlet.Servlet', 'org.springframework.web.servlet.DispatcherServlet'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    79.  
      - found ConfigurableWebEnvironment (OnWebApplicationCondition)
    80.  
       
    81.  
      ErrorMvcAutoConfiguration#basicErrorController matched:
    82.  
      - @ConditionalOnMissingBean (types: org.springframework.boot.web.servlet.error.ErrorController; SearchStrategy: current) did not find any beans (OnBeanCondition)
    83.  
       
    84.  
      ErrorMvcAutoConfiguration#errorAttributes matched:
    85.  
      - @ConditionalOnMissingBean (types: org.springframework.boot.web.servlet.error.ErrorAttributes; SearchStrategy: current) did not find any beans (OnBeanCondition)
    86.  
       
    87.  
      ErrorMvcAutoConfiguration.DefaultErrorViewResolverConfiguration#conventionErrorViewResolver matched:
    88.  
      - @ConditionalOnBean (types: org.springframework.web.servlet.DispatcherServlet; SearchStrategy: all) found bean 'dispatcherServlet'; @ConditionalOnMissingBean (types: org.springframework.boot.autoconfigure.web.servlet.error.DefaultErrorViewResolver; SearchStrategy: all) did not find any beans (OnBeanCondition)
    89.  
       
    90.  
      ErrorMvcAutoConfiguration.WhitelabelErrorViewConfiguration matched:
    91.  
      - @ConditionalOnProperty (server.error.whitelabel.enabled) matched (OnPropertyCondition)
    92.  
      - ErrorTemplate Missing did not find error template view (ErrorMvcAutoConfiguration.ErrorTemplateMissingCondition)
    93.  
       
    94.  
      ErrorMvcAutoConfiguration.WhitelabelErrorViewConfiguration#beanNameViewResolver matched:
    95.  
      - @ConditionalOnMissingBean (types: org.springframework.web.servlet.view.BeanNameViewResolver; SearchStrategy: all) did not find any beans (OnBeanCondition)
    96.  
       
    97.  
      ErrorMvcAutoConfiguration.WhitelabelErrorViewConfiguration#defaultErrorView matched:
    98.  
      - @ConditionalOnMissingBean (names: error; SearchStrategy: all) did not find any beans (OnBeanCondition)
    99.  
       
    100.  
      HttpEncodingAutoConfiguration matched:
    101.  
      - @ConditionalOnClass found required class 'org.springframework.web.filter.CharacterEncodingFilter'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    102.  
      - found ConfigurableWebEnvironment (OnWebApplicationCondition)
    103.  
      - @ConditionalOnProperty (spring.http.encoding.enabled) matched (OnPropertyCondition)
    104.  
       
    105.  
      HttpEncodingAutoConfiguration#characterEncodingFilter matched:
    106.  
      - @ConditionalOnMissingBean (types: org.springframework.web.filter.CharacterEncodingFilter; SearchStrategy: all) did not find any beans (OnBeanCondition)
    107.  
       
    108.  
      HttpMessageConvertersAutoConfiguration matched:
    109.  
      - @ConditionalOnClass found required class 'org.springframework.http.converter.HttpMessageConverter'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    110.  
       
    111.  
      HttpMessageConvertersAutoConfiguration#messageConverters matched:
    112.  
      - @ConditionalOnMissingBean (types: org.springframework.boot.autoconfigure.http.HttpMessageConverters; SearchStrategy: all) did not find any beans (OnBeanCondition)
    113.  
       
    114.  
      HttpMessageConvertersAutoConfiguration.StringHttpMessageConverterConfiguration matched:
    115.  
      - @ConditionalOnClass found required class 'org.springframework.http.converter.StringHttpMessageConverter'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    116.  
       
    117.  
      HttpMessageConvertersAutoConfiguration.StringHttpMessageConverterConfiguration#stringHttpMessageConverter matched:
    118.  
      - @ConditionalOnMissingBean (types: org.springframework.http.converter.StringHttpMessageConverter; SearchStrategy: all) did not find any beans (OnBeanCondition)
    119.  
       
    120.  
      JacksonAutoConfiguration matched:
    121.  
      - @ConditionalOnClass found required class 'com.fasterxml.jackson.databind.ObjectMapper'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    122.  
       
    123.  
      JacksonAutoConfiguration.Jackson2ObjectMapperBuilderCustomizerConfiguration matched:
    124.  
      - @ConditionalOnClass found required class 'org.springframework.http.converter.json.Jackson2ObjectMapperBuilder'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    125.  
       
    126.  
      JacksonAutoConfiguration.JacksonObjectMapperBuilderConfiguration matched:
    127.  
      - @ConditionalOnClass found required class 'org.springframework.http.converter.json.Jackson2ObjectMapperBuilder'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    128.  
       
    129.  
      JacksonAutoConfiguration.JacksonObjectMapperBuilderConfiguration#jacksonObjectMapperBuilder matched:
    130.  
      - @ConditionalOnMissingBean (types: org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; SearchStrategy: all) did not find any beans (OnBeanCondition)
    131.  
       
    132.  
      JacksonAutoConfiguration.JacksonObjectMapperConfiguration matched:
    133.  
      - @ConditionalOnClass found required class 'org.springframework.http.converter.json.Jackson2ObjectMapperBuilder'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    134.  
       
    135.  
      JacksonAutoConfiguration.JacksonObjectMapperConfiguration#jacksonObjectMapper matched:
    136.  
      - @ConditionalOnMissingBean (types: com.fasterxml.jackson.databind.ObjectMapper; SearchStrategy: all) did not find any beans (OnBeanCondition)
    137.  
       
    138.  
      JacksonAutoConfiguration.ParameterNamesModuleConfiguration matched:
    139.  
      - @ConditionalOnClass found required class 'com.fasterxml.jackson.module.paramnames.ParameterNamesModule'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    140.  
       
    141.  
      JacksonAutoConfiguration.ParameterNamesModuleConfiguration#parameterNamesModule matched:
    142.  
      - @ConditionalOnMissingBean (types: com.fasterxml.jackson.module.paramnames.ParameterNamesModule; SearchStrategy: all) did not find any beans (OnBeanCondition)
    143.  
       
    144.  
      JacksonHttpMessageConvertersConfiguration.MappingJackson2HttpMessageConverterConfiguration matched:
    145.  
      - @ConditionalOnClass found required class 'com.fasterxml.jackson.databind.ObjectMapper'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    146.  
      - @ConditionalOnProperty (spring.http.converters.preferred-json-mapper=jackson) matched (OnPropertyCondition)
    147.  
      - @ConditionalOnBean (types: com.fasterxml.jackson.databind.ObjectMapper; SearchStrategy: all) found bean 'jacksonObjectMapper' (OnBeanCondition)
    148.  
       
    149.  
      JacksonHttpMessageConvertersConfiguration.MappingJackson2HttpMessageConverterConfiguration#mappingJackson2HttpMessageConverter matched:
    150.  
      - @ConditionalOnMissingBean (types: org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; SearchStrategy: all) did not find any beans (OnBeanCondition)
    151.  
       
    152.  
      JdbcTemplateAutoConfiguration matched:
    153.  
      - @ConditionalOnClass found required classes 'javax.sql.DataSource', 'org.springframework.jdbc.core.JdbcTemplate'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    154.  
      - @ConditionalOnSingleCandidate (types: javax.sql.DataSource; SearchStrategy: all) found a primary bean from beans 'dataSource' (OnBeanCondition)
    155.  
       
    156.  
      JdbcTemplateAutoConfiguration.JdbcTemplateConfiguration#jdbcTemplate matched:
    157.  
      - @ConditionalOnMissingBean (types: org.springframework.jdbc.core.JdbcOperations; SearchStrategy: all) did not find any beans (OnBeanCondition)
    158.  
       
    159.  
      JdbcTemplateAutoConfiguration.NamedParameterJdbcTemplateConfiguration#namedParameterJdbcTemplate matched:
    160.  
      - @ConditionalOnSingleCandidate (types: org.springframework.jdbc.core.JdbcTemplate; SearchStrategy: all) found a primary bean from beans 'jdbcTemplate'; @ConditionalOnMissingBean (types: org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations; SearchStrategy: all) did not find any beans (OnBeanCondition)
    161.  
       
    162.  
      JmxAutoConfiguration matched:
    163.  
      - @ConditionalOnClass found required class 'org.springframework.jmx.export.MBeanExporter'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    164.  
      - @ConditionalOnProperty (spring.jmx.enabled=true) matched (OnPropertyCondition)
    165.  
       
    166.  
      JmxAutoConfiguration#mbeanExporter matched:
    167.  
      - @ConditionalOnMissingBean (types: org.springframework.jmx.export.MBeanExporter; SearchStrategy: current) did not find any beans (OnBeanCondition)
    168.  
       
    169.  
      JmxAutoConfiguration#mbeanServer matched:
    170.  
      - @ConditionalOnMissingBean (types: javax.management.MBeanServer; SearchStrategy: all) did not find any beans (OnBeanCondition)
    171.  
       
    172.  
      JmxAutoConfiguration#objectNamingStrategy matched:
    173.  
      - @ConditionalOnMissingBean (types: org.springframework.jmx.export.naming.ObjectNamingStrategy; SearchStrategy: current) did not find any beans (OnBeanCondition)
    174.  
       
    175.  
      LocalDevToolsAutoConfiguration matched:
    176.  
      - Initialized Restarter Condition available and initialized (OnInitializedRestarterCondition)
    177.  
       
    178.  
      LocalDevToolsAutoConfiguration.LiveReloadConfiguration matched:
    179.  
      - @ConditionalOnProperty (spring.devtools.livereload.enabled) matched (OnPropertyCondition)
    180.  
       
    181.  
      LocalDevToolsAutoConfiguration.LiveReloadConfiguration#liveReloadServer matched:
    182.  
      - @ConditionalOnMissingBean (types: org.springframework.boot.devtools.livereload.LiveReloadServer; SearchStrategy: all) did not find any beans (OnBeanCondition)
    183.  
       
    184.  
      LocalDevToolsAutoConfiguration.RestartConfiguration matched:
    185.  
      - @ConditionalOnProperty (spring.devtools.restart.enabled) matched (OnPropertyCondition)
    186.  
       
    187.  
      LocalDevToolsAutoConfiguration.RestartConfiguration#classPathFileSystemWatcher matched:
    188.  
      - @ConditionalOnMissingBean (types: org.springframework.boot.devtools.classpath.ClassPathFileSystemWatcher; SearchStrategy: all) did not find any beans (OnBeanCondition)
    189.  
       
    190.  
      LocalDevToolsAutoConfiguration.RestartConfiguration#classPathRestartStrategy matched:
    191.  
      - @ConditionalOnMissingBean (types: org.springframework.boot.devtools.classpath.ClassPathRestartStrategy; SearchStrategy: all) did not find any beans (OnBeanCondition)
    192.  
       
    193.  
      LocalDevToolsAutoConfiguration.RestartConfiguration#conditionEvaluationDeltaLoggingListener matched:
    194.  
      - @ConditionalOnProperty (spring.devtools.restart.log-condition-evaluation-delta) matched (OnPropertyCondition)
    195.  
       
    196.  
      MultipartAutoConfiguration matched:
    197.  
      - @ConditionalOnClass found required classes 'javax.servlet.Servlet', 'org.springframework.web.multipart.support.StandardServletMultipartResolver', 'javax.servlet.MultipartConfigElement'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    198.  
      - found ConfigurableWebEnvironment (OnWebApplicationCondition)
    199.  
      - @ConditionalOnProperty (spring.servlet.multipart.enabled) matched (OnPropertyCondition)
    200.  
       
    201.  
      MultipartAutoConfiguration#multipartConfigElement matched:
    202.  
      - @ConditionalOnMissingBean (types: javax.servlet.MultipartConfigElement,org.springframework.web.multipart.commons.CommonsMultipartResolver; SearchStrategy: all) did not find any beans (OnBeanCondition)
    203.  
       
    204.  
      MultipartAutoConfiguration#multipartResolver matched:
    205.  
      - @ConditionalOnMissingBean (types: org.springframework.web.multipart.MultipartResolver; SearchStrategy: all) did not find any beans (OnBeanCondition)
    206.  
       
    207.  
      MybatisAutoConfiguration matched:
    208.  
      - @ConditionalOnClass found required classes 'org.apache.ibatis.session.SqlSessionFactory', 'org.mybatis.spring.SqlSessionFactoryBean'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    209.  
      - @ConditionalOnBean (types: javax.sql.DataSource; SearchStrategy: all) found bean 'dataSource' (OnBeanCondition)
    210.  
       
    211.  
      MybatisAutoConfiguration#sqlSessionFactory matched:
    212.  
      - @ConditionalOnMissingBean (types: org.apache.ibatis.session.SqlSessionFactory; SearchStrategy: all) did not find any beans (OnBeanCondition)
    213.  
       
    214.  
      MybatisAutoConfiguration#sqlSessionTemplate matched:
    215.  
      - @ConditionalOnMissingBean (types: org.mybatis.spring.SqlSessionTemplate; SearchStrategy: all) did not find any beans (OnBeanCondition)
    216.  
       
    217.  
      PersistenceExceptionTranslationAutoConfiguration matched:
    218.  
      - @ConditionalOnClass found required class 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    219.  
       
    220.  
      PersistenceExceptionTranslationAutoConfiguration#persistenceExceptionTranslationPostProcessor matched:
    221.  
      - @ConditionalOnProperty (spring.dao.exceptiontranslation.enabled) matched (OnPropertyCondition)
    222.  
      - @ConditionalOnMissingBean (types: org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor; SearchStrategy: all) did not find any beans (OnBeanCondition)
    223.  
       
    224.  
      PropertyPlaceholderAutoConfiguration#propertySourcesPlaceholderConfigurer matched:
    225.  
      - @ConditionalOnMissingBean (types: org.springframework.context.support.PropertySourcesPlaceholderConfigurer; SearchStrategy: current) did not find any beans (OnBeanCondition)
    226.  
       
    227.  
      RestTemplateAutoConfiguration matched:
    228.  
      - @ConditionalOnClass found required class 'org.springframework.web.client.RestTemplate'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    229.  
       
    230.  
      RestTemplateAutoConfiguration#restTemplateBuilder matched:
    231.  
      - @ConditionalOnMissingBean (types: org.springframework.boot.web.client.RestTemplateBuilder; SearchStrategy: all) did not find any beans (OnBeanCondition)
    232.  
       
    233.  
      ServletWebServerFactoryAutoConfiguration matched:
    234.  
      - @ConditionalOnClass found required class 'javax.servlet.ServletRequest'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    235.  
      - found ConfigurableWebEnvironment (OnWebApplicationCondition)
    236.  
       
    237.  
      ServletWebServerFactoryAutoConfiguration#tomcatServletWebServerFactoryCustomizer matched:
    238.  
      - @ConditionalOnClass found required class 'org.apache.catalina.startup.Tomcat'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    239.  
       
    240.  
      ServletWebServerFactoryConfiguration.EmbeddedTomcat matched:
    241.  
      - @ConditionalOnClass found required classes 'javax.servlet.Servlet', 'org.apache.catalina.startup.Tomcat', 'org.apache.coyote.UpgradeProtocol'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    242.  
      - @ConditionalOnMissingBean (types: org.springframework.boot.web.servlet.server.ServletWebServerFactory; SearchStrategy: current) did not find any beans (OnBeanCondition)
    243.  
       
    244.  
      SimpleCacheConfiguration matched:
    245.  
      - Cache org.springframework.boot.autoconfigure.cache.SimpleCacheConfiguration automatic cache type (CacheCondition)
    246.  
      - @ConditionalOnMissingBean (types: org.springframework.cache.CacheManager; SearchStrategy: all) did not find any beans (OnBeanCondition)
    247.  
       
    248.  
      SpringApplicationAdminJmxAutoConfiguration matched:
    249.  
      - @ConditionalOnProperty (spring.application.admin.enabled=true) matched (OnPropertyCondition)
    250.  
       
    251.  
      SpringApplicationAdminJmxAutoConfiguration#springApplicationAdminRegistrar matched:
    252.  
      - @ConditionalOnMissingBean (types: org.springframework.boot.admin.SpringApplicationAdminMXBeanRegistrar; SearchStrategy: all) did not find any beans (OnBeanCondition)
    253.  
       
    254.  
      TransactionAutoConfiguration matched:
    255.  
      - @ConditionalOnClass found required class 'org.springframework.transaction.PlatformTransactionManager'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    256.  
       
    257.  
      TransactionAutoConfiguration#platformTransactionManagerCustomizers matched:
    258.  
      - @ConditionalOnMissingBean (types: org.springframework.boot.autoconfigure.transaction.TransactionManagerCustomizers; SearchStrategy: all) did not find any beans (OnBeanCondition)
    259.  
       
    260.  
      TransactionAutoConfiguration.EnableTransactionManagementConfiguration matched:
    261.  
      - @ConditionalOnBean (types: org.springframework.transaction.PlatformTransactionManager; SearchStrategy: all) found bean 'transactionManager'; @ConditionalOnMissingBean (types: org.springframework.transaction.annotation.AbstractTransactionManagementConfiguration; SearchStrategy: all) did not find any beans (OnBeanCondition)
    262.  
       
    263.  
      TransactionAutoConfiguration.EnableTransactionManagementConfiguration.CglibAutoProxyConfiguration matched:
    264.  
      - @ConditionalOnProperty (spring.aop.proxy-target-class=true) matched (OnPropertyCondition)
    265.  
       
    266.  
      TransactionAutoConfiguration.TransactionTemplateConfiguration matched:
    267.  
      - @ConditionalOnSingleCandidate (types: org.springframework.transaction.PlatformTransactionManager; SearchStrategy: all) found a primary bean from beans 'transactionManager' (OnBeanCondition)
    268.  
       
    269.  
      TransactionAutoConfiguration.TransactionTemplateConfiguration#transactionTemplate matched:
    270.  
      - @ConditionalOnMissingBean (types: org.springframework.transaction.support.TransactionTemplate; SearchStrategy: all) did not find any beans (OnBeanCondition)
    271.  
       
    272.  
      ValidationAutoConfiguration matched:
    273.  
      - @ConditionalOnClass found required class 'javax.validation.executable.ExecutableValidator'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    274.  
      - @ConditionalOnResource found location classpath:META-INF/services/javax.validation.spi.ValidationProvider (OnResourceCondition)
    275.  
       
    276.  
      ValidationAutoConfiguration#defaultValidator matched:
    277.  
      - @ConditionalOnMissingBean (types: javax.validation.Validator; SearchStrategy: all) did not find any beans (OnBeanCondition)
    278.  
       
    279.  
      ValidationAutoConfiguration#methodValidationPostProcessor matched:
    280.  
      - @ConditionalOnMissingBean (types: org.springframework.validation.beanvalidation.MethodValidationPostProcessor; SearchStrategy: all) did not find any beans (OnBeanCondition)
    281.  
       
    282.  
      WebMvcAutoConfiguration matched:
    283.  
      - @ConditionalOnClass found required classes 'javax.servlet.Servlet', 'org.springframework.web.servlet.DispatcherServlet', 'org.springframework.web.servlet.config.annotation.WebMvcConfigurer'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    284.  
      - found ConfigurableWebEnvironment (OnWebApplicationCondition)
    285.  
      - @ConditionalOnMissingBean (types: org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; SearchStrategy: all) did not find any beans (OnBeanCondition)
    286.  
       
    287.  
      WebMvcAutoConfiguration#hiddenHttpMethodFilter matched:
    288.  
      - @ConditionalOnMissingBean (types: org.springframework.web.filter.HiddenHttpMethodFilter; SearchStrategy: all) did not find any beans (OnBeanCondition)
    289.  
       
    290.  
      WebMvcAutoConfiguration#httpPutFormContentFilter matched:
    291.  
      - @ConditionalOnProperty (spring.mvc.formcontent.putfilter.enabled) matched (OnPropertyCondition)
    292.  
      - @ConditionalOnMissingBean (types: org.springframework.web.filter.HttpPutFormContentFilter; SearchStrategy: all) did not find any beans (OnBeanCondition)
    293.  
       
    294.  
      WebMvcAutoConfiguration.WebMvcAutoConfigurationAdapter#defaultViewResolver matched:
    295.  
      - @ConditionalOnMissingBean (types: org.springframework.web.servlet.view.InternalResourceViewResolver; SearchStrategy: all) did not find any beans (OnBeanCondition)
    296.  
       
    297.  
      WebMvcAutoConfiguration.WebMvcAutoConfigurationAdapter#requestContextFilter matched:
    298.  
      - @ConditionalOnMissingBean (types: org.springframework.web.context.request.RequestContextListener,org.springframework.web.filter.RequestContextFilter; SearchStrategy: all) did not find any beans (OnBeanCondition)
    299.  
       
    300.  
      WebMvcAutoConfiguration.WebMvcAutoConfigurationAdapter#viewResolver matched:
    301.  
      - @ConditionalOnBean (types: org.springframework.web.servlet.ViewResolver; SearchStrategy: all) found beans 'defaultViewResolver', 'beanNameViewResolver', 'mvcViewResolver'; @ConditionalOnMissingBean (names: viewResolver; types: org.springframework.web.servlet.view.ContentNegotiatingViewResolver; SearchStrategy: all) did not find any beans (OnBeanCondition)
    302.  
       
    303.  
      WebMvcAutoConfiguration.WebMvcAutoConfigurationAdapter.FaviconConfiguration matched:
    304.  
      - @ConditionalOnProperty (spring.mvc.favicon.enabled) matched (OnPropertyCondition)
    305.  
       
    306.  
      WebSocketServletAutoConfiguration matched:
    307.  
      - @ConditionalOnClass found required classes 'javax.servlet.Servlet', 'javax.websocket.server.ServerContainer'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    308.  
      - found ConfigurableWebEnvironment (OnWebApplicationCondition)
    309.  
       
    310.  
      WebSocketServletAutoConfiguration.TomcatWebSocketConfiguration matched:
    311.  
      - @ConditionalOnClass found required classes 'org.apache.catalina.startup.Tomcat', 'org.apache.tomcat.websocket.server.WsSci'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    312.  
       
    313.  
      WebSocketServletAutoConfiguration.TomcatWebSocketConfiguration#websocketContainerCustomizer matched:
    314.  
      - @ConditionalOnMissingBean (names: websocketServletWebServerCustomizer; SearchStrategy: all) did not find any beans (OnBeanCondition)
    315.  
       
    316.  
      消极的匹配
    317.  
      Negative matches:
    318.  
      -----------------
    319.  
       
    320.  
      ActiveMQAutoConfiguration:
    321.  
      Did not match:
    322.  
      - @ConditionalOnClass did not find required classes 'javax.jms.ConnectionFactory', 'org.apache.activemq.ActiveMQConnectionFactory' (OnClassCondition)
    323.  
       
    324.  
      AopAutoConfiguration:
    325.  
      Did not match:
    326.  
      - @ConditionalOnClass did not find required classes 'org.aspectj.lang.annotation.Aspect', 'org.aspectj.lang.reflect.Advice', 'org.aspectj.weaver.AnnotatedElement' (OnClassCondition)
    327.  
       
    328.  
      ArtemisAutoConfiguration:
    329.  
      Did not match:
    330.  
      - @ConditionalOnClass did not find required classes 'javax.jms.ConnectionFactory', 'org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory' (OnClassCondition)
    331.  
       
    332.  
      BatchAutoConfiguration:
    333.  
      Did not match:
    334.  
      - @ConditionalOnClass did not find required class 'org.springframework.batch.core.launch.JobLauncher' (OnClassCondition)
    335.  
       
    336.  
      CacheAutoConfiguration.CacheManagerJpaDependencyConfiguration:
    337.  
      Did not match:
    338.  
      - @ConditionalOnClass did not find required class 'org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean' (OnClassCondition)
    339.  
       
    340.  
      CaffeineCacheConfiguration:
    341.  
      Did not match:
    342.  
      - @ConditionalOnClass did not find required class 'com.github.benmanes.caffeine.cache.Caffeine' (OnClassCondition)
    343.  
       
    344.  
      CassandraAutoConfiguration:
    345.  
      Did not match:
    346.  
      - @ConditionalOnClass did not find required class 'com.datastax.driver.core.Cluster' (OnClassCondition)
    347.  
       
    348.  
      CassandraDataAutoConfiguration:
    349.  
      Did not match:
    350.  
      - @ConditionalOnClass did not find required classes 'com.datastax.driver.core.Cluster', 'org.springframework.data.cassandra.core.CassandraAdminOperations' (OnClassCondition)
    351.  
       
    352.  
      CassandraReactiveDataAutoConfiguration:
    353.  
      Did not match:
    354.  
      - @ConditionalOnClass did not find required classes 'com.datastax.driver.core.Cluster', 'org.springframework.data.cassandra.core.ReactiveCassandraTemplate', 'reactor.core.publisher.Flux' (OnClassCondition)
    355.  
       
    356.  
      CassandraReactiveRepositoriesAutoConfiguration:
    357.  
      Did not match:
    358.  
      - @ConditionalOnClass did not find required classes 'org.springframework.data.cassandra.ReactiveSession', 'org.springframework.data.cassandra.repository.ReactiveCassandraRepository' (OnClassCondition)
    359.  
       
    360.  
      CassandraRepositoriesAutoConfiguration:
    361.  
      Did not match:
    362.  
      - @ConditionalOnClass did not find required classes 'com.datastax.driver.core.Session', 'org.springframework.data.cassandra.repository.CassandraRepository' (OnClassCondition)
    363.  
       
    364.  
      CloudAutoConfiguration:
    365.  
      Did not match:
    366.  
      - @ConditionalOnClass did not find required class 'org.springframework.cloud.config.java.CloudScanConfiguration' (OnClassCondition)
    367.  
       
    368.  
      CouchbaseAutoConfiguration:
    369.  
      Did not match:
    370.  
      - @ConditionalOnClass did not find required classes 'com.couchbase.client.java.CouchbaseBucket', 'com.couchbase.client.java.Cluster' (OnClassCondition)
    371.  
       
    372.  
      CouchbaseCacheConfiguration:
    373.  
      Did not match:
    374.  
      - @ConditionalOnClass did not find required classes 'com.couchbase.client.java.Bucket', 'com.couchbase.client.spring.cache.CouchbaseCacheManager' (OnClassCondition)
    375.  
       
    376.  
      CouchbaseDataAutoConfiguration:
    377.  
      Did not match:
    378.  
      - @ConditionalOnClass did not find required classes 'com.couchbase.client.java.Bucket', 'org.springframework.data.couchbase.repository.CouchbaseRepository' (OnClassCondition)
    379.  
       
    380.  
      CouchbaseReactiveDataAutoConfiguration:
    381.  
      Did not match:
    382.  
      - @ConditionalOnClass did not find required classes 'com.couchbase.client.java.Bucket', 'org.springframework.data.couchbase.repository.ReactiveCouchbaseRepository', 'reactor.core.publisher.Flux' (OnClassCondition)
    383.  
       
    384.  
      CouchbaseReactiveRepositoriesAutoConfiguration:
    385.  
      Did not match:
    386.  
      - @ConditionalOnClass did not find required classes 'com.couchbase.client.java.Bucket', 'org.springframework.data.couchbase.repository.ReactiveCouchbaseRepository', 'reactor.core.publisher.Flux' (OnClassCondition)
    387.  
       
    388.  
      CouchbaseRepositoriesAutoConfiguration:
    389.  
      Did not match:
    390.  
      - @ConditionalOnClass did not find required classes 'com.couchbase.client.java.Bucket', 'org.springframework.data.couchbase.repository.CouchbaseRepository' (OnClassCondition)
    391.  
       
    392.  
      DataSourceAutoConfiguration.EmbeddedDatabaseConfiguration:
    393.  
      Did not match:
    394.  
      - EmbeddedDataSource found supported pooled data source (DataSourceAutoConfiguration.EmbeddedDatabaseCondition)
    395.  
       
    396.  
      DataSourceConfiguration.Dbcp2:
    397.  
      Did not match:
    398.  
      - @ConditionalOnClass did not find required class 'org.apache.commons.dbcp2.BasicDataSource' (OnClassCondition)
    399.  
       
    400.  
      DataSourceConfiguration.Generic:
    401.  
      Did not match:
    402.  
      - @ConditionalOnProperty (spring.datasource.type) did not find property 'spring.datasource.type' (OnPropertyCondition)
    403.  
       
    404.  
      DataSourceConfiguration.Tomcat:
    405.  
      Did not match:
    406.  
      - @ConditionalOnClass did not find required class 'org.apache.tomcat.jdbc.pool.DataSource' (OnClassCondition)
    407.  
       
    408.  
      DataSourceJmxConfiguration.TomcatDataSourceJmxConfiguration:
    409.  
      Did not match:
    410.  
      - @ConditionalOnClass did not find required class 'org.apache.tomcat.jdbc.pool.DataSourceProxy' (OnClassCondition)
    411.  
       
    412.  
      DataSourcePoolMetadataProvidersConfiguration.CommonsDbcp2PoolDataSourceMetadataProviderConfiguration:
    413.  
      Did not match:
    414.  
      - @ConditionalOnClass did not find required class 'org.apache.commons.dbcp2.BasicDataSource' (OnClassCondition)
    415.  
       
    416.  
      DataSourcePoolMetadataProvidersConfiguration.TomcatDataSourcePoolMetadataProviderConfiguration:
    417.  
      Did not match:
    418.  
      - @ConditionalOnClass did not find required class 'org.apache.tomcat.jdbc.pool.DataSource' (OnClassCondition)
    419.  
       
    420.  
      DevToolsDataSourceAutoConfiguration.DatabaseShutdownExecutorJpaDependencyConfiguration:
    421.  
      Did not match:
    422.  
      - @ConditionalOnClass did not find required class 'org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean' (OnClassCondition)
    423.  
       
    424.  
      DispatcherServletAutoConfiguration.DispatcherServletConfiguration#multipartResolver:
    425.  
      Did not match:
    426.  
      - @ConditionalOnBean (types: org.springframework.web.multipart.MultipartResolver; SearchStrategy: all) did not find any beans of type org.springframework.web.multipart.MultipartResolver (OnBeanCondition)
    427.  
       
    428.  
      EhCacheCacheConfiguration:
    429.  
      Did not match:
    430.  
      - @ConditionalOnClass did not find required class 'net.sf.ehcache.Cache' (OnClassCondition)
    431.  
       
    432.  
      ElasticsearchAutoConfiguration:
    433.  
      Did not match:
    434.  
      - @ConditionalOnClass did not find required classes 'org.elasticsearch.client.Client', 'org.springframework.data.elasticsearch.client.TransportClientFactoryBean' (OnClassCondition)
    435.  
       
    436.  
      ElasticsearchDataAutoConfiguration:
    437.  
      Did not match:
    438.  
      - @ConditionalOnClass did not find required classes 'org.elasticsearch.client.Client', 'org.springframework.data.elasticsearch.core.ElasticsearchTemplate' (OnClassCondition)
    439.  
       
    440.  
      ElasticsearchRepositoriesAutoConfiguration:
    441.  
      Did not match:
    442.  
      - @ConditionalOnClass did not find required classes 'org.elasticsearch.client.Client', 'org.springframework.data.elasticsearch.repository.ElasticsearchRepository' (OnClassCondition)
    443.  
       
    444.  
      EmbeddedLdapAutoConfiguration:
    445.  
      Did not match:
    446.  
      - @ConditionalOnClass did not find required class 'com.unboundid.ldap.listener.InMemoryDirectoryServer' (OnClassCondition)
    447.  
       
    448.  
      EmbeddedMongoAutoConfiguration:
    449.  
      Did not match:
    450.  
      - @ConditionalOnClass did not find required classes 'com.mongodb.MongoClient', 'de.flapdoodle.embed.mongo.MongodStarter' (OnClassCondition)
    451.  
       
    452.  
      EmbeddedWebServerFactoryCustomizerAutoConfiguration.JettyWebServerFactoryCustomizerConfiguration:
    453.  
      Did not match:
    454.  
      - @ConditionalOnClass did not find required classes 'org.eclipse.jetty.server.Server', 'org.eclipse.jetty.util.Loader', 'org.eclipse.jetty.webapp.WebAppContext' (OnClassCondition)
    455.  
       
    456.  
      EmbeddedWebServerFactoryCustomizerAutoConfiguration.UndertowWebServerFactoryCustomizerConfiguration:
    457.  
      Did not match:
    458.  
      - @ConditionalOnClass did not find required classes 'io.undertow.Undertow', 'org.xnio.SslClientAuthMode' (OnClassCondition)
    459.  
       
    460.  
      ErrorWebFluxAutoConfiguration:
    461.  
      Did not match:
    462.  
      - @ConditionalOnClass did not find required class 'org.springframework.web.reactive.config.WebFluxConfigurer' (OnClassCondition)
    463.  
       
    464.  
      FlywayAutoConfiguration:
    465.  
      Did not match:
    466.  
      - @ConditionalOnClass did not find required class 'org.flywaydb.core.Flyway' (OnClassCondition)
    467.  
       
    468.  
      FreeMarkerAutoConfiguration:
    469.  
      Did not match:
    470.  
      - @ConditionalOnClass did not find required class 'freemarker.template.Configuration' (OnClassCondition)
    471.  
       
    472.  
      GenericCacheConfiguration:
    473.  
      Did not match:
    474.  
      - @ConditionalOnBean (types: org.springframework.cache.Cache; SearchStrategy: all) did not find any beans of type org.springframework.cache.Cache (OnBeanCondition)
    475.  
      Matched:
    476.  
      - Cache org.springframework.boot.autoconfigure.cache.GenericCacheConfiguration automatic cache type (CacheCondition)
    477.  
       
    478.  
      GroovyTemplateAutoConfiguration:
    479.  
      Did not match:
    480.  
      - @ConditionalOnClass did not find required class 'groovy.text.markup.MarkupTemplateEngine' (OnClassCondition)
    481.  
       
    482.  
      GsonAutoConfiguration:
    483.  
      Did not match:
    484.  
      - @ConditionalOnClass did not find required class 'com.google.gson.Gson' (OnClassCondition)
    485.  
       
    486.  
      GsonHttpMessageConvertersConfiguration:
    487.  
      Did not match:
    488.  
      - @ConditionalOnClass did not find required class 'com.google.gson.Gson' (OnClassCondition)
    489.  
       
    490.  
      H2ConsoleAutoConfiguration:
    491.  
      Did not match:
    492.  
      - @ConditionalOnClass did not find required class 'org.h2.server.web.WebServlet' (OnClassCondition)
    493.  
       
    494.  
      HazelcastAutoConfiguration:
    495.  
      Did not match:
    496.  
      - @ConditionalOnClass did not find required class 'com.hazelcast.core.HazelcastInstance' (OnClassCondition)
    497.  
       
    498.  
      HazelcastCacheConfiguration:
    499.  
      Did not match:
    500.  
      - @ConditionalOnClass did not find required classes 'com.hazelcast.core.HazelcastInstance', 'com.hazelcast.spring.cache.HazelcastCacheManager' (OnClassCondition)
    501.  
       
    502.  
      HazelcastJpaDependencyAutoConfiguration:
    503.  
      Did not match:
    504.  
      - @ConditionalOnClass did not find required classes 'com.hazelcast.core.HazelcastInstance', 'org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean' (OnClassCondition)
    505.  
       
    506.  
      HibernateJpaAutoConfiguration:
    507.  
      Did not match:
    508.  
      - @ConditionalOnClass did not find required classes 'org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean', 'javax.persistence.EntityManager' (OnClassCondition)
    509.  
       
    510.  
      HttpHandlerAutoConfiguration:
    511.  
      Did not match:
    512.  
      - @ConditionalOnClass did not find required class 'org.springframework.web.reactive.DispatcherHandler' (OnClassCondition)
    513.  
       
    514.  
      HypermediaAutoConfiguration:
    515.  
      Did not match:
    516.  
      - @ConditionalOnClass did not find required classes 'org.springframework.hateoas.Resource', 'org.springframework.plugin.core.Plugin' (OnClassCondition)
    517.  
       
    518.  
      InfinispanCacheConfiguration:
    519.  
      Did not match:
    520.  
      - @ConditionalOnClass did not find required class 'org.infinispan.spring.provider.SpringEmbeddedCacheManager' (OnClassCondition)
    521.  
       
    522.  
      InfluxDbAutoConfiguration:
    523.  
      Did not match:
    524.  
      - @ConditionalOnClass did not find required class 'org.influxdb.InfluxDB' (OnClassCondition)
    525.  
       
    526.  
      IntegrationAutoConfiguration:
    527.  
      Did not match:
    528.  
      - @ConditionalOnClass did not find required class 'org.springframework.integration.config.EnableIntegration' (OnClassCondition)
    529.  
       
    530.  
      JCacheCacheConfiguration:
    531.  
      Did not match:
    532.  
      - @ConditionalOnClass did not find required class 'javax.cache.Caching' (OnClassCondition)
    533.  
       
    534.  
      JacksonAutoConfiguration.JodaDateTimeJacksonConfiguration:
    535.  
      Did not match:
    536.  
      - @ConditionalOnClass did not find required classes 'org.joda.time.DateTime', 'com.fasterxml.jackson.datatype.joda.ser.DateTimeSerializer', 'com.fasterxml.jackson.datatype.joda.cfg.JacksonJodaDateFormat' (OnClassCondition)
    537.  
       
    538.  
      JacksonHttpMessageConvertersConfiguration.MappingJackson2XmlHttpMessageConverterConfiguration:
    539.  
      Did not match:
    540.  
      - @ConditionalOnClass did not find required class 'com.fasterxml.jackson.dataformat.xml.XmlMapper' (OnClassCondition)
    541.  
       
    542.  
      JerseyAutoConfiguration:
    543.  
      Did not match:
    544.  
      - @ConditionalOnClass did not find required class 'org.glassfish.jersey.server.spring.SpringComponentProvider' (OnClassCondition)
    545.  
       
    546.  
      JestAutoConfiguration:
    547.  
      Did not match:
    548.  
      - @ConditionalOnClass did not find required class 'io.searchbox.client.JestClient' (OnClassCondition)
    549.  
       
    550.  
      JmsAutoConfiguration:
    551.  
      Did not match:
    552.  
      - @ConditionalOnClass did not find required classes 'javax.jms.Message', 'org.springframework.jms.core.JmsTemplate' (OnClassCondition)
    553.  
       
    554.  
      JndiConnectionFactoryAutoConfiguration:
    555.  
      Did not match:
    556.  
      - @ConditionalOnClass did not find required class 'org.springframework.jms.core.JmsTemplate' (OnClassCondition)
    557.  
       
    558.  
      JndiDataSourceAutoConfiguration:
    559.  
      Did not match:
    560.  
      - @ConditionalOnProperty (spring.datasource.jndi-name) did not find property 'jndi-name' (OnPropertyCondition)
    561.  
      Matched:
    562.  
      - @ConditionalOnClass found required classes 'javax.sql.DataSource', 'org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    563.  
       
    564.  
      JooqAutoConfiguration:
    565.  
      Did not match:
    566.  
      - @ConditionalOnClass did not find required class 'org.jooq.DSLContext' (OnClassCondition)
    567.  
       
    568.  
      JpaRepositoriesAutoConfiguration:
    569.  
      Did not match:
    570.  
      - @ConditionalOnClass did not find required class 'org.springframework.data.jpa.repository.JpaRepository' (OnClassCondition)
    571.  
       
    572.  
      JsonbAutoConfiguration:
    573.  
      Did not match:
    574.  
      - @ConditionalOnClass did not find required class 'javax.json.bind.Jsonb' (OnClassCondition)
    575.  
       
    576.  
      JsonbHttpMessageConvertersConfiguration:
    577.  
      Did not match:
    578.  
      - @ConditionalOnClass did not find required class 'javax.json.bind.Jsonb' (OnClassCondition)
    579.  
       
    580.  
      JtaAutoConfiguration:
    581.  
      Did not match:
    582.  
      - @ConditionalOnClass did not find required class 'javax.transaction.Transaction' (OnClassCondition)
    583.  
       
    584.  
      KafkaAutoConfiguration:
    585.  
      Did not match:
    586.  
      - @ConditionalOnClass did not find required class 'org.springframework.kafka.core.KafkaTemplate' (OnClassCondition)
    587.  
       
    588.  
      LdapAutoConfiguration:
    589.  
      Did not match:
    590.  
      - @ConditionalOnClass did not find required class 'org.springframework.ldap.core.ContextSource' (OnClassCondition)
    591.  
       
    592.  
      LdapDataAutoConfiguration:
    593.  
      Did not match:
    594.  
      - @ConditionalOnClass did not find required class 'org.springframework.data.ldap.repository.LdapRepository' (OnClassCondition)
    595.  
       
    596.  
      LdapRepositoriesAutoConfiguration:
    597.  
      Did not match:
    598.  
      - @ConditionalOnClass did not find required class 'org.springframework.data.ldap.repository.LdapRepository' (OnClassCondition)
    599.  
       
    600.  
      LiquibaseAutoConfiguration:
    601.  
      Did not match:
    602.  
      - @ConditionalOnClass did not find required classes 'liquibase.integration.spring.SpringLiquibase', 'liquibase.change.DatabaseChange' (OnClassCondition)
    603.  
       
    604.  
      MailSenderAutoConfiguration:
    605.  
      Did not match:
    606.  
      - @ConditionalOnClass did not find required class 'javax.mail.internet.MimeMessage' (OnClassCondition)
    607.  
       
    608.  
      MailSenderValidatorAutoConfiguration:
    609.  
      Did not match:
    610.  
      - @ConditionalOnProperty (spring.mail.test-connection) did not find property 'test-connection' (OnPropertyCondition)
    611.  
       
    612.  
      MessageSourceAutoConfiguration:
    613.  
      Did not match:
    614.  
      - ResourceBundle did not find bundle with basename messages (MessageSourceAutoConfiguration.ResourceBundleCondition)
    615.  
       
    616.  
      MongoAutoConfiguration:
    617.  
      Did not match:
    618.  
      - @ConditionalOnClass did not find required class 'com.mongodb.MongoClient' (OnClassCondition)
    619.  
       
    620.  
      MongoDataAutoConfiguration:
    621.  
      Did not match:
    622.  
      - @ConditionalOnClass did not find required classes 'com.mongodb.MongoClient', 'org.springframework.data.mongodb.core.MongoTemplate' (OnClassCondition)
    623.  
       
    624.  
      MongoReactiveAutoConfiguration:
    625.  
      Did not match:
    626.  
      - @ConditionalOnClass did not find required class 'com.mongodb.reactivestreams.client.MongoClient' (OnClassCondition)
    627.  
       
    628.  
      MongoReactiveDataAutoConfiguration:
    629.  
      Did not match:
    630.  
      - @ConditionalOnClass did not find required classes 'com.mongodb.reactivestreams.client.MongoClient', 'org.springframework.data.mongodb.core.ReactiveMongoTemplate' (OnClassCondition)
    631.  
       
    632.  
      MongoReactiveRepositoriesAutoConfiguration:
    633.  
      Did not match:
    634.  
      - @ConditionalOnClass did not find required classes 'com.mongodb.reactivestreams.client.MongoClient', 'org.springframework.data.mongodb.repository.ReactiveMongoRepository' (OnClassCondition)
    635.  
       
    636.  
      MongoRepositoriesAutoConfiguration:
    637.  
      Did not match:
    638.  
      - @ConditionalOnClass did not find required classes 'com.mongodb.MongoClient', 'org.springframework.data.mongodb.repository.MongoRepository' (OnClassCondition)
    639.  
       
    640.  
      MustacheAutoConfiguration:
    641.  
      Did not match:
    642.  
      - @ConditionalOnClass did not find required class 'com.samskivert.mustache.Mustache' (OnClassCondition)
    643.  
       
    644.  
      MybatisAutoConfiguration.MapperScannerRegistrarNotFoundConfiguration:
    645.  
      Did not match:
    646.  
      - @ConditionalOnMissingBean (types: org.mybatis.spring.mapper.MapperFactoryBean; SearchStrategy: all) found beans of type 'org.mybatis.spring.mapper.MapperFactoryBean' &departmentMapper, &employeeMapper (OnBeanCondition)
    647.  
       
    648.  
      Neo4jDataAutoConfiguration:
    649.  
      Did not match:
    650.  
      - @ConditionalOnClass did not find required classes 'org.neo4j.ogm.session.SessionFactory', 'org.springframework.data.neo4j.transaction.Neo4jTransactionManager' (OnClassCondition)
    651.  
       
    652.  
      Neo4jRepositoriesAutoConfiguration:
    653.  
      Did not match:
    654.  
      - @ConditionalOnClass did not find required classes 'org.neo4j.ogm.session.Neo4jSession', 'org.springframework.data.neo4j.repository.Neo4jRepository' (OnClassCondition)
    655.  
       
    656.  
      NoOpCacheConfiguration:
    657.  
      Did not match:
    658.  
      - @ConditionalOnMissingBean (types: org.springframework.cache.CacheManager; SearchStrategy: all) found beans of type 'org.springframework.cache.CacheManager' cacheManager (OnBeanCondition)
    659.  
      Matched:
    660.  
      - Cache org.springframework.boot.autoconfigure.cache.NoOpCacheConfiguration automatic cache type (CacheCondition)
    661.  
       
    662.  
      OAuth2ClientAutoConfiguration:
    663.  
      Did not match:
    664.  
      - @ConditionalOnClass did not find required classes 'org.springframework.security.config.annotation.web.configuration.EnableWebSecurity', 'org.springframework.security.oauth2.client.registration.ClientRegistration' (OnClassCondition)
    665.  
       
    666.  
      ProjectInfoAutoConfiguration#buildProperties:
    667.  
      Did not match:
    668.  
      - @ConditionalOnResource did not find resource '${spring.info.build.location:classpath:META-INF/build-info.properties}' (OnResourceCondition)
    669.  
       
    670.  
      ProjectInfoAutoConfiguration#gitProperties:
    671.  
      Did not match:
    672.  
      - GitResource did not find git info at classpath:git.properties (ProjectInfoAutoConfiguration.GitResourceAvailableCondition)
    673.  
       
    674.  
      QuartzAutoConfiguration:
    675.  
      Did not match:
    676.  
      - @ConditionalOnClass did not find required class 'org.quartz.Scheduler' (OnClassCondition)
    677.  
       
    678.  
      RabbitAutoConfiguration:
    679.  
      Did not match:
    680.  
      - @ConditionalOnClass did not find required classes 'org.springframework.amqp.rabbit.core.RabbitTemplate', 'com.rabbitmq.client.Channel' (OnClassCondition)
    681.  
       
    682.  
      ReactiveUserDetailsServiceAutoConfiguration:
    683.  
      Did not match:
    684.  
      - @ConditionalOnClass did not find required class 'org.springframework.security.authentication.ReactiveAuthenticationManager' (OnClassCondition)
    685.  
       
    686.  
      ReactiveWebServerFactoryAutoConfiguration:
    687.  
      Did not match:
    688.  
      - not a reactive web application (OnWebApplicationCondition)
    689.  
      Matched:
    690.  
      - @ConditionalOnClass found required class 'org.springframework.http.ReactiveHttpInputMessage'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    691.  
       
    692.  
      ReactorCoreAutoConfiguration:
    693.  
      Did not match:
    694.  
      - @ConditionalOnClass did not find required classes 'reactor.core.publisher.Mono', 'reactor.core.publisher.Flux' (OnClassCondition)
    695.  
       
    696.  
      RedisAutoConfiguration:
    697.  
      Did not match:
    698.  
      - @ConditionalOnClass did not find required class 'org.springframework.data.redis.core.RedisOperations' (OnClassCondition)
    699.  
       
    700.  
      RedisCacheConfiguration:
    701.  
      Did not match:
    702.  
      - @ConditionalOnClass did not find required class 'org.springframework.data.redis.connection.RedisConnectionFactory' (OnClassCondition)
    703.  
       
    704.  
      RedisReactiveAutoConfiguration:
    705.  
      Did not match:
    706.  
      - @ConditionalOnClass did not find required classes 'org.springframework.data.redis.connection.ReactiveRedisConnectionFactory', 'org.springframework.data.redis.core.ReactiveRedisTemplate', 'reactor.core.publisher.Flux' (OnClassCondition)
    707.  
       
    708.  
      RedisRepositoriesAutoConfiguration:
    709.  
      Did not match:
    710.  
      - @ConditionalOnClass did not find required class 'org.springframework.data.redis.repository.configuration.EnableRedisRepositories' (OnClassCondition)
    711.  
       
    712.  
      RemoteDevToolsAutoConfiguration:
    713.  
      Did not match:
    714.  
      - @ConditionalOnProperty (spring.devtools.remote.secret) did not find property 'secret' (OnPropertyCondition)
    715.  
      Matched:
    716.  
      - @ConditionalOnClass found required classes 'javax.servlet.Filter', 'org.springframework.http.server.ServerHttpRequest'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    717.  
       
    718.  
      RepositoryRestMvcAutoConfiguration:
    719.  
      Did not match:
    720.  
      - @ConditionalOnClass did not find required class 'org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration' (OnClassCondition)
    721.  
       
    722.  
      SecurityAutoConfiguration:
    723.  
      Did not match:
    724.  
      - @ConditionalOnClass did not find required class 'org.springframework.security.authentication.DefaultAuthenticationEventPublisher' (OnClassCondition)
    725.  
       
    726.  
      SecurityFilterAutoConfiguration:
    727.  
      Did not match:
    728.  
      - @ConditionalOnClass did not find required classes 'org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer', 'org.springframework.security.config.http.SessionCreationPolicy' (OnClassCondition)
    729.  
       
    730.  
      SendGridAutoConfiguration:
    731.  
      Did not match:
    732.  
      - @ConditionalOnClass did not find required class 'com.sendgrid.SendGrid' (OnClassCondition)
    733.  
       
    734.  
      ServletWebServerFactoryConfiguration.EmbeddedJetty:
    735.  
      Did not match:
    736.  
      - @ConditionalOnClass did not find required classes 'org.eclipse.jetty.server.Server', 'org.eclipse.jetty.util.Loader', 'org.eclipse.jetty.webapp.WebAppContext' (OnClassCondition)
    737.  
       
    738.  
      ServletWebServerFactoryConfiguration.EmbeddedUndertow:
    739.  
      Did not match:
    740.  
      - @ConditionalOnClass did not find required classes 'io.undertow.Undertow', 'org.xnio.SslClientAuthMode' (OnClassCondition)
    741.  
       
    742.  
      SessionAutoConfiguration:
    743.  
      Did not match:
    744.  
      - @ConditionalOnClass did not find required class 'org.springframework.session.Session' (OnClassCondition)
    745.  
       
    746.  
      SolrAutoConfiguration:
    747.  
      Did not match:
    748.  
      - @ConditionalOnClass did not find required classes 'org.apache.solr.client.solrj.impl.HttpSolrClient', 'org.apache.solr.client.solrj.impl.CloudSolrClient' (OnClassCondition)
    749.  
       
    750.  
      SolrRepositoriesAutoConfiguration:
    751.  
      Did not match:
    752.  
      - @ConditionalOnClass did not find required classes 'org.apache.solr.client.solrj.SolrClient', 'org.springframework.data.solr.repository.SolrRepository' (OnClassCondition)
    753.  
       
    754.  
      SpringDataWebAutoConfiguration:
    755.  
      Did not match:
    756.  
      - @ConditionalOnClass did not find required class 'org.springframework.data.web.PageableHandlerMethodArgumentResolver' (OnClassCondition)
    757.  
       
    758.  
      ThymeleafAutoConfiguration:
    759.  
      Did not match:
    760.  
      - @ConditionalOnClass did not find required class 'org.thymeleaf.templatemode.TemplateMode' (OnClassCondition)
    761.  
       
    762.  
      TransactionAutoConfiguration.EnableTransactionManagementConfiguration.JdkDynamicAutoProxyConfiguration:
    763.  
      Did not match:
    764.  
      - @ConditionalOnProperty (spring.aop.proxy-target-class=false) did not find property 'proxy-target-class' (OnPropertyCondition)
    765.  
       
    766.  
      UserDetailsServiceAutoConfiguration:
    767.  
      Did not match:
    768.  
      - @ConditionalOnClass did not find required class 'org.springframework.security.authentication.AuthenticationManager' (OnClassCondition)
    769.  
       
    770.  
      WebClientAutoConfiguration:
    771.  
      Did not match:
    772.  
      - @ConditionalOnClass did not find required class 'org.springframework.web.reactive.function.client.WebClient' (OnClassCondition)
    773.  
       
    774.  
      WebFluxAutoConfiguration:
    775.  
      Did not match:
    776.  
      - @ConditionalOnClass did not find required class 'org.springframework.web.reactive.config.WebFluxConfigurer' (OnClassCondition)
    777.  
       
    778.  
      WebFluxSecurityConfiguration:
    779.  
      Did not match:
    780.  
      - @ConditionalOnClass did not find required classes 'org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity', 'org.springframework.security.web.server.WebFilterChainProxy' (OnClassCondition)
    781.  
       
    782.  
      WebMvcAutoConfiguration.ResourceChainCustomizerConfiguration:
    783.  
      Did not match:
    784.  
      - @ConditionalOnEnabledResourceChain did not find class org.webjars.WebJarAssetLocator (OnEnabledResourceChainCondition)
    785.  
       
    786.  
      WebMvcAutoConfiguration.WebMvcAutoConfigurationAdapter#beanNameViewResolver:
    787.  
      Did not match:
    788.  
      - @ConditionalOnMissingBean (types: org.springframework.web.servlet.view.BeanNameViewResolver; SearchStrategy: all) found beans of type 'org.springframework.web.servlet.view.BeanNameViewResolver' beanNameViewResolver (OnBeanCondition)
    789.  
       
    790.  
      WebMvcAutoConfiguration.WebMvcAutoConfigurationAdapter#localeResolver:
    791.  
      Did not match:
    792.  
      - @ConditionalOnProperty (spring.mvc.locale) did not find property 'locale' (OnPropertyCondition)
    793.  
       
    794.  
      WebServicesAutoConfiguration:
    795.  
      Did not match:
    796.  
      - @ConditionalOnClass did not find required class 'org.springframework.ws.transport.http.MessageDispatcherServlet' (OnClassCondition)
    797.  
       
    798.  
      WebSocketMessagingAutoConfiguration:
    799.  
      Did not match:
    800.  
      - @ConditionalOnClass did not find required class 'org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer' (OnClassCondition)
    801.  
       
    802.  
      WebSocketReactiveAutoConfiguration:
    803.  
      Did not match:
    804.  
      - not a reactive web application (OnWebApplicationCondition)
    805.  
      Matched:
    806.  
      - @ConditionalOnClass found required classes 'javax.servlet.Servlet', 'javax.websocket.server.ServerContainer'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    807.  
       
    808.  
      WebSocketServletAutoConfiguration.JettyWebSocketConfiguration:
    809.  
      Did not match:
    810.  
      - @ConditionalOnClass did not find required class 'org.eclipse.jetty.websocket.jsr356.server.deploy.WebSocketServerContainerInitializer' (OnClassCondition)
    811.  
       
    812.  
      WebSocketServletAutoConfiguration.UndertowWebSocketConfiguration:
    813.  
      Did not match:
    814.  
      - @ConditionalOnClass did not find required class 'io.undertow.websockets.jsr.Bootstrap' (OnClassCondition)
    815.  
       
    816.  
      XADataSourceAutoConfiguration:
    817.  
      Did not match:
    818.  
      - @ConditionalOnClass did not find required class 'javax.transaction.TransactionManager' (OnClassCondition)
    819.  
       
    820.  
       
    821.  
      Exclusions:
    822.  
      -----------
    823.  
       
    824.  
      None
    825.  
       
    826.  
       
    827.  
      Unconditional classes:
    828.  
      ----------------------
    829.  
       
    830.  
      org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration
    831.  
       
    832.  
      org.springframework.boot.autoconfigure.web.embedded.EmbeddedWebServerFactoryCustomizerAutoConfiguration
    833.  
       
    834.  
      org.springframework.boot.autoconfigure.security.reactive.ReactiveSecurityAutoConfiguration
    835.  
       
    836.  
      org.springframework.boot.autoconfigure.context.ConfigurationPropertiesAutoConfiguration
    837.  
       
    838.  
      org.springframework.boot.autoconfigure.info.ProjectInfoAutoConfiguration
    839.  
       
    840.  
       
    841.  
       
    842.  
      2018-09-08 00:35:23.579 INFO 15880 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
    843.  
      2018-09-08 00:35:23.581 INFO 15880 --- [ restartedMain] c.z.s.Springboot01CacheApplication : Started Springboot01CacheApplication in 1.977 seconds (JVM running for 2.532)
    844.  
      2018-09-08 00:35:23.583 DEBUG 15880 --- [ restartedMain] o.s.boot.devtools.restart.Restarter : Creating new Restarter for thread Thread[main,5,main]
    845.  
      2018-09-08 00:35:23.583 DEBUG 15880 --- [ restartedMain] o.s.boot.devtools.restart.Restarter : Immediately restarting application
    846.  
      2018-09-08 00:35:23.583 DEBUG 15880 --- [ restartedMain] o.s.boot.devtools.restart.Restarter : Created RestartClassLoader org.springframework.boot.devtools.restart.classloader.RestartClassLoader@55ef7dd3
    847.  
      2018-09-08 00:35:23.583 DEBUG 15880 --- [ restartedMain] o.s.boot.devtools.restart.Restarter : Starting application com.zzq.springboot01cache.Springboot01CacheApplication with URLs [file:/D:/springboot%e9%ab%98%e7%ba%a7/springboot-01-cache/target/classes/]
    848.  
       

    我们发现就只有一个缓存配置是注册进去了, 也就是说会产生一个缓存管理器

    我们看下

      SimpleCacheConfiguration

    1.  
      @Bean
    2.  
      public ConcurrentMapCacheManager cacheManager() {
    3.  
      ConcurrentMapCacheManager cacheManager = new ConcurrentMapCacheManager();
    4.  
      List<String> cacheNames = this.cacheProperties.getCacheNames();
    5.  
      if (!cacheNames.isEmpty()) {
    6.  
      cacheManager.setCacheNames(cacheNames);
    7.  
      }
    8.  
      return this.customizerInvoker.customize(cacheManager);
    9.  
      }

    向容器中放入要给ConcurrentMapCacheManager 这个缓存管理器

    ConcurrentMapCacheManger 

    从名字就能看出来,底层一定使用的是ConcurrentMap 

    1.  
      @Bean
    2.  
      public ConcurrentMapCacheManager cacheManager() {
    3.  
      ConcurrentMapCacheManager cacheManager = new ConcurrentMapCacheManager();
    4.  
      List<String> cacheNames = this.cacheProperties.getCacheNames();
    5.  
      if (!cacheNames.isEmpty()) {
    6.  
      cacheManager.setCacheNames(cacheNames);
    7.  
      }
    8.  
      return this.customizerInvoker.customize(cacheManager);
    9.  
      }

    //设置缓存组件的名字

    1.  
      @Override
    2.  
      @Nullable
    3.  
      public Cache getCache(String name) {
    4.  
      Cache cache = this.cacheMap.get(name);
    5.  
      if (cache == null && this.dynamic) {
    6.  
      synchronized (this.cacheMap) {
    7.  
      cache = this.cacheMap.get(name);
    8.  
      if (cache == null) {
    9.  
      cache = createConcurrentMapCache(name);
    10.  
      this.cacheMap.put(name, cache);
    11.  
      }
    12.  
      }
    13.  
      }
    14.  
      return cache;
    15.  
      }

    通过名字获取缓存组件,如果是null 的话, 然后就用同步代码块进行尝试,如果还是没有得到, 就直接创建一个cache

    1.  
      protected Cache createConcurrentMapCache(String name) {
    2.  
      SerializationDelegate actualSerialization = (isStoreByValue() ? this.serialization : null);
    3.  
      return new ConcurrentMapCache(name, new ConcurrentHashMap<>(256),
    4.  
      isAllowNullValues(), actualSerialization);
    5.  
       
    6.  
      }
    1.  
      protected ConcurrentMapCache(String name, ConcurrentMap<Object, Object> store,
    2.  
      boolean allowNullValues, @Nullable SerializationDelegate serialization) {
    3.  
       
    4.  
      super(allowNullValues);
    5.  
      Assert.notNull(name, "Name must not be null");
    6.  
      Assert.notNull(store, "Store must not be null");
    7.  
      this.name = name;
    8.  
      this.store = store;
    9.  
      this.serialization = serialization;
    10.  
      }
    	private final ConcurrentMap<Object, Object> store;

    创建一个concurrentHashMap 集合进行缓存数据

    运行流程

    @Cacheable    向缓存中存数据

        *      cacheNames/value:指定缓存组件的名字;将方法的返回结果放在哪个缓存中,是数组的方式,可以指定多个缓存;
         *
         *      key:缓存数据使用的key;可以用它来指定。默认是使用方法参数的值  1-方法的返回值
         *              编写SpEL; #i d;参数id的值   #a0  #p0  #root.args[0]
         *              getEmp[2]
         *
         *      keyGenerator:key的生成器;可以自己指定key的生成器的组件id
         *              key/keyGenerator:二选一使用;
         *
         *
         *      cacheManager:指定缓存管理器;或者cacheResolver指定获取解析器
         *
         *      condition:指定符合条件的情况下才缓存;
         *              ,condition = "#id>0"
         *          condition = "#a0>1":第一个参数的值》1的时候才进行缓存
         *
         *      unless:否定缓存;当unless指定的条件为true,方法的返回值就不会被缓存;可以获取到结果进行判断
         *              unless = "#result == null"
         *              unless = "#a0==2":如果第一个参数的值是2,结果不缓存;
         *      sync:是否使用异步模式

    名字

    位置

    描述

    示例

    methodName

    root object

    当前被调用的方法名

    #root.methodName

    method

    root object

    当前被调用的方法

    #root.method.name

    target

    root object

    当前被调用的目标对象

    #root.target

    targetClass

    root object

    当前被调用的目标对象类

    #root.targetClass

    args

    root object

    当前被调用的方法的参数列表

    #root.args[0]

    caches

    root object

    当前方法调用使用的缓存列表(如@Cacheable(value={"cache1", "cache2"})),则有两个cache

    #root.caches[0].name

    argument name

    evaluation context

    方法参数的名字. 可以直接 #参数名 ,也可以使用 #p0或#a0 的形式,0代表参数的索引;

    #iban 、 #a0 、  #p0 

    result

    evaluation context

    方法执行后的返回值(仅当方法执行之后的判断有效,如‘unless’,’cache put’的表达式 ’cache evict’的表达式beforeInvocation=false)

    #result

    @Cacheput  修改数据库中的某个数据,同时更新缓存

    1.  
      /**
    2.  
      * 更新
    3.  
      */
    4.  
      @CachePut(key = "#employee.id")
    5.  
      public Employee updateEmp(Employee employee){
    6.  
      employeeMapper.updateEmp(employee);
    7.  
      return employee ;
    8.  
      }
    1.  
      @GetMapping("/emp")
    2.  
      public Employee updateEmp(Employee employee){
    3.  
      return employeeService.updateEmp(employee);
    4.  
      }

    1.查看

      第一次请求

    1.  
      2018-09-08 23:53:56.124 DEBUG 8936 --- [nio-8080-exec-2] o.s.b.w.s.f.OrderedRequestContextFilter : Bound request context to thread: org.apache.catalina.connector.RequestFacade@1d73467b
    2.  
      查询员工1
    3.  
      2018-09-08 23:53:56.125 INFO 8936 --- [nio-8080-exec-2] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
    4.  
      2018-09-08 23:54:01.400 INFO 8936 --- [nio-8080-exec-2] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
    5.  
      2018-09-08 23:54:01.406 DEBUG 8936 --- [nio-8080-exec-2] c.z.s.mapper.EmployeeMapper.getEmpById : ==> Preparing: SELECT * FROM employee WHERE id = ?
    6.  
      2018-09-08 23:54:01.416 DEBUG 8936 --- [nio-8080-exec-2] c.z.s.mapper.EmployeeMapper.getEmpById : ==> Parameters: 1(Integer)
    7.  
      2018-09-08 23:54:01.798 DEBUG 8936 --- [nio-8080-exec-2] c.z.s.mapper.EmployeeMapper.getEmpById : <== Total: 1
    8.  
      2018-09-08 23:54:01.833 DEBUG 8936 --- [nio-8080-exec-2] o.s.b.w.s.f.OrderedRequestContextFilter : Cleared thread-bound request context: org.apache.catalina.connector.RequestFacade@1d73467b

    查询数据库

    第二次

    1.  
      2018-09-08 23:54:40.618 DEBUG 8936 --- [nio-8080-exec-4] o.s.b.w.s.f.OrderedRequestContextFilter : Bound request context to thread: org.apache.catalina.connector.RequestFacade@1d73467b
    2.  
      2018-09-08 23:54:40.621 DEBUG 8936 --- [nio-8080-exec-4] o.s.b.w.s.f.OrderedRequestContextFilter : Cleared thread-bound request context: org.apache.catalina.connector.RequestFacade@1d73467b

    没有对数据库进行操作

    2.更新

    1.  
      2018-09-08 23:55:58.751 DEBUG 8936 --- [nio-8080-exec-3] o.s.b.w.s.f.OrderedRequestContextFilter : Bound request context to thread: org.apache.catalina.connector.RequestFacade@1d73467b
    2.  
      2018-09-08 23:55:59.890 DEBUG 8936 --- [nio-8080-exec-3] c.z.s.mapper.EmployeeMapper.updateEmp : ==> Preparing: UPDATE employee SET lastName=?,email=?,gender=?,d_id=? WHERE id=?
    3.  
      2018-09-08 23:55:59.891 DEBUG 8936 --- [nio-8080-exec-3] c.z.s.mapper.EmployeeMapper.updateEmp : ==> Parameters: 张ab(String), zhangsan@qq.com(String), 1(Integer), null, 1(Integer)
    4.  
      2018-09-08 23:56:04.531 DEBUG 8936 --- [nio-8080-exec-3] c.z.s.mapper.EmployeeMapper.updateEmp : <== Updates: 1
    5.  
      2018-09-08 23:56:04.633 DEBUG 8936 --- [nio-8080-exec-3] o.s.b.w.s.f.OrderedRequestContextFilter : Cleared thread-bound request context: org.apache.catalina.connector.RequestFacade@1d73467b

    更行成功,

    查看

    1.  
      2018-09-08 23:57:30.997 DEBUG 8936 --- [nio-8080-exec-5] o.s.b.w.s.f.OrderedRequestContextFilter : Bound request context to thread: org.apache.catalina.connector.RequestFacade@1d73467b
    2.  
      2018-09-08 23:57:30.999 DEBUG 8936 --- [nio-8080-exec-5] o.s.b.w.s.f.OrderedRequestContextFilter : Cleared thread-bound request context: org.apache.catalina.connector.RequestFacade@1d73467b

    @ CacheEvict  删除数据库的数据同时,删除缓存中的数据

    1.  
      /**
    2.  
      * 删除操作
    3.  
      * @param id
    4.  
      */
    5.  
      @CacheEvict(cacheNames = "emp",key = "#a0")
    6.  
      public void deleteEmp(Integer id){
    7.  
      employeeMapper.deleteEmpById(id);
    8.  
      }
    1.  
       
    2.  
      @GetMapping("/empdelete/{id}")
    3.  
      public void deleteEmp(@PathVariable("id") Integer id){
    4.  
      employeeService.deleteEmp(id);
    5.  
      }

    @Caching 定义复杂缓存注解      @CacheConfig抽取这个类中的公共项

    1.  
      /**
    2.  
      * 根据名字来查询
    3.  
      */
    4.  
      @Caching(
    5.  
      cacheable= {
    6.  
      @Cacheable(key = "#a0")
    7.  
      },
    8.  
      put = {
    9.  
      @CachePut(key = "#result.email"),
    10.  
      @CachePut(key = "#result.id")
    11.  
      }
    12.  
      )
    13.  
      public Employee getEmpByName(String lastName){
    14.  
      return employeeMapper.getEmpByLastName(lastName);
    15.  
      }
    1.  
      @CacheConfig(cacheNames = "emp")
    2.  
      @Service
    3.  
      public class EmployeeService {

    Springboot 整合Redis 

    1.引入redis 

    1.  
      <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-redis -->
    2.  
      <dependency>
    3.  
      <groupId>org.springframework.boot</groupId>
    4.  
      <artifactId>spring-boot-starter-data-redis</artifactId>
    5.  
      </dependency>

    2.配置redis 连接 在properties/yml全局配置文件中配置host  port  默认port是6397  

    1.  
      redis:
    2.  
      host: 192.168.24.133
    3.  
      port: 6377

    使用redisTemplate 操作redis 数据库 

    redis 提供了redisTemplate 模板对象操作redis , 因为String类型的数据存储操作比较多,写了一个子类stringRedisTemplated类

    string

    1.  
      stringStringValueOperations.set("hello","a");
    2.  
      stringStringValueOperations.append("hello","b");

    list

    1.  
      stringRedisTemplate.opsForList().leftPushAll("myList", Arrays.asList("A","b"));
    2.  
      // System.out.println(stringRedisTemplate.opsForList().leftPop("myList")); //从左边弹出

    redis序列化对象

    redis 默认是按照jdk提供的 Serializable  接口标识,序列化的,

    1.  
      super.afterPropertiesSet();
    2.  
       
    3.  
      boolean defaultUsed = false;
    4.  
       
    5.  
      if (defaultSerializer == null) {
    6.  
       
    7.  
      defaultSerializer = new JdkSerializationRedisSerializer(
    8.  
      classLoader != null ? classLoader : this.getClass().getClassLoader());
    9.  
      }
    10.  
       
    11.  
      if (enableDefaultSerializer) {
    12.  
       
    13.  
      if (keySerializer == null) {
    14.  
      keySerializer = defaultSerializer;
    15.  
      defaultUsed = true;
    16.  
      }

    只要我们把要要序列化的对象,实现Serializable  接口spring提供的redistemplate就会自动帮我们完成序列化

    但是序列化不是只有着一种方式 ,SpringTemplate也提供了好几种序列化方式

    只要我们有导入jackson 依赖,他就提供jackson2jsonRedisSerializer 这种序列化对象

    我们看下redisautoconfiguraction 是如何配置默认的jskserializationredisSerializer 的

    1.  
      @Bean
    2.  
      @ConditionalOnMissingBean(name = "redisTemplate")
    3.  
      public RedisTemplate<Object, Object> redisTemplate(
    4.  
      RedisConnectionFactory redisConnectionFactory) throws UnknownHostException {
    5.  
      RedisTemplate<Object, Object> template = new RedisTemplate<>();
    6.  
      template.setConnectionFactory(redisConnectionFactory);
    7.  
      return template;
    8.  
      }

    创建了一个redisTemplate 对象,然后给他封装了redisConnectionFactory工厂 , redisTemplate 中的属性

    	private @Nullable RedisSerializer<?> defaultSerializer;

    默认会被赋值

    1.  
       
    2.  
      if (defaultSerializer == null) {
    3.  
       
    4.  
      defaultSerializer = new JdkSerializationRedisSerializer(
    5.  
      classLoader != null ? classLoader : this.getClass().getClassLoader());
    6.  
      }

    但是如果我们赋值进去,他就使用了我们自己定义的序列化方式

    看代码

    1.  
      @Bean
    2.  
      public RedisTemplate<Object, Employee> redisTemplate(
    3.  
      RedisConnectionFactory redisConnectionFactory) throws UnknownHostException {
    4.  
      RedisTemplate<Object, Employee> template = new RedisTemplate<>();
    5.  
      template.setConnectionFactory(redisConnectionFactory);
    6.  
      Jackson2JsonRedisSerializer json = new Jackson2JsonRedisSerializer<Employee>(Employee.class);
    7.  
      template.setDefaultSerializer(json);
    8.  
      return template;
    9.  
      }

    这样我们来运行序列化

    1.  
      Employee emp = employeeMapper.getEmpById(1);
    2.  
      redisTemplate.opsForValue().set("object",emp);
    3.  
      Object object = redisTemplate.opsForValue().get("object");
    4.  
      System.out.println(object);

    employee对象就被一json的方式序列化了

    缓存原理 

    如果我们不适用redis 他默认是用的是一个ConcurrentMapCacheManager ,使用的是SimpleCacheConfiguration configuration 类

    先看CacheAutoConfiguration

    1.  
      /**
    2.  
      * {@link ImportSelector} to add {@link CacheType} configuration classes.
    3.  
      */
    4.  
      static class CacheConfigurationImportSelector implements ImportSelector {
    5.  
       
    6.  
      @Override
    7.  
      public String[] selectImports(AnnotationMetadata importingClassMetadata) {
    8.  
      CacheType[] types = CacheType.values();
    9.  
      String[] imports = new String[types.length];
    10.  
      for (int i = 0; i < types.length; i++) {
    11.  
      imports[i] = CacheConfigurations.getConfigurationClass(types[i]);
    12.  
      }
    13.  
      return imports;
    14.  
      }
    15.  
       
    16.  
      }
    1.  
      public static String getConfigurationClass(CacheType cacheType) {
    2.  
      Class<?> configurationClass = MAPPINGS.get(cacheType);
    3.  
      Assert.state(configurationClass != null, () -> "Unknown cache type " + cacheType);
    4.  
      return configurationClass.getName();
    5.  
      }
    1.  
      static {
    2.  
      Map<CacheType, Class<?>> mappings = new EnumMap<>(CacheType.class);
    3.  
      mappings.put(CacheType.GENERIC, GenericCacheConfiguration.class);
    4.  
      mappings.put(CacheType.EHCACHE, EhCacheCacheConfiguration.class);
    5.  
      mappings.put(CacheType.HAZELCAST, HazelcastCacheConfiguration.class);
    6.  
      mappings.put(CacheType.INFINISPAN, InfinispanCacheConfiguration.class);
    7.  
      mappings.put(CacheType.JCACHE, JCacheCacheConfiguration.class);
    8.  
      mappings.put(CacheType.COUCHBASE, CouchbaseCacheConfiguration.class);
    9.  
      mappings.put(CacheType.REDIS, RedisCacheConfiguration.class);
    10.  
      mappings.put(CacheType.CAFFEINE, CaffeineCacheConfiguration.class);
    11.  
      mappings.put(CacheType.SIMPLE, SimpleCacheConfiguration.class);
    12.  
      mappings.put(CacheType.NONE, NoOpCacheConfiguration.class);
    13.  
      MAPPINGS = Collections.unmodifiableMap(mappings);
    14.  
      }

    这就是java 所有的缓存配置,默认是simpleCacheConfiguration 为什么我们导入了redis starter   就使用了 redis ? 我们看下启动日志

    1.  
      Negative matches:
    2.  
      -----------------
    3.  
       
    4.  
      ActiveMQAutoConfiguration:
    5.  
      Did not match:
    6.  
      - @ConditionalOnClass did not find required classes 'javax.jms.ConnectionFactory', 'org.apache.activemq.ActiveMQConnectionFactory' (OnClassCondition)
    7.  
       
    8.  
      AopAutoConfiguration:
    9.  
      Did not match:
    10.  
      - @ConditionalOnClass did not find required classes 'org.aspectj.lang.annotation.Aspect', 'org.aspectj.lang.reflect.Advice', 'org.aspectj.weaver.AnnotatedElement' (OnClassCondition)
    11.  
       
    12.  
      ArtemisAutoConfiguration:
    13.  
      Did not match:
    14.  
      - @ConditionalOnClass did not find required classes 'javax.jms.ConnectionFactory', 'org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory' (OnClassCondition)
    15.  
       
    16.  
      BatchAutoConfiguration:
    17.  
      Did not match:
    18.  
      - @ConditionalOnClass did not find required class 'org.springframework.batch.core.launch.JobLauncher' (OnClassCondition)
    19.  
       
    20.  
      CacheAutoConfiguration.CacheManagerJpaDependencyConfiguration:
    21.  
      Did not match:
    22.  
      - @ConditionalOnClass did not find required class 'org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean' (OnClassCondition)
    23.  
       
    24.  
      CaffeineCacheConfiguration:
    25.  
      Did not match:
    26.  
      - @ConditionalOnClass did not find required class 'com.github.benmanes.caffeine.cache.Caffeine' (OnClassCondition)
    27.  
       
    28.  
      CassandraAutoConfiguration:
    29.  
      Did not match:
    30.  
      - @ConditionalOnClass did not find required class 'com.datastax.driver.core.Cluster' (OnClassCondition)
    31.  
       
    32.  
      CassandraDataAutoConfiguration:
    33.  
      Did not match:
    34.  
      - @ConditionalOnClass did not find required classes 'com.datastax.driver.core.Cluster', 'org.springframework.data.cassandra.core.CassandraAdminOperations' (OnClassCondition)
    35.  
       
    36.  
      CassandraReactiveDataAutoConfiguration:
    37.  
      Did not match:
    38.  
      - @ConditionalOnClass did not find required classes 'com.datastax.driver.core.Cluster', 'org.springframework.data.cassandra.core.ReactiveCassandraTemplate' (OnClassCondition)
    39.  
       
    40.  
      CassandraReactiveRepositoriesAutoConfiguration:
    41.  
      Did not match:
    42.  
      - @ConditionalOnClass did not find required classes 'org.springframework.data.cassandra.ReactiveSession', 'org.springframework.data.cassandra.repository.ReactiveCassandraRepository' (OnClassCondition)
    43.  
       
    44.  
      CassandraRepositoriesAutoConfiguration:
    45.  
      Did not match:
    46.  
      - @ConditionalOnClass did not find required classes 'com.datastax.driver.core.Session', 'org.springframework.data.cassandra.repository.CassandraRepository' (OnClassCondition)
    47.  
       
    48.  
      CloudAutoConfiguration:
    49.  
      Did not match:
    50.  
      - @ConditionalOnClass did not find required class 'org.springframework.cloud.config.java.CloudScanConfiguration' (OnClassCondition)
    51.  
       
    52.  
      CouchbaseAutoConfiguration:
    53.  
      Did not match:
    54.  
      - @ConditionalOnClass did not find required classes 'com.couchbase.client.java.CouchbaseBucket', 'com.couchbase.client.java.Cluster' (OnClassCondition)
    55.  
       
    56.  
      CouchbaseCacheConfiguration:
    57.  
      Did not match:
    58.  
      - @ConditionalOnClass did not find required classes 'com.couchbase.client.java.Bucket', 'com.couchbase.client.spring.cache.CouchbaseCacheManager' (OnClassCondition)
    59.  
       
    60.  
      CouchbaseDataAutoConfiguration:
    61.  
      Did not match:
    62.  
      - @ConditionalOnClass did not find required classes 'com.couchbase.client.java.Bucket', 'org.springframework.data.couchbase.repository.CouchbaseRepository' (OnClassCondition)
    63.  
       
    64.  
      CouchbaseReactiveDataAutoConfiguration:
    65.  
      Did not match:
    66.  
      - @ConditionalOnClass did not find required classes 'com.couchbase.client.java.Bucket', 'org.springframework.data.couchbase.repository.ReactiveCouchbaseRepository' (OnClassCondition)
    67.  
       
    68.  
      CouchbaseReactiveRepositoriesAutoConfiguration:
    69.  
      Did not match:
    70.  
      - @ConditionalOnClass did not find required classes 'com.couchbase.client.java.Bucket', 'org.springframework.data.couchbase.repository.ReactiveCouchbaseRepository' (OnClassCondition)
    71.  
       
    72.  
      CouchbaseRepositoriesAutoConfiguration:
    73.  
      Did not match:
    74.  
      - @ConditionalOnClass did not find required classes 'com.couchbase.client.java.Bucket', 'org.springframework.data.couchbase.repository.CouchbaseRepository' (OnClassCondition)
    75.  
       
    76.  
      DataSourceAutoConfiguration.EmbeddedDatabaseConfiguration:
    77.  
      Did not match:
    78.  
      - EmbeddedDataSource found supported pooled data source (DataSourceAutoConfiguration.EmbeddedDatabaseCondition)
    79.  
       
    80.  
      DataSourceConfiguration.Dbcp2:
    81.  
      Did not match:
    82.  
      - @ConditionalOnClass did not find required class 'org.apache.commons.dbcp2.BasicDataSource' (OnClassCondition)
    83.  
       
    84.  
      DataSourceConfiguration.Generic:
    85.  
      Did not match:
    86.  
      - @ConditionalOnProperty (spring.datasource.type) did not find property 'spring.datasource.type' (OnPropertyCondition)
    87.  
       
    88.  
      DataSourceConfiguration.Tomcat:
    89.  
      Did not match:
    90.  
      - @ConditionalOnClass did not find required class 'org.apache.tomcat.jdbc.pool.DataSource' (OnClassCondition)
    91.  
       
    92.  
      DataSourceJmxConfiguration.TomcatDataSourceJmxConfiguration:
    93.  
      Did not match:
    94.  
      - @ConditionalOnClass did not find required class 'org.apache.tomcat.jdbc.pool.DataSourceProxy' (OnClassCondition)
    95.  
       
    96.  
      DataSourcePoolMetadataProvidersConfiguration.CommonsDbcp2PoolDataSourceMetadataProviderConfiguration:
    97.  
      Did not match:
    98.  
      - @ConditionalOnClass did not find required class 'org.apache.commons.dbcp2.BasicDataSource' (OnClassCondition)
    99.  
       
    100.  
      DataSourcePoolMetadataProvidersConfiguration.TomcatDataSourcePoolMetadataProviderConfiguration:
    101.  
      Did not match:
    102.  
      - @ConditionalOnClass did not find required class 'org.apache.tomcat.jdbc.pool.DataSource' (OnClassCondition)
    103.  
       
    104.  
      DevToolsDataSourceAutoConfiguration.DatabaseShutdownExecutorJpaDependencyConfiguration:
    105.  
      Did not match:
    106.  
      - @ConditionalOnClass did not find required class 'org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean' (OnClassCondition)
    107.  
       
    108.  
      DispatcherServletAutoConfiguration.DispatcherServletConfiguration#multipartResolver:
    109.  
      Did not match:
    110.  
      - @ConditionalOnBean (types: org.springframework.web.multipart.MultipartResolver; SearchStrategy: all) did not find any beans of type org.springframework.web.multipart.MultipartResolver (OnBeanCondition)
    111.  
       
    112.  
      EhCacheCacheConfiguration:
    113.  
      Did not match:
    114.  
      - @ConditionalOnClass did not find required class 'net.sf.ehcache.Cache' (OnClassCondition)
    115.  
       
    116.  
      ElasticsearchAutoConfiguration:
    117.  
      Did not match:
    118.  
      - @ConditionalOnClass did not find required classes 'org.elasticsearch.client.Client', 'org.springframework.data.elasticsearch.client.TransportClientFactoryBean' (OnClassCondition)
    119.  
       
    120.  
      ElasticsearchDataAutoConfiguration:
    121.  
      Did not match:
    122.  
      - @ConditionalOnClass did not find required classes 'org.elasticsearch.client.Client', 'org.springframework.data.elasticsearch.core.ElasticsearchTemplate' (OnClassCondition)
    123.  
       
    124.  
      ElasticsearchRepositoriesAutoConfiguration:
    125.  
      Did not match:
    126.  
      - @ConditionalOnClass did not find required classes 'org.elasticsearch.client.Client', 'org.springframework.data.elasticsearch.repository.ElasticsearchRepository' (OnClassCondition)
    127.  
       
    128.  
      EmbeddedLdapAutoConfiguration:
    129.  
      Did not match:
    130.  
      - @ConditionalOnClass did not find required class 'com.unboundid.ldap.listener.InMemoryDirectoryServer' (OnClassCondition)
    131.  
       
    132.  
      EmbeddedMongoAutoConfiguration:
    133.  
      Did not match:
    134.  
      - @ConditionalOnClass did not find required classes 'com.mongodb.MongoClient', 'de.flapdoodle.embed.mongo.MongodStarter' (OnClassCondition)
    135.  
       
    136.  
      EmbeddedWebServerFactoryCustomizerAutoConfiguration.JettyWebServerFactoryCustomizerConfiguration:
    137.  
      Did not match:
    138.  
      - @ConditionalOnClass did not find required classes 'org.eclipse.jetty.server.Server', 'org.eclipse.jetty.util.Loader', 'org.eclipse.jetty.webapp.WebAppContext' (OnClassCondition)
    139.  
       
    140.  
      EmbeddedWebServerFactoryCustomizerAutoConfiguration.UndertowWebServerFactoryCustomizerConfiguration:
    141.  
      Did not match:
    142.  
      - @ConditionalOnClass did not find required classes 'io.undertow.Undertow', 'org.xnio.SslClientAuthMode' (OnClassCondition)
    143.  
       
    144.  
      ErrorWebFluxAutoConfiguration:
    145.  
      Did not match:
    146.  
      - @ConditionalOnClass did not find required class 'org.springframework.web.reactive.config.WebFluxConfigurer' (OnClassCondition)
    147.  
       
    148.  
      FlywayAutoConfiguration:
    149.  
      Did not match:
    150.  
      - @ConditionalOnClass did not find required class 'org.flywaydb.core.Flyway' (OnClassCondition)
    151.  
       
    152.  
      FreeMarkerAutoConfiguration:
    153.  
      Did not match:
    154.  
      - @ConditionalOnClass did not find required class 'freemarker.template.Configuration' (OnClassCondition)
    155.  
       
    156.  
      GenericCacheConfiguration:
    157.  
      Did not match:
    158.  
      - @ConditionalOnBean (types: org.springframework.cache.Cache; SearchStrategy: all) did not find any beans of type org.springframework.cache.Cache (OnBeanCondition)
    159.  
      Matched:
    160.  
      - Cache org.springframework.boot.autoconfigure.cache.GenericCacheConfiguration automatic cache type (CacheCondition)
    161.  
       
    162.  
      GroovyTemplateAutoConfiguration:
    163.  
      Did not match:
    164.  
      - @ConditionalOnClass did not find required class 'groovy.text.markup.MarkupTemplateEngine' (OnClassCondition)
    165.  
       
    166.  
      GsonAutoConfiguration:
    167.  
      Did not match:
    168.  
      - @ConditionalOnClass did not find required class 'com.google.gson.Gson' (OnClassCondition)
    169.  
       
    170.  
      GsonHttpMessageConvertersConfiguration:
    171.  
      Did not match:
    172.  
      - @ConditionalOnClass did not find required class 'com.google.gson.Gson' (OnClassCondition)
    173.  
       
    174.  
      H2ConsoleAutoConfiguration:
    175.  
      Did not match:
    176.  
      - @ConditionalOnClass did not find required class 'org.h2.server.web.WebServlet' (OnClassCondition)
    177.  
       
    178.  
      HazelcastAutoConfiguration:
    179.  
      Did not match:
    180.  
      - @ConditionalOnClass did not find required class 'com.hazelcast.core.HazelcastInstance' (OnClassCondition)
    181.  
       
    182.  
      HazelcastCacheConfiguration:
    183.  
      Did not match:
    184.  
      - @ConditionalOnClass did not find required classes 'com.hazelcast.core.HazelcastInstance', 'com.hazelcast.spring.cache.HazelcastCacheManager' (OnClassCondition)
    185.  
       
    186.  
      HazelcastJpaDependencyAutoConfiguration:
    187.  
      Did not match:
    188.  
      - @ConditionalOnClass did not find required classes 'com.hazelcast.core.HazelcastInstance', 'org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean' (OnClassCondition)
    189.  
       
    190.  
      HibernateJpaAutoConfiguration:
    191.  
      Did not match:
    192.  
      - @ConditionalOnClass did not find required classes 'org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean', 'javax.persistence.EntityManager' (OnClassCondition)
    193.  
       
    194.  
      HttpHandlerAutoConfiguration:
    195.  
      Did not match:
    196.  
      - @ConditionalOnClass did not find required class 'org.springframework.web.reactive.DispatcherHandler' (OnClassCondition)
    197.  
       
    198.  
      HypermediaAutoConfiguration:
    199.  
      Did not match:
    200.  
      - @ConditionalOnClass did not find required classes 'org.springframework.hateoas.Resource', 'org.springframework.plugin.core.Plugin' (OnClassCondition)
    201.  
       
    202.  
      InfinispanCacheConfiguration:
    203.  
      Did not match:
    204.  
      - @ConditionalOnClass did not find required class 'org.infinispan.spring.provider.SpringEmbeddedCacheManager' (OnClassCondition)
    205.  
       
    206.  
      InfluxDbAutoConfiguration:
    207.  
      Did not match:
    208.  
      - @ConditionalOnClass did not find required class 'org.influxdb.InfluxDB' (OnClassCondition)
    209.  
       
    210.  
      IntegrationAutoConfiguration:
    211.  
      Did not match:
    212.  
      - @ConditionalOnClass did not find required class 'org.springframework.integration.config.EnableIntegration' (OnClassCondition)
    213.  
       
    214.  
      JCacheCacheConfiguration:
    215.  
      Did not match:
    216.  
      - @ConditionalOnClass did not find required class 'javax.cache.Caching' (OnClassCondition)
    217.  
       
    218.  
      JacksonAutoConfiguration.JodaDateTimeJacksonConfiguration:
    219.  
      Did not match:
    220.  
      - @ConditionalOnClass did not find required classes 'org.joda.time.DateTime', 'com.fasterxml.jackson.datatype.joda.ser.DateTimeSerializer', 'com.fasterxml.jackson.datatype.joda.cfg.JacksonJodaDateFormat' (OnClassCondition)
    221.  
       
    222.  
      JacksonHttpMessageConvertersConfiguration.MappingJackson2XmlHttpMessageConverterConfiguration:
    223.  
      Did not match:
    224.  
      - @ConditionalOnClass did not find required class 'com.fasterxml.jackson.dataformat.xml.XmlMapper' (OnClassCondition)
    225.  
       
    226.  
      JedisConnectionConfiguration:
    227.  
      Did not match:
    228.  
      - @ConditionalOnClass did not find required classes 'org.apache.commons.pool2.impl.GenericObjectPool', 'redis.clients.jedis.Jedis' (OnClassCondition)
    229.  
       
    230.  
      JerseyAutoConfiguration:
    231.  
      Did not match:
    232.  
      - @ConditionalOnClass did not find required class 'org.glassfish.jersey.server.spring.SpringComponentProvider' (OnClassCondition)
    233.  
       
    234.  
      JestAutoConfiguration:
    235.  
      Did not match:
    236.  
      - @ConditionalOnClass did not find required class 'io.searchbox.client.JestClient' (OnClassCondition)
    237.  
       
    238.  
      JmsAutoConfiguration:
    239.  
      Did not match:
    240.  
      - @ConditionalOnClass did not find required classes 'javax.jms.Message', 'org.springframework.jms.core.JmsTemplate' (OnClassCondition)
    241.  
       
    242.  
      JndiConnectionFactoryAutoConfiguration:
    243.  
      Did not match:
    244.  
      - @ConditionalOnClass did not find required class 'org.springframework.jms.core.JmsTemplate' (OnClassCondition)
    245.  
       
    246.  
      JndiDataSourceAutoConfiguration:
    247.  
      Did not match:
    248.  
      - @ConditionalOnProperty (spring.datasource.jndi-name) did not find property 'jndi-name' (OnPropertyCondition)
    249.  
      Matched:
    250.  
      - @ConditionalOnClass found required classes 'javax.sql.DataSource', 'org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    251.  
       
    252.  
      JooqAutoConfiguration:
    253.  
      Did not match:
    254.  
      - @ConditionalOnClass did not find required class 'org.jooq.DSLContext' (OnClassCondition)
    255.  
       
    256.  
      JpaRepositoriesAutoConfiguration:
    257.  
      Did not match:
    258.  
      - @ConditionalOnClass did not find required class 'org.springframework.data.jpa.repository.JpaRepository' (OnClassCondition)
    259.  
       
    260.  
      JsonbAutoConfiguration:
    261.  
      Did not match:
    262.  
      - @ConditionalOnClass did not find required class 'javax.json.bind.Jsonb' (OnClassCondition)
    263.  
       
    264.  
      JsonbHttpMessageConvertersConfiguration:
    265.  
      Did not match:
    266.  
      - @ConditionalOnClass did not find required class 'javax.json.bind.Jsonb' (OnClassCondition)
    267.  
       
    268.  
      JtaAutoConfiguration:
    269.  
      Did not match:
    270.  
      - @ConditionalOnClass did not find required class 'javax.transaction.Transaction' (OnClassCondition)
    271.  
       
    272.  
      KafkaAutoConfiguration:
    273.  
      Did not match:
    274.  
      - @ConditionalOnClass did not find required class 'org.springframework.kafka.core.KafkaTemplate' (OnClassCondition)
    275.  
       
    276.  
      LdapAutoConfiguration:
    277.  
      Did not match:
    278.  
      - @ConditionalOnClass did not find required class 'org.springframework.ldap.core.ContextSource' (OnClassCondition)
    279.  
       
    280.  
      LdapDataAutoConfiguration:
    281.  
      Did not match:
    282.  
      - @ConditionalOnClass did not find required class 'org.springframework.data.ldap.repository.LdapRepository' (OnClassCondition)
    283.  
       
    284.  
      LdapRepositoriesAutoConfiguration:
    285.  
      Did not match:
    286.  
      - @ConditionalOnClass did not find required class 'org.springframework.data.ldap.repository.LdapRepository' (OnClassCondition)
    287.  
       
    288.  
      LiquibaseAutoConfiguration:
    289.  
      Did not match:
    290.  
      - @ConditionalOnClass did not find required classes 'liquibase.integration.spring.SpringLiquibase', 'liquibase.change.DatabaseChange' (OnClassCondition)
    291.  
       
    292.  
      MailSenderAutoConfiguration:
    293.  
      Did not match:
    294.  
      - @ConditionalOnClass did not find required class 'javax.mail.internet.MimeMessage' (OnClassCondition)
    295.  
       
    296.  
      MailSenderValidatorAutoConfiguration:
    297.  
      Did not match:
    298.  
      - @ConditionalOnProperty (spring.mail.test-connection) did not find property 'test-connection' (OnPropertyCondition)
    299.  
       
    300.  
      MessageSourceAutoConfiguration:
    301.  
      Did not match:
    302.  
      - ResourceBundle did not find bundle with basename messages (MessageSourceAutoConfiguration.ResourceBundleCondition)
    303.  
       
    304.  
      MongoAutoConfiguration:
    305.  
      Did not match:
    306.  
      - @ConditionalOnClass did not find required class 'com.mongodb.MongoClient' (OnClassCondition)
    307.  
       
    308.  
      MongoDataAutoConfiguration:
    309.  
      Did not match:
    310.  
      - @ConditionalOnClass did not find required classes 'com.mongodb.MongoClient', 'org.springframework.data.mongodb.core.MongoTemplate' (OnClassCondition)
    311.  
       
    312.  
      MongoReactiveAutoConfiguration:
    313.  
      Did not match:
    314.  
      - @ConditionalOnClass did not find required class 'com.mongodb.reactivestreams.client.MongoClient' (OnClassCondition)
    315.  
       
    316.  
      MongoReactiveDataAutoConfiguration:
    317.  
      Did not match:
    318.  
      - @ConditionalOnClass did not find required classes 'com.mongodb.reactivestreams.client.MongoClient', 'org.springframework.data.mongodb.core.ReactiveMongoTemplate' (OnClassCondition)
    319.  
       
    320.  
      MongoReactiveRepositoriesAutoConfiguration:
    321.  
      Did not match:
    322.  
      - @ConditionalOnClass did not find required classes 'com.mongodb.reactivestreams.client.MongoClient', 'org.springframework.data.mongodb.repository.ReactiveMongoRepository' (OnClassCondition)
    323.  
       
    324.  
      MongoRepositoriesAutoConfiguration:
    325.  
      Did not match:
    326.  
      - @ConditionalOnClass did not find required classes 'com.mongodb.MongoClient', 'org.springframework.data.mongodb.repository.MongoRepository' (OnClassCondition)
    327.  
       
    328.  
      MustacheAutoConfiguration:
    329.  
      Did not match:
    330.  
      - @ConditionalOnClass did not find required class 'com.samskivert.mustache.Mustache' (OnClassCondition)
    331.  
       
    332.  
      MybatisAutoConfiguration.MapperScannerRegistrarNotFoundConfiguration:
    333.  
      Did not match:
    334.  
      - @ConditionalOnMissingBean (types: org.mybatis.spring.mapper.MapperFactoryBean; SearchStrategy: all) found beans of type 'org.mybatis.spring.mapper.MapperFactoryBean' &departmentMapper, &employeeMapper (OnBeanCondition)
    335.  
       
    336.  
      Neo4jDataAutoConfiguration:
    337.  
      Did not match:
    338.  
      - @ConditionalOnClass did not find required classes 'org.neo4j.ogm.session.SessionFactory', 'org.springframework.data.neo4j.transaction.Neo4jTransactionManager' (OnClassCondition)
    339.  
       
    340.  
      Neo4jRepositoriesAutoConfiguration:
    341.  
      Did not match:
    342.  
      - @ConditionalOnClass did not find required classes 'org.neo4j.ogm.session.Neo4jSession', 'org.springframework.data.neo4j.repository.Neo4jRepository' (OnClassCondition)
    343.  
       
    344.  
      NoOpCacheConfiguration:
    345.  
      Did not match:
    346.  
      - @ConditionalOnMissingBean (types: org.springframework.cache.CacheManager; SearchStrategy: all) found beans of type 'org.springframework.cache.CacheManager' cacheManager (OnBeanCondition)
    347.  
      Matched:
    348.  
      - Cache org.springframework.boot.autoconfigure.cache.NoOpCacheConfiguration automatic cache type (CacheCondition)
    349.  
       
    350.  
      OAuth2ClientAutoConfiguration:
    351.  
      Did not match:
    352.  
      - @ConditionalOnClass did not find required classes 'org.springframework.security.config.annotation.web.configuration.EnableWebSecurity', 'org.springframework.security.oauth2.client.registration.ClientRegistration' (OnClassCondition)
    353.  
       
    354.  
      ProjectInfoAutoConfiguration#buildProperties:
    355.  
      Did not match:
    356.  
      - @ConditionalOnResource did not find resource '${spring.info.build.location:classpath:META-INF/build-info.properties}' (OnResourceCondition)
    357.  
       
    358.  
      ProjectInfoAutoConfiguration#gitProperties:
    359.  
      Did not match:
    360.  
      - GitResource did not find git info at classpath:git.properties (ProjectInfoAutoConfiguration.GitResourceAvailableCondition)
    361.  
       
    362.  
      QuartzAutoConfiguration:
    363.  
      Did not match:
    364.  
      - @ConditionalOnClass did not find required class 'org.quartz.Scheduler' (OnClassCondition)
    365.  
       
    366.  
      RabbitAutoConfiguration:
    367.  
      Did not match:
    368.  
      - @ConditionalOnClass did not find required classes 'org.springframework.amqp.rabbit.core.RabbitTemplate', 'com.rabbitmq.client.Channel' (OnClassCondition)
    369.  
       
    370.  
      ReactiveUserDetailsServiceAutoConfiguration:
    371.  
      Did not match:
    372.  
      - @ConditionalOnClass did not find required class 'org.springframework.security.authentication.ReactiveAuthenticationManager' (OnClassCondition)
    373.  
       
    374.  
      ReactiveWebServerFactoryAutoConfiguration:
    375.  
      Did not match:
    376.  
      - not a reactive web application (OnWebApplicationCondition)
    377.  
      Matched:
    378.  
      - @ConditionalOnClass found required class 'org.springframework.http.ReactiveHttpInputMessage'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    379.  
       
    380.  
      RedisAutoConfiguration#redisTemplate:
    381.  
      Did not match:
    382.  
      - @ConditionalOnMissingBean (names: redisTemplate; SearchStrategy: all) found beans named redisTemplate (OnBeanCondition)
    383.  
       
    384.  
      RemoteDevToolsAutoConfiguration:
    385.  
      Did not match:
    386.  
      - @ConditionalOnProperty (spring.devtools.remote.secret) did not find property 'secret' (OnPropertyCondition)
    387.  
      Matched:
    388.  
      - @ConditionalOnClass found required classes 'javax.servlet.Filter', 'org.springframework.http.server.ServerHttpRequest'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
    389.  
       
    390.  
      RepositoryRestMvcAutoConfiguration:
    391.  
      Did not match:
    392.  
      - @ConditionalOnClass did not find required class 'org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration' (OnClassCondition)
    393.  
       
    394.  
      SecurityAutoConfiguration:
    395.  
      Did not match:
    396.  
      - @ConditionalOnClass did not find required class 'org.springframework.security.authentication.DefaultAuthenticationEventPublisher' (OnClassCondition)
    397.  
       
    398.  
      SecurityFilterAutoConfiguration:
    399.  
      Did not match:
    400.  
      - @ConditionalOnClass did not find required classes 'org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer', 'org.springframework.security.config.http.SessionCreationPolicy' (OnClassCondition)
    401.  
       
    402.  
      SendGridAutoConfiguration:
    403.  
      Did not match:
    404.  
      - @ConditionalOnClass did not find required class 'com.sendgrid.SendGrid' (OnClassCondition)
    405.  
       
    406.  
      ServletWebServerFactoryConfiguration.EmbeddedJetty:
    407.  
      Did not match:
    408.  
      - @ConditionalOnClass did not find required classes 'org.eclipse.jetty.server.Server', 'org.eclipse.jetty.util.Loader', 'org.eclipse.jetty.webapp.WebAppContext' (OnClassCondition)
    409.  
       
    410.  
      ServletWebServerFactoryConfiguration.EmbeddedUndertow:
    411.  
      Did not match:
    412.  
      - @ConditionalOnClass did not find required classes 'io.undertow.Undertow', 'org.xnio.SslClientAuthMode' (OnClassCondition)
    413.  
       
    414.  
      SessionAutoConfiguration:
    415.  
      Did not match:
    416.  
      - @ConditionalOnClass did not find required class 'org.springframework.session.Session' (OnClassCondition)
    417.  
       
    418.  
      SimpleCacheConfiguration:
    419.  
      Did not match:
    420.  
      - @ConditionalOnMissingBean (types: org.springframework.cache.CacheManager; SearchStrategy: all) found beans of type 'org.springframework.cache.CacheManager' cacheManager (OnBeanCondition)
    421.  
      Matched:
    422.  
      - Cache org.springframework.boot.autoconfigure.cache.SimpleCacheConfiguration automatic cache type (CacheCondition)

    simpleCacheConfiguration 是被排除的为什么?  

    1.  
      @Configuration
    2.  
      @ConditionalOnMissingBean(CacheManager.class)
    3.  
      @Conditional(CacheCondition.class)
    4.  
      class SimpleCacheConfiguration {

    @ConditionaLOnMissingBean 这个注解, 

    意思说看看容器中有没有CacheManager 这种类型的组件,如果有这个类就GG 不会被加载容器中 ,

    之前说过

    1.  
      static {
    2.  
      Map<CacheType, Class<?>> mappings = new EnumMap<>(CacheType.class);
    3.  
      mappings.put(CacheType.GENERIC, GenericCacheConfiguration.class);
    4.  
      mappings.put(CacheType.EHCACHE, EhCacheCacheConfiguration.class);
    5.  
      mappings.put(CacheType.HAZELCAST, HazelcastCacheConfiguration.class);
    6.  
      mappings.put(CacheType.INFINISPAN, InfinispanCacheConfiguration.class);
    7.  
      mappings.put(CacheType.JCACHE, JCacheCacheConfiguration.class);
    8.  
      mappings.put(CacheType.COUCHBASE, CouchbaseCacheConfiguration.class);
    9.  
      mappings.put(CacheType.REDIS, RedisCacheConfiguration.class);
    10.  
      mappings.put(CacheType.CAFFEINE, CaffeineCacheConfiguration.class);
    11.  
      mappings.put(CacheType.SIMPLE, SimpleCacheConfiguration.class);
    12.  
      mappings.put(CacheType.NONE, NoOpCacheConfiguration.class);
    13.  
      MAPPINGS = Collections.unmodifiableMap(mappings);
    14.  
      }

    这些Configuraction 都是按照顺序加载的,我们看到redisCacheConfiguration 比SimpleCacheConfiguration 的顺序级别高,因此当加载到simpleCacheConfiguration 已经通过redisCacheConfiuration 创建了 RedisCacheManager  ,因此不会创建了simpleCacheConfiguraction 

    redisCacheManager 干什么? 

    他是通过redisCache来完成缓存的

    1.  
      protected RedisCache createRedisCache(String name, @Nullable RedisCacheConfiguration cacheConfig) {
    2.  
      return new RedisCache(name, cacheWriter, cacheConfig != null ? cacheConfig : defaultCacheConfig);
    3.  
      }

    redisCache通过操作redis 来进行缓存数据

    默认保存数据是一k-v的形式存储的,都是object,利用序列化保存

    如何存为json ? 

    配置一个自定义个rediscacheManger 

    1.  
      package com.zzq.springboot01cache.config;
    2.  
       
    3.  
      import com.sun.org.apache.bcel.internal.generic.RET;
    4.  
      import com.sun.org.apache.bcel.internal.generic.RETURN;
    5.  
      import com.zzq.springboot01cache.entity.Department;
    6.  
      import com.zzq.springboot01cache.entity.Employee;
    7.  
      import org.springframework.boot.autoconfigure.cache.CacheManagerCustomizer;
    8.  
      import org.springframework.cache.CacheManager;
    9.  
      import org.springframework.cache.annotation.CachingConfigurerSupport;
    10.  
       
    11.  
      import org.springframework.cache.interceptor.KeyGenerator;
    12.  
      import org.springframework.context.annotation.Bean;
    13.  
      import org.springframework.context.annotation.Configuration;
    14.  
      import org.springframework.core.io.ResourceLoader;
    15.  
      import org.springframework.data.redis.cache.RedisCacheConfiguration;
    16.  
      import org.springframework.data.redis.cache.RedisCacheManager;
    17.  
      import org.springframework.data.redis.connection.RedisConnectionFactory;
    18.  
      import org.springframework.data.redis.core.RedisTemplate;
    19.  
      import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
    20.  
      import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
    21.  
      import org.springframework.data.redis.serializer.RedisSerializationContext;
    22.  
      import org.springframework.data.redis.serializer.StringRedisSerializer;
    23.  
       
    24.  
      import java.net.UnknownHostException;
    25.  
      import java.time.Duration;
    26.  
      import java.util.Arrays;
    27.  
       
    28.  
       
    29.  
      @Configuration
    30.  
      public class MyredisConfig {
    31.  
       
    32.  
      @Bean("myKeyGenerator")
    33.  
      public KeyGenerator keyGenerator(){
    34.  
      return (target,method,params)->{
    35.  
      return method.getName()+"["+ Arrays.asList(params)+"]";
    36.  
      };
    37.  
      }
    38.  
       
    39.  
      @Bean
    40.  
      public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) {
    41.  
      RedisTemplate<Object, Object> redisTemplate = new RedisTemplate<>();
    42.  
      redisTemplate.setConnectionFactory(redisConnectionFactory);
    43.  
      // key序列化
    44.  
      redisTemplate.setKeySerializer(new StringRedisSerializer());
    45.  
      // value序列化
    46.  
      redisTemplate.setValueSerializer(new Jackson2JsonRedisSerializer(Object.class));
    47.  
      redisTemplate.afterPropertiesSet();
    48.  
      System.out.println("RedisTemplate loading.............");
    49.  
      return redisTemplate;
    50.  
      }
    51.  
       
    52.  
       
    53.  
      @Bean
    54.  
      public CacheManager cacheManager(RedisConnectionFactory factory) {
    55.  
      RedisCacheConfiguration cacheConfiguration =
    56.  
      RedisCacheConfiguration.defaultCacheConfig()
    57.  
      .entryTtl(Duration.ofDays(1))
    58.  
      .disableCachingNullValues()
    59.  
      .serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(new
    60.  
      GenericJackson2JsonRedisSerializer()));
    61.  
      return RedisCacheManager.builder(factory).cacheDefaults(cacheConfiguration).build();
    62.  
      }
    63.  
       
    64.  
       
    65.  
       
    66.  
      }

    这个参考

    rediscacheconfiguraction 写

    1.  
       
    2.  
      @Bean
    3.  
      public RedisCacheManager cacheManager(RedisConnectionFactory redisConnectionFactory,
    4.  
      ResourceLoader resourceLoader) {
    5.  
      RedisCacheManagerBuilder builder = RedisCacheManager
    6.  
      .builder(redisConnectionFactory)
    7.  
      .cacheDefaults(determineConfiguration(resourceLoader.getClassLoader()));
    8.  
      List<String> cacheNames = this.cacheProperties.getCacheNames();
    9.  
      if (!cacheNames.isEmpty()) {
    10.  
      builder.initialCacheNames(new LinkedHashSet<>(cacheNames));
    11.  
      }
    12.  
      return this.customizerInvoker.customize(builder.build());
    13.  
      }

    转自:https://blog.csdn.net/qq_39148187/article/details/82469062

  • 相关阅读:
    什么是webview
    juqery.fn.extend和jquery.extend
    LeetCode
    5. Longest Palindromic Substring
    42. Trapping Rain Water
    11. Container With Most Water
    621. Task Scheduler
    49. Group Anagrams
    739. Daily Temperatures
    3. Longest Substring Without Repeating Characters
  • 原文地址:https://www.cnblogs.com/javalinux/p/14339550.html
Copyright © 2011-2022 走看看