`
godsend_jin
  • 浏览: 42424 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

Exception starting filter struts2

阅读更多

1、Error filterStart异常的详细堆栈信息

2010-9-26 20:28:25 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter struts2
java.lang.NullPointerException
at com.opensymphony.xwork2.util.FileManager$FileRevision.needsReloading(FileManager.java:209)
at com.opensymphony.xwork2.util.FileManager.fileNeedsReloading(FileManager.java:60)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.needsReload(XmlConfigurationProvider.java:325)
……
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
2010-9-26 20:28:25 org.apache.catalina.core.StandardContext start
严重: Error filterStart
2010-9-26 20:28:25 org.apache.catalina.core.StandardContext start
严重: Context [/jqgridTest] startup failed due to previous errors
2010-9-26 20:28:25 org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
严重: A web application created a ThreadLocal with key of type [null] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@1f7e273]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@1342572]) but failed to remove it when the web application was stopped. To prevent a memory leak, the ThreadLocal has been forcibly removed.
2010-9-26 20:28:25 org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
严重: A web application created a ThreadLocal with key of type [null] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@869e8f]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@13ccea]) but failed to remove it when the web application was stopped. To prevent a memory leak, the ThreadLocal has been forcibly removed.
2010-9-26 20:28:25 org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
严重: A web application created a ThreadLocal with key of type [null] (value [com.sun.faces.config.ConfigureListener$1@1f23ca4]) and a value of type [null] (value [null]) but failed to remove it when the web application was stopped. To prevent a memory leak, the ThreadLocal has been forcibly removed.

polaris注:中间有省略,异常可能不完全一样,但大概就是这个样子。

2、解决方法总结

2.1 解决方法一

初学Struts2的时候,很容易遇到该问题。这个时候,首先查看导入的JAR包是否正确,一般是少导入了什么JAR包。记得当初在学Struts2的时候,polaris就遇到导入JAR包的问题,可参看polaris早时刚学Struts2时在百度空间上写的文章《解决struts2 中Error filterStart 问题》

2.2 解决方法二

进入公司后,遇到了类似的问题。其实这个问题可能跟Struts2没关系,不过还是在此提一下。大概的问题是:程序编译出问题,或者通过 Eclipse将程序部署到Tomcat后,启动Tomcat报错。当时遇到此问题感觉很是奇怪,因为在同事电脑上一切都正常。后来才发现,原来这是通过 SVN导致的:由于每个人的classpath路径不一样(Eclipse中有一个文件.classpath),第一次通过将工程上传到SVN后,会上传 该文件(不上传也会有此问题),这样其他人从SVN上下载该工程时,classpath和自己机子上的不一样,导致找不到jar包,自然就会编译出问题, 或者部署出问题。解决方法是将所有的JAR包重新导入一次。如图:
Struts2 | 北极星为您引航
将这些jar包全部删除,然后点击add jars,在当前工程的lib目录下将所有的jar导入进来。记得有时候还可能需要重新设置JDK,因为JDK各个人的名称可能不一样,如jdk1.6, jdk1.6.0.3之类的,这样也会导致编译出错。

2.3 解决方法三

遇到此问题另外一个要想到的问题是配置文件是否有问题。首先当然是web.xml文件,要确保Struts2过滤器配置无误;然后是struts.xml配置文件。

今天polaris遇到的问题就是struts.xml引起的问题。该网友他部署的时候是没有问题的,他在该配置文件中启用了devMode模式。 然后,我将其禁用掉,发现问题解决。然而,虽然解决了问题,却有疑问:为啥网友的机子上不会有问题?这个时候想到了“空格”问题:polaris的 Tomcat安装在Program Files目录中。通过与网友一确认,他的Tomcat安装目录没有空格。

以下来源于网络:devMode模式是开发模式,开启它则默认开启了i18n.reload、configuration.xml.reload。 这个错误是由于configuration.xml.reload设置为true倒导致的,网上的资料没有说明原因及解决办法,有人说这是2.16版本的 BUG,tomcat的安装路径包含空格,你可以使用更高级的版本或将Tomcat安装到没有空格的路径中来避免这个错误。

3、说明

以上是对Struts2 Error filterStart异常的一个总结。如果您遇到该问题,而以上方法没法解决,可以留言或联系polaris,或者您对该问题有其他的解决方法也可留言告之,谢谢。

分享到:
评论

相关推荐

    SSH2报错xception starting filter struts2

    严重: Exception starting filter struts2 java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter

    初学者用的几个struts2的基本包

    第一次做struts2的程序,却遇到了Exception starting filter struts2的问题,追其原因,其中一个很大的原因是其官方网站上下的那几个包不行。于是费劲千辛万苦找到了这几个好使的包!

    配置struts2常见错误

    Console 错误:Exception starting filter struts2 **问题描述**: ``` Nomapping found for dependency[type=com.opensymphony.xwork2.ObjectFactory,name='default'] in public void ...

    struts2开发遇到的问题

    7. **严重:Exception starting filter struts2,Error filterStart,Context [/struts2] startup failed due to previous errors** 这个严重错误通常涉及到Struts2配置问题,可能的原因包括: - `struts.xml`中的...

    struts2错误集合.txt

    错误信息:“Exception starting filter struts2”。这可能是由于`web.xml`中未正确配置Struts2过滤器,或者类路径中缺少必要的jar文件。 8. **结果类型定义错误:** 错误信息:“There is no result type defined...

    Tomcat部署项目时报错解决方案

    严重: Exception starting filter struts2 Unable to load configuration. - [unknown location] ``` 该错误提示通常伴随着一系列的堆栈跟踪信息,指向了问题的具体原因。例如,在提供的部分内容中可以看到以下堆栈...

    java异常解决方案.docx

    * Exception starting filter struts2 The action name cannot be the same as the action suffix [Action] + 解决方案:检查 Struts2 的 Action 定义,是否存在名称冲突的问题,尝试使用唯一的名称来解决问题。 * ...

    java 遇到的各种异常

    Exception starting filter struts2: The action name cannot be the same as the action suffix [Action]** - **异常描述**:Struts2 Action命名冲突。 - **原因分析**:Action名称与Action后缀名重复。 - **解决...

    struts2.3.8配置教程

    <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/* </filter-mapping> ``...

Global site tag (gtag.js) - Google Analytics