spring-boot整合shiro作权限认证

spring-shiro属于轻量级权限框架,即使spring-security更新换代,市场上大多数企业还是选择shiro

废话不多说  引入pom文件

1         <!--shiro集成spring-->
2         <dependency>
3             <groupId>org.apache.shiro</groupId>
4             <artifactId>shiro-spring</artifactId>
5             <version>1.3.2</version>
6         </dependency>
7         

导入之后 相关依赖包就会自动加载 shiro-core、shiro-spring、shiro-web等等  依赖版本还得根据shiro集成的spring版本进行加载

二:自定义Reaml域

  继承 AuthorizingRealm 实现 授权方法

doGetAuthorizationInfo(PrincipalCollection principals){}

  和 认证方法

doGetAuthenticationInfo(AuthenticationToken token){}
  1 3 import com.example.runtest.dao.PublicUserDao;
  2   4 import com.example.runtest.entity.SysUser;
  3   5 import com.example.runtest.entity.SysPermission;
  4   6 import com.example.runtest.entity.SysRole;
  5   7 import org.apache.shiro.authc.AuthenticationException;
  6   8 import org.apache.shiro.authc.AuthenticationInfo;
  7   9 import org.apache.shiro.authc.AuthenticationToken;
  8  10 import org.apache.shiro.authc.SimpleAuthenticationInfo;
  9  11 import org.apache.shiro.authz.AuthorizationInfo;
 10  12 import org.apache.shiro.authz.SimpleAuthorizationInfo;
 11  13 import org.apache.shiro.realm.AuthorizingRealm;
 12  14 import org.apache.shiro.subject.PrincipalCollection;
 13  15 import org.apache.shiro.util.ByteSource;
 14  16 import org.springframework.beans.factory.annotation.Autowired;
 15  17 
 16  18 /**自定义Reaml域
 17  19  * @author wusiwei
 18  20  * @date 2019/5/28 9:25
 19  21  */
 20  22 
 21  23 public class ShiroReaml extends AuthorizingRealm {
 22  24 
 23  25     @Autowired
 24  26     private PublicUserDao publicUserDao;
 25  27 
 26  28 /** @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 27  29     @@@@@@@@@@@@@@@@@@@@@@@'~~~     ~~~`@@@@@@@@@@@@@@@@@@@@@@@@@
 28  30     @@@@@@@@@@@@@@@@@@'                     `@@@@@@@@@@@@@@@@@@@@
 29  31     @@@@@@@@@@@@@@@'                           `@@@@@@@@@@@@@@@@@
 30  32     @@@@@@@@@@@@@'                               `@@@@@@@@@@@@@@@
 31  33     @@@@@@@@@@@'                                   `@@@@@@@@@@@@@
 32  34     @@@@@@@@@@'                                     `@@@@@@@@@@@@
 33  35     @@@@@@@@@'                                       `@@@@@@@@@@@
 34  36     @@@@@@@@@                                         @@@@@@@@@@@
 35  37     @@@@@@@@'                      n,                 `@@@@@@@@@@
 36  38     @@@@@@@@                     _/ | _                @@@@@@@@@@
 37  39     @@@@@@@@                    /'  `'/                @@@@@@@@@@
 38  40     @@@@@@@@a                 <~    .'                a@@@@@@@@@@
 39  41     @@@@@@@@@                 .'    |                 @@@@@@@@@@@
 40  42     @@@@@@@@@a              _/      |                a@@@@@@@@@@@
 41  43     @@@@@@@@@@a           _/      `.`.              a@@@@@@@@@@@@
 42  44     @@@@@@@@@@@a     ____/ '   \__ | |______       a@@@@@@@@@@@@@
 43  45     @@@@@@@@@@@@@a__/___/      /__\ \ \     \___.a@@@@@@@@@@@@@@@
 44  46     @@@@@@@@@@@@@/  (___.'\_______)\_|_|        \@@@@@@@@@@@@@@@@
 45  47     @@@@@@@@@@@@|\________                       ~~~~~\@@@@@@@@@@
 46  48                         苍狼保佑,永无bug
 47  49     */
 48  50     /**
 49  51      * 授权
 50  52      *
 51  53      * @param principals
 52  54      * @return
 53  55      */
 54  56     @Override
 55  57     protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
 56  58         System.out.println(" 授权方法执行..................");
 57  59         SimpleAuthorizationInfo authorizationInfo = new SimpleAuthorizationInfo();
 58  60         SysUser sysUser = (SysUser)principals.getPrimaryPrincipal();
 59  61 
 60  62         //遍历用户角色信息
 61  63         for (SysRole role: sysUser.getRoleList()) {
 62  64             authorizationInfo.addRole(role.getRole());
 63  65             //获取用户权限信息
 64  66             for (SysPermission permission:role.getPermissions()) {
 65  67                 authorizationInfo.addStringPermission(permission.getPermission());
 66  68             }
 67  69         }
 68  70         return authorizationInfo;
 69  71     }
 70  72 
 71  73     /**
 72  74      * 认证
 73  75      *
 74  76      * @param token
 75  77      * @return
 76  78      * @throws AuthenticationException
 77  79      */
 78  80     @Override
 79  81     protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
 80  82         System.out.println("MyShiroRealm.doGetAuthenticationInfo()认证执行.......");
 81  83 
 82  84         //获取登录账户
 83  85         String loginEmail = token.getPrincipal().toString();
 84  86         System.out.println(token.getCredentials() + "这是啥?");
 85  87 
 86  88         //通过username从数据库中查找 User对象,如果找到,没找到.
 87  89         //实际项目中,这里可以根据实际情况做缓存,如果不做,Shiro自己也是有时间间隔机制,2分钟内不会重复执行该方法
 88  90         SysUser siweeEmail = publicUserDao.findBySwEmail(loginEmail);
 89  91         if (siweeEmail == null) {
 90  92             return null;
 91  93         }
 92  94         SimpleAuthenticationInfo authenticationInfo = new SimpleAuthenticationInfo(
 93  95                 loginEmail,
 94  96                 siweeEmail.getSwPassword(),
 95  97                 ByteSource.Util.bytes(siweeEmail.getSwSalt()),
 96  98                 getName()
 97  99         );
 98 100         return authenticationInfo;
 99 101     }
100 102 
101 103 }

开始加载shiro配置文件  在spring-boot中 配置文件是以javaconfig形式被加载  so..look at me 代码上的相关注释我已经加上了

 1 import com.example.runtest.realm.ShiroReaml;
 2 import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
 3 import org.apache.shiro.web.mgt.DefaultWebSecurityManager;
 4 import org.springframework.context.annotation.Bean;
 5 import org.springframework.context.annotation.Configuration;
 6 
 7 import java.util.LinkedHashMap;
 8 
 9 /**
10  *                                ,-.             __
11  *                              ,'   `---.___.---'  `.
12  *                            ,'   ,-                 `-._
13  *                          ,'    /                       \
14  *                       ,\/     /                        \\
15  *                   )`._)>)     |                         \\
16  *                   `>,'    _   \                  /       |\
17  *                     )      \   |   |            |        |\\
18  *            .   ,   /        \  |    `.          |        | ))
19  *            \`. \`-'          )-|      `.        |        /((
20  *             \ `-`   a`     _/ ;\ _     )`-.___.--\      /  `'
21  *              `._         ,'    \`j`.__/        \  `.    \
22  *                / ,    ,'       _)\   /`        _) ( \   /
23  *                \__   /        /nn_) (         /nn__\_) (
24  *                  `--'     hjw   /nn__\             /nn__\
25  *
26  *                               犀牛保佑,永无bug
27  * @author wusiwei
28  * @date 2019/5/29 15:58
29  */
30 @Configuration
31 public class ShiroConfig {
32 
33     @Bean
34     public ShiroFilterFactoryBean shiroFilterFactoryBean(DefaultWebSecurityManager securityManager) {
35         System.out.println("ShiroConfiguration.shiroFilter执行...");
36         ShiroFilterFactoryBean filterFactory = new ShiroFilterFactoryBean();
37         filterFactory.setSecurityManager(securityManager);
38 
39         //拦截器
40         LinkedHashMap<String, String> hashMap = new LinkedHashMap<>();
41         // 配置不会被拦截的链接 按顺序判断
42         hashMap.put("/static/**", "anon");
43         //配置退出 过滤器,其中的具体的退出代码shiro已经替我们实现了
44         hashMap.put("/logout", "logout");
45         //过滤链定义,从上向下顺序执行,一般将/**放在最为下边:这是一个坑呢,一不小心代码就不好使了;
46         //authc:所有url都必须认证通过才可以访问;
47         // anon:所有url都都可以匿名访问
48         hashMap.put("/run/index", "authc");
49         hashMap.put("/run/register", "anon");
50 //        hashMap.put("/**","authc");
51 
52         filterFactory.setLoginUrl("/run/login");
53         filterFactory.setSuccessUrl("/run/index");
54 
55         //未授权页面
56         filterFactory.setUnauthorizedUrl("/run/403");
57         filterFactory.setFilterChainDefinitionMap(hashMap);
58         return filterFactory;
59     }
60 
61     @Bean
62     public DefaultWebSecurityManager securityManager() {
63         DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
64         securityManager.setRealm(shiroReaml());
65         return securityManager;
66     }
67 
68     @Bean
69     public ShiroReaml shiroReaml() {
70         return new ShiroReaml();
71     }
72 }

启动运行springbootApplication.java(Look第60行,shiro已触发执行)

 1 启动,思伟开源平台...
 2 
 3   .   ____          _            __ _ _
 4  /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
 5 ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 6  \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
 7   '  |____| .__|_| |_|_| |_\__, | / / / /
 8  =========|_|==============|___/=/_/_/_/
 9  :: Spring Boot ::        (v2.1.5.RELEASE)
10 
11 2019-06-03 16:00:17.959  INFO 10188 --- [           main] com.example.runtest.RunTestApplication   : Starting RunTestApplication on DESKTOP-42EE3US with PID 10188 (D:\IdeaProjects\run_test\target\classes started by Shands-New in D:\IdeaProjects\run_test)
12 2019-06-03 16:00:17.963  INFO 10188 --- [           main] com.example.runtest.RunTestApplication   : No active profile set, falling back to default profiles: default
13 2019-06-03 16:00:18.773  WARN 10188 --- [           main] o.m.s.mapper.ClassPathMapperScanner      : No MyBatis mapper was found in '[com.example.runtest]' package. Please check your configuration.
14 2019-06-03 16:00:18.814  INFO 10188 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
15 2019-06-03 16:00:18.871  INFO 10188 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 49ms. Found 1 repository interfaces.
16 2019-06-03 16:00:19.113  INFO 10188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$7eb4a134] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
17 2019-06-03 16:00:19.127  INFO 10188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'shiroConfig' of type [com.example.runtest.config.ShiroConfig$$EnhancerBySpringCGLIB$$f91bab02] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
18 2019-06-03 16:00:19.458  INFO 10188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean '(inner bean)#411291e5' of type [org.springframework.beans.factory.config.PropertiesFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
19 2019-06-03 16:00:19.459  INFO 10188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean '(inner bean)#411291e5' of type [java.util.Properties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
20 2019-06-03 16:00:19.463  INFO 10188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean '(inner bean)#5baaae4c' of type [org.springframework.data.repository.core.support.PropertiesBasedNamedQueries] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
21 2019-06-03 16:00:19.466  INFO 10188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean '(inner bean)#6d6cb754' of type [org.springframework.data.repository.core.support.RepositoryFragmentsFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
22 2019-06-03 16:00:19.466  INFO 10188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean '(inner bean)#6d6cb754' of type [org.springframework.data.repository.core.support.RepositoryComposition$RepositoryFragments] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
23 2019-06-03 16:00:19.471  INFO 10188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari' of type [org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari$$EnhancerBySpringCGLIB$$bf340b21] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
24 2019-06-03 16:00:19.490  INFO 10188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties' of type [org.springframework.boot.autoconfigure.jdbc.DataSourceProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
25 2019-06-03 16:00:19.509  INFO 10188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'dataSource' of type [com.zaxxer.hikari.HikariDataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
26 2019-06-03 16:00:19.515  INFO 10188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker' of type [org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
27 2019-06-03 16:00:19.522  INFO 10188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.jpa-org.springframework.boot.autoconfigure.orm.jpa.JpaProperties' of type [org.springframework.boot.autoconfigure.orm.jpa.JpaProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
28 2019-06-03 16:00:19.525  INFO 10188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.jpa.hibernate-org.springframework.boot.autoconfigure.orm.jpa.HibernateProperties' of type [org.springframework.boot.autoconfigure.orm.jpa.HibernateProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
29 2019-06-03 16:00:19.527  INFO 10188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration' of type [org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration$$EnhancerBySpringCGLIB$$13289c3e] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
30 2019-06-03 16:00:19.532  INFO 10188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.transaction-org.springframework.boot.autoconfigure.transaction.TransactionProperties' of type [org.springframework.boot.autoconfigure.transaction.TransactionProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
31 2019-06-03 16:00:19.534  INFO 10188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'platformTransactionManagerCustomizers' of type [org.springframework.boot.autoconfigure.transaction.TransactionManagerCustomizers] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
32 2019-06-03 16:00:19.535  INFO 10188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.jdbc.metadata.DataSourcePoolMetadataProvidersConfiguration$HikariPoolDataSourceMetadataProviderConfiguration' of type [org.springframework.boot.autoconfigure.jdbc.metadata.DataSourcePoolMetadataProvidersConfiguration$HikariPoolDataSourceMetadataProviderConfiguration$$EnhancerBySpringCGLIB$$df0bc918] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
33 2019-06-03 16:00:19.538  INFO 10188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'hikariPoolDataSourceMetadataProvider' of type [org.springframework.boot.autoconfigure.jdbc.metadata.DataSourcePoolMetadataProvidersConfiguration$HikariPoolDataSourceMetadataProviderConfiguration$$Lambda$328/654740048] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
34 2019-06-03 16:00:19.543  INFO 10188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration' of type [org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration$$EnhancerBySpringCGLIB$$9d8b63a3] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
35 2019-06-03 16:00:19.569  INFO 10188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'jpaVendorAdapter' of type [org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
36 2019-06-03 16:00:19.571  INFO 10188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'entityManagerFactoryBuilder' of type [org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
37 2019-06-03 16:00:19.602  INFO 10188 --- [           main] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [
38     name: default
39     ...]
40 2019-06-03 16:00:19.664  INFO 10188 --- [           main] org.hibernate.Version                    : HHH000412: Hibernate Core {5.3.10.Final}
41 2019-06-03 16:00:19.665  INFO 10188 --- [           main] org.hibernate.cfg.Environment            : HHH000206: hibernate.properties not found
42 2019-06-03 16:00:19.811  INFO 10188 --- [           main] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.0.4.Final}
43 2019-06-03 16:00:19.997  INFO 10188 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
44 2019-06-03 16:00:20.088  INFO 10188 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
45 2019-06-03 16:00:20.098  INFO 10188 --- [           main] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect
46 Hibernate: alter table SysRolePermission add constraint FKjwye79px7p33gsqu4kftj0ua1 foreign key (permissionId) references SysPermission (id)
47 Hibernate: alter table SysRolePermission add constraint FKpuhqkr403td1v28c3e71cgm4b foreign key (roleId) references SysRole (id)
48 Hibernate: alter table SysUserRole add constraint FKgnn5rpnbwhx9fu93b19daiwbt foreign key (roleId) references SysRole (id)
49 Hibernate: alter table SysUserRole add constraint FKjmvn7kfavm4t2ihcb0yu6r327 foreign key (uid) references SysUser (uid)
50 2019-06-03 16:00:20.851  INFO 10188 --- [           main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
51 2019-06-03 16:00:20.853  INFO 10188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'entityManagerFactory' of type [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
52 2019-06-03 16:00:20.853  INFO 10188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'entityManagerFactory' of type [com.sun.proxy.$Proxy84] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
53 2019-06-03 16:00:20.860  INFO 10188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean '(inner bean)#9f6e406' of type [com.sun.proxy.$Proxy86] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
54 2019-06-03 16:00:20.868  INFO 10188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'jpaMappingContext' of type [org.springframework.data.jpa.repository.config.JpaMetamodelMappingContextFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
55 2019-06-03 16:00:20.869  INFO 10188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'jpaMappingContext' of type [org.springframework.data.jpa.mapping.JpaMetamodelMappingContext] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
56 2019-06-03 16:00:21.089  INFO 10188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'publicUserDao' of type [org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
57 2019-06-03 16:00:21.090  INFO 10188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'publicUserDao' of type [com.sun.proxy.$Proxy88] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
58 2019-06-03 16:00:21.094  INFO 10188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'shiroReaml' of type [com.example.runtest.realm.ShiroReaml] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
59 2019-06-03 16:00:21.100  INFO 10188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'securityManager' of type [org.apache.shiro.web.mgt.DefaultWebSecurityManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
60 ShiroConfiguration.shiroFilter执行...
61 2019-06-03 16:00:21.297  INFO 10188 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8888 (http)
62 2019-06-03 16:00:21.315  INFO 10188 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
63 2019-06-03 16:00:21.316  INFO 10188 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.19]
64 2019-06-03 16:00:21.403  INFO 10188 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
65 2019-06-03 16:00:21.403  INFO 10188 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 3392 ms
66 2019-06-03 16:00:21.627  INFO 10188 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
67 2019-06-03 16:00:21.662  WARN 10188 --- [           main] aWebConfiguration$JpaWebMvcConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
68 2019-06-03 16:00:21.739  INFO 10188 --- [           main] o.s.b.a.w.s.WelcomePageHandlerMapping    : Adding welcome page template: index
69 2019-06-03 16:00:21.890  INFO 10188 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8888 (http) with context path ''
70 2019-06-03 16:00:21.892  INFO 10188 --- [           main] com.example.runtest.RunTestApplication   : Started RunTestApplication in 4.266 seconds (JVM running for 5.106)
 

猜你喜欢

转载自www.cnblogs.com/wusiwee/p/10968092.html
今日推荐