spring整合shiro配置BUG,Tomcat启动不了:Error during artifact deployment. See server log for details
现象
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的更多相关文章
- idea启动tomcat时报错:Error during artifact deployment. See server log for details.
Error during artifact deployment. See server log for details. 这个很多人都找不出来,原因无非2个: 一.jar 包有有些没能识别,tomc ...
- idea启动tomcat报错:Error during artifact deployment. See server log for details.
出现这种情况的原因老夫猜想是改变了artifact然而tomcat的配置中的artifact没有重新配就会出现这种报错 打开tomcat配置 删除原来的artifact 新添加artifact 保存 ...
- 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 ...
- IntelliJ IDEA 14.1.4导入项目启动报错:Error during artifact deployment.[组件部署期间出错]
1.问题描述:Error during artifact deployment.[组件部署期间出错] 2.删除Artifacts 3.刷新 4.重新生成Artifacts 5.重新选择 再重新启动项目 ...
- [Java Web学习]Tomcat启动时报war exploded: Error during artifact deployment
报错:Artifact FirstWeb:war exploded: Error during artifact deployment. See server log for details. SEV ...
- spring整合shiro框架
上一篇文章已经对shiro框架做了一定的介绍,这篇文章讲述使用spring整合shiro框架,实现用户认证已经权限控制 1.搭建环境 这里不在赘述spring环境的搭建,可以简单的搭建一个ssm框架, ...
- Spring整合Shiro做权限控制模块详细案例分析
1.引入Shiro的Maven依赖 <!-- Spring 整合Shiro需要的依赖 --> <dependency> <groupId>org.apache.sh ...
- Spring整合Shiro并扩展使用EL表达式
Shiro是一个轻量级的权限控制框架,应用非常广泛.本文的重点是介绍Spring整合Shiro,并通过扩展使用Spring的EL表达式,使@RequiresRoles等支持动态的参数.对Shiro的介 ...
- Spring 整合 Shiro
一.引入依赖 <!-- spring start --> <dependency> <groupId>org.springframework</groupId ...
随机推荐
- [go]包管理
vendor方式 //包管理发展 go get(无版本概念) -> vendor(godep)(无版本概念) -> go modules go get github.com/tools/g ...
- LC 529. Minesweeper
Let's play the minesweeper game (Wikipedia, online game)! You are given a 2D char matrix representin ...
- [Navicat]把1个库的数据迁移到另1个库--数据库备份
需求: 将autotest库中所包含的所有表,从连接centOS7复制1份至localhost.autotest 操作步骤: 1.将centOS7.autotest库中表结构及表数据转为sql语句:c ...
- 自定义nagios监控脚本---磁盘检测
自定义nagios监控脚本---磁盘检测 1. 在客户端上创建脚本/usr/local/nagios/libexec/check_disk.shvim /usr/local/nagios/libexe ...
- 用es6实现一个promsie
Promise 使用方法:https://www.runoob.com/w3cnote/javascript-promise-object.html 直接上代码,相关的解释都在代码的注释里面,这里以m ...
- python实现在目录中查找指定文件的方法
python实现在目录中查找指定文件的方法 本文实例讲述了python实现在目录中查找指定文件的方法.分享给大家供大家参考.具体实现方法如下: 1. 模糊查找 代码如下: import os from ...
- A股委托类型
上海交易所于2006年8月7日启用了两种类型的市价委托,分别为:“最优五档即时成交剩余撤销”.“最优五档即时成交剩余转限价”. 深圳证券交易所启用了“对手方最优价格委托”.“本方最优价格委托”.“最优 ...
- jQuery,javascript获得网页的高度和宽度【收藏】
网页可见区域宽: document.body.clientWidth 网页可见区域高: document.body.clientHeight 网页可见区域宽: document.body.offset ...
- 使用kubeadm安装kubernetes1.12.2版本脚本【h】
Master节点脚本: #!/bin/sh#使用系统的PATH环境export PATH=`echo $PATH` #停止firewall防火墙,并禁止开机自启动 systemctl stop fir ...
- 《ThinkPHP 5.0快速入门》 请求和响应
1.请求对象 //传统调用$request = Request::instance();//实例化对象 $request->url();//获取当前的域名 //继承think\Controlle ...