xiaoasha 2010-07-01 22:14
浏览 288
已采纳

在Myeclipse 中导入一个struts工程,该工程已经包含了struts的jar文件,工程没有提示出错。但是运行就提示资源is not available

相关文件:
[size=large][color=red]struts.xml[/color][/size]

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">


<!-- Add packages here -->



/Namespace.jsp

 <package name="main" extends="struts-default" namespace="/">
    <action name="index">
        <result>/Namespace.jsp</result>
    </action>
</package>

[size=large][color=red]
web.xml:[/color][/size]

<?xml version="1.0" encoding="UTF-8"?>
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

index.jsp


struts2
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter

<filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

[size=large][color=red]
控制台提示出错:[/color][/size]

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.struts2.config.StrutsXmlConfigurationProvider.needsReload(StrutsXmlConfigurationProvider.java:168)
at com.opensymphony.xwork2.config.ConfigurationManager.conditionalReload(ConfigurationManager.java:220)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:61)
at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:774)
at org.apache.struts2.dispatcher.ng.InitOperations.initStaticContentLoader(InitOperations.java:77)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:49)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:115)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3838)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4488)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1041)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:964)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:519)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
2010-7-1 21:59:10 org.apache.catalina.core.StandardContext start
严重: Error filterStart
2010-7-1 21:59:10 org.apache.catalina.core.StandardContext start
严重: Context [/Struts2_0200_Namespace] startup failed due to previous errors
2010-7-1 21:59:10 org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
严重: A web application created a ThreadLocal with key of type null and a value of type java.lang.Object[] but failed to remove it when the web application was stopped. To prevent a memory leak, the ThreadLocal has been forcibly removed.
2010-7-1 21:59:10 org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
严重: A web application created a ThreadLocal with key of type null and a value of type java.lang.Object[] but failed to remove it when the web application was stopped. To prevent a memory leak, the ThreadLocal has been forcibly removed.

[size=large][color=red]网页中提示的错误是:[/color][/size]The requested resource () is not available.

[size=medium][color=darkred]我在浏览器里输入的是:http://localhost:8080/t/heStruts2_0200_Namespace/front/index[/color][/size]

倒腾了很久,就是解决不了,希望大家给看一下,谢谢!!

  • 写回答

2条回答 默认 最新

  • 「已注销」 2010-07-02 09:09
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
  • jiang5495 2010-07-02 11:19
    关注

    提示里面不是说了
    FileManager.java:209
    这个类的209句有错

    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 单点式登录SSO怎么爬虫获取动态SSO_AUTH_ACCESS_Token
  • ¥15 MATLAB中的fft问题
  • ¥30 哈夫曼编码译码器打印树形项目
  • ¥20 求完整顺利登陆QQ邮箱的python代码
  • ¥15 怎么下载MySQL,怎么卸干净原来的MySQL
  • ¥15 网络打印机Ip地址自动获取出现问题
  • ¥15 求局部放电案例库,用于预测局部放电类型
  • ¥100 QT Open62541
  • ¥15 stata合并季度数据和日度数据
  • ¥15 谁能提供rabbitmq,erlang,socat压缩包,记住版本要对应