同事提交了代码。结果除同事之外,其他人全部编译报错。报错说web.xml中配置的一个bean 没有定义。按照报错提示,各种找,无果。

由于代码全部都是提交到svn主干,之前也没有做过备份,只能一步一步删除同事提交的代码,进行还原。

奇葩事情出现了!

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:/context_entry.xml
classpath:/context_web.xml

<!--add by XXX-->

classpath:/GCSPcontext/context_policy_web.xml

<!--add by XXX-->

</param-value>
</context-param>

引入文件没有错误,问题就在于这个注释上。突然想起之前也因为在这里写注释,报了一个错误,找了很久,但是为什么把错误指向另一个毫不相关为的文件呢。

<Could not load use
r defined filter in web.xml: org.springframework.web.filter.DelegatingFilterProx
y.
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named '
shiroFilter' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.
getBeanDefinition(DefaultListableBeanFactory.java:387)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMerg
edLocalBeanDefinition(AbstractBeanFactory.java:971)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
an(AbstractBeanFactory.java:246)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:168)
Truncated. see log file for complete stacktrace

附上web.xml文件配置

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<param-value>ApplicationResources</param-value>
</context-param>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:/context_entry.xml
classpath:/context_web.xml </param-value>
</context-param> <filter>
<filter-name>SQLInjectFilter</filter-name>
<filter-class>com.sinosoft.gcsp.common.util.SQLInjectFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>SQLInjectFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping> <filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>GBK</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter>
<filter-name>struts2</filter-name>
<!-- <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class> -->
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
<init-param>
<param-name>actionPackages</param-name>
<param-value>com.sinosig.schedule.user.web</param-value>
</init-param>
</filter> <filter>
<filter-name>shiroFilter</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>shiroFilter</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>shiroFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping> <filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping> <listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener> <!-- <listener>-->
<!-- <listener-class>-->
<!--
com.sinosig.framework.web.listener.FrameworkHttpSessionListener</listener-class>
-->
<!-- </listener>--> <error-page>
<error-code>404</error-code>
<location>/error404.jsp</location>
</error-page> <welcome-file-list>
<welcome-file>UIPrBefLogin.jsp</welcome-file>
</welcome-file-list> <session-config>
<session-timeout>60</session-timeout>
</session-config>
</web-app>

java web开发中的奇葩事web.xml中context-param中的注释的更多相关文章

  1. Web开发基本准则-55实录-Web访问安全

    Web开发工程师请阅读下面的前端开发准则,这是第一部分,强调了过去几年里我们注意到的Web工程师务须处理的Web访问安全基础点.尤其是一些从传统软件开发转入互联网开发的工程师,请仔细阅读,不要因为忽视 ...

  2. 学习参考《Flask Web开发:基于Python的Web应用开发实战(第2版)》中文PDF+源代码

    在学习python Web开发时,我们会选择使用Django.flask等框架. 在学习flask时,推荐学习看看<Flask Web开发:基于Python的Web应用开发实战(第2版)> ...

  3. Web开发人员需知的Web缓存知识

    最近的译文距今已有4年之久,原文有一定的更新.今天踩着前辈们的肩膀,再次把这篇文章翻译整理下.一来让自己对web缓存的理解更深刻些,二来让大家注意力稍稍转移下,不要整天HTML5, 面试题啊叨啊叨的~ ...

  4. Web 开发人员需知的 Web 缓存知识

    今天踩着前辈们的肩膀,再次把这篇文章翻译整理下.一来让自己对web缓存的理解更深刻些,二来让大家注意力稍稍转移下,不要整天HTML5, 面试题啊叨啊叨的~~ 什么是Web缓存,为什么要使用它? Web ...

  5. Web开发初探(系统理解Web知识点)

    一.Web开发介绍 我们看到的网页通过代码来实现的 ,这些代码由浏览器解释并渲染成你看到的丰富多彩的页面效果. 这个浏览器就相当于Python的解释器,专门负责解释和执行(渲染)网页代码. 写网页的代 ...

  6. Java开发工程师(Web方向) - 01.Java Web开发入门 - 第1章.Web应用开发概述

    第1章--Web应用开发概述 Web应用开发概述 浏览器-服务器架构(BS-architecture) browser/ App    ---- request ---->    server ...

  7. web开发注意的一些事

    js命名不要包含"-",在chrome浏览器是测试发现,如果文件包含"-",即使指定js本地缓存了,还会向服务器发送请求. cookie path 区分大小写

  8. html5移动web开发笔记(一)Web 存储

    localStorage - 没有时间限制的数据存储 localStorage 方法 localStorage 方法存储的数据没有时间限制.第二天.第二周或下一年之后,数据依然可用. 用户访问页面的次 ...

  9. 移动web开发(一)——移动web开发必备知识

    参考: 移动终端开发必备知识.http://isux.tencent.com/mobile-development-essential-knowledge.html

随机推荐

  1. windows2012 r2 提高网速方法

    2012 升级到 r2 微软官方地址:(感谢Monkey威武)Datacenter Preview:简体中文:http://care.dlservice.microsoft.com/dl/downlo ...

  2. dom4j解析xml实例

    dom4j是一个java的XML API,类似jdom,用来读写XML文件,它性能优异.功能强大和极易使用等特点 所用jar包:dom4j-1.6.1.jar 需要解析的xml文件:people.xm ...

  3. js 鼠标事件

    <html><head lang="en"> <meta charset="UTF-8"> <title>< ...

  4. BZOJ 3110:[Zjoi2013]K大数查询(整体二分)

    http://www.lydsy.com/JudgeOnline/problem.php?id=3110 题意:-- 思路:其实和之前POJ那道题差不多,只不过是换成区间更新,而且是第k大不是第k小, ...

  5. 给ThinkPHP5增加验证码功能

    就在这几天,TP5进行的RC3的大规模更新,虽然我们都狠狠地骂了一百遍,但是我的内心是无比的激动,TP终于走上了"上流社会"的模式:composer! 为什么说composer是上 ...

  6. web.xml的启动顺序

    1. context-param 2. Listener 3. Filter 4. servlet <?xml version="1.0" encoding="UT ...

  7. Freemodbus 1.5

    源:http://blog.sina.com.cn/s/blog_4935209001012eax.html 网站位置:http://www.freemodbus.org/index.php?lang ...

  8. phpcms 细节

    Phpcms V9采用if语句判断当前栏目高亮.判断分类信息是否过期 10月05, 2013 by SJY 在用PC V9建站的时候,很多朋友会想到Phpcms V9判定当前栏目,让当前栏目高亮的功能 ...

  9. copy-on-write学习

    最近知识梳理不够,那就整理点以前blog的东西.这儿就看COW(copy-on-write),cow技术主要是为了提高程序在单步操作时的系统响应速度而设计的,它通过将不是立即必要的空间分配,数据复制等 ...

  10. javascript 中 function bind()

    Function bind() and currying <%-- All JavaScript functions have a method called bind that binds t ...