现象

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. Mysql查询某字段重复值并删除重复值

    1.查询重复值: select code,count(*) as count from hospital group by code having count>1; 该语句查询code重复值大于 ...

  2. LC 926. Flip String to Monotone Increasing

    A string of '0's and '1's is monotone increasing if it consists of some number of '0's (possibly 0), ...

  3. LC 265. Paint House II

    There are a row of n houses, each house can be painted with one of the k colors. The cost of paintin ...

  4. 一百零五:CMS系统之flask-mail使用和邮箱配置、发送邮件功能

    安装:pip install flask-mail 官方文档:https://pythonhosted.org/Flask-Mail/ 邮箱配置 MAIL_SERVER = 'smtp.qq.com' ...

  5. ceph常用命令(3)

    1.查看集群配置信息 ceph daemon /var/run/ceph/ceph-mon.$(hostname -s).asok config show 2.在部署节点修改了ceph.conf文件, ...

  6. Java集合(2):两个生成器的例子:Collection生成器CollectionData及Map生成器MapData

    Collection生成器CollectionData CollectionData体现了适配器模式的设计思想,它能把实现Generator接口的类的对象(包括上一章数组中的各种RandomGener ...

  7. C#中Math方法总结

    名称  说明      E  表示自然对数的底,它由常数 e 指定.    PI  表示圆的周长与其直径的比值,它通过常数 π 指定. Abs  已重载.返回指定数字的绝对值.      Acos   ...

  8. Ubuntu下安装Golong并用Vscode做IDE最有效方法,避免99%的坑 | 轻松学习GO

    最详细的教程,避开99%的坑,亲测有效 由于大部分教程都是win版本的,所以专门总结了一个linux版本的,其核心在于环境配置和插件安装,经历本人通宵7小时解决了这个问题,用自己的踩坑帮助大家避坑,希 ...

  9. 3道入门字典树例题,以及模板【HDU1251/HDU1305/HDU1671】

    HDU1251:http://acm.hdu.edu.cn/showproblem.php?pid=1251 题目大意:求得以该字符串为前缀的数目,注意输入格式就行了. #include<std ...

  10. 21.根据hive绑定数据统计计算保存到hive表中

    创建upflow表 create external table mydb2.upflow (ip string,sum string) row format delimited fields term ...