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

在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
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥30 vb net 使用 sendMessage 如何输入鼠标坐标
  • ¥200 求能开发抖音自动回复卡片的软件
  • ¥15 关于freesurfer使用freeview可视化的问题
  • ¥100 谁能在荣耀自带系统MagicOS版本下,隐藏手机桌面图标?
  • ¥15 求SC-LIWC词典!
  • ¥20 有关esp8266连接阿里云
  • ¥15 C# 调用Bartender打印机打印
  • ¥15 我这个代码哪里有问题 acm 平台上显示错误 90%,我自己运行好像没什么问题
  • ¥50 C#编程中使用printDocument类实现文字排版打印问题
  • ¥15 找会编程的帅哥美女 可以用MATLAB里面的simulink编程,用Keil5编也可以。