现象

spring配置shiro权限控制之后,项目无法启动

[2019-08-09 09:00:35,800] Artifact export_web_manager:war exploded: Error during artifact deployment. See server log for details.

Tomcat起不来

原因

将shiro的spring配置放在了springmvc配置中,项目启动报错。

web.xml中的配置

    <servlet>
<servlet-name>springmvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:springmvc.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet> <!--4. Shiro权限校验过滤器,这里的filter-name固定,对应spring容器中的过滤器工厂的bean的id-->
<filter>
<filter-name>shiroFilter</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
<init-param>
<param-name>targetFilterLifecycle</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>shiroFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

web.xml的加载顺序是: <context-param>-> <listener> -> <filter> -> <servlet>。

当shiro的bean配置在springmvc.xml(从dispatcherServlet中加载xml)中,shiro相关的bean在filter加载的后面初始化

shiro配置的filter在容器中找不到相关实例,导致项目无法启动

解决

在web.xml中配置:

    	<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:applicationContext-*.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener>

单独配置shiro的配置文件applicationContext-shiro.xml

spring整合shiro配置BUG,Tomcat启动不了:Error during artifact deployment. See server log for details的更多相关文章

  1. idea启动tomcat时报错:Error during artifact deployment. See server log for details.

    Error during artifact deployment. See server log for details. 这个很多人都找不出来,原因无非2个: 一.jar 包有有些没能识别,tomc ...

  2. idea启动tomcat报错:Error during artifact deployment. See server log for details.

    出现这种情况的原因老夫猜想是改变了artifact然而tomcat的配置中的artifact没有重新配就会出现这种报错 打开tomcat配置 删除原来的artifact 新添加artifact 保存 ...

  3. IntelIJ IDEA配置Tomcat遇到问题Error during artifact deployment. See server log for details

    IntelIJ IDEA在配置tomcat的时候会遇到Error during artifact deployment. See server log for details.这样的问题,我的系统是W ...

  4. IntelliJ IDEA 14.1.4导入项目启动报错:Error during artifact deployment.[组件部署期间出错]

    1.问题描述:Error during artifact deployment.[组件部署期间出错] 2.删除Artifacts 3.刷新 4.重新生成Artifacts 5.重新选择 再重新启动项目 ...

  5. [Java Web学习]Tomcat启动时报war exploded: Error during artifact deployment

    报错:Artifact FirstWeb:war exploded: Error during artifact deployment. See server log for details. SEV ...

  6. spring整合shiro框架

    上一篇文章已经对shiro框架做了一定的介绍,这篇文章讲述使用spring整合shiro框架,实现用户认证已经权限控制 1.搭建环境 这里不在赘述spring环境的搭建,可以简单的搭建一个ssm框架, ...

  7. Spring整合Shiro做权限控制模块详细案例分析

    1.引入Shiro的Maven依赖 <!-- Spring 整合Shiro需要的依赖 --> <dependency> <groupId>org.apache.sh ...

  8. Spring整合Shiro并扩展使用EL表达式

    Shiro是一个轻量级的权限控制框架,应用非常广泛.本文的重点是介绍Spring整合Shiro,并通过扩展使用Spring的EL表达式,使@RequiresRoles等支持动态的参数.对Shiro的介 ...

  9. Spring 整合 Shiro

    一.引入依赖 <!-- spring start --> <dependency> <groupId>org.springframework</groupId ...

随机推荐

  1. YOLO: You Only Look Once论文阅读摘要

    论文链接: https://arxiv.org/pdf/1506.02640.pdf 代码下载: https://github.com/gliese581gg/YOLO_tensorflow Abst ...

  2. 前端三大框架(Angular Vue React)

    前端,HTML(超文本标记语言),CSS(层叠样式表)和JavaScript(脚本语言) HTML,通常说的h5,其实按标准来说,HTML4的后续版本不带编号了,并保证向前的兼容性 CSS的版本3,增 ...

  3. thinkphp5的控制器调用自身模块和调用其他模块的方法

    以user为例,调用user.php的get_number()方法 一.不管是调用自身模块还是其他模块app\model\User.php写法不变 <?php namespace app\ind ...

  4. [.NET] 一步步打造一个简单的 MVC 电商网站 - BooksStore(一) (转)

    http://www.cnblogs.com/liqingwen/p/6640861.html 一步步打造一个简单的 MVC 电商网站 - BooksStore(一) 本系列的 GitHub地址:ht ...

  5. 怎样做delphi程序连接数据库失败,单机确定就关闭窗体

    我单机确定还会显示窗体?? Application.Terminate;

  6. 【Hadoop】MapReduce练习:多job关联实现倒排索引

    概述 倒排索引(英语:Inverted index),也常被称为反向索引.置入档案或反向档案,是一种索引方法,被用来存储在全文搜索下某个单词在一个文档或者一组文档中的存储位置的映射.它是文档检索系统中 ...

  7. NetCore 对Json文件的读写操作

    nuget Microsoft.Extensions.Configuration; Microsoft.Extensions.Configuration.Json; Newtonsoft.Json; ...

  8. 【问题案例】K8S-Master修改IP地址之后,重新初始化的方法。

    使用kubeadm命令,执行:kubeadm reset 重新执行初始化:kubeadm init --kubernetes-version=v1.14.1 --pod-network-cidr=10 ...

  9. 27.IP承载网容量仿真

    接入,汇聚,核心 参考资料: 学堂在线,移动通信技术(2019秋)https://next.xuetangx.com/learn/SZIIT61031001367/SZIIT61031001367/1 ...

  10. FTL-SLC&MTC&TLC

    1.博客 SLC.. http://diybbs.zol.com.cn/67/231_661182.html 2.FTL --作者在普及了一些FTL基本知识后,主要分析了在linux上实现的途径 ht ...