同事提交了代码。结果除同事之外,其他人全部编译报错。报错说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. Git 分支-利用分支进行开发的工作流程

    3.4 Git 分支 - 利用分支进行开发的工作流程 利用分支进行开发的工作流程 现在我们已经学会了新建分支和合并分支,可以(或应该)用它来做点什么呢?在本节,我们会介绍一些利用分支进行开发的工作流程 ...

  2. 阅读android项目源码

    版权声明:欢迎转载,转载请注明出处;http://blog.csdn.net/angcyo 上一篇,我们成功导入并运行了 贝壳单词 项目. 这篇文章, 带大家一起读一读源码. 打开 贝壳单词 项目,定 ...

  3. 空间表SpaceList

    比如在建一个成绩管理系统,这时候定义的名字一般都是char szName[20],这样比较浪费,其实不只是定义名字,定义好多变量都这样,并没有体现动态. 此处出现空间表(SpaceList),通过指针 ...

  4. 详细的css命名规则,专业点吧

    头:header内容:content/container尾:footer导航:nav侧栏:sidebar栏目:column页面外围控制整体布局宽度:wrapper左右中:left right cent ...

  5. linux找回密码

    开机启动系统,在进入系统之前按键盘上面的Esc键,会进入下面的界面 按键盘上的e键,出现下面界面 用键盘上的方向键移动光标到第二项,然后再按键盘上面的e,会出现下面的界面 输入一个空格键,然后在输入数 ...

  6. bash报错./mq.sh: line 15: warning: here-document at line 10 delimited by end-of-file (wanted `eof')

    [root@localhost tmp]# ./mq.sh./mq.sh: line 15: warning: here-document at line 10 delimited by end-of ...

  7. ubuntu上面安装eclipse android到adt下载方法

    如果自动安装有问题的话,就需要手动安装,其实是差不多的,唯一不同的就是手动下载ADT插件包,http://dl.google.com/android/ADT-0.9.6.zip ,可以下载到. 版本号 ...

  8. 转 Android中通过广播方式调起第三方App

    今天紧急的跟进一个百度视频App无法调起百度贴吧App的问题,当然,这个是只发现是在4.x的android系统下发生,在2.x版本下,一切正常,(其实是3.1及以上的版本都有问题)具体场景为: 1.贴 ...

  9. cell选中与取消选中调用的方法

    //选中与取消选中都会调用哦,注意!!- (void)setSelected:(BOOL)selected animated:(BOOL)animated{ [super setSelected:se ...

  10. FIFO 和 LRU 调度算法

    在一个采用页式虚拟存储管理的系统中(字地址序列.页号.块号均从零开始编址),有一用户作业,它依次要访问的字地址序列是:15,128,300,388,246,402,223,142,360,267,若该 ...