首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Exception >

Unexpected error parsing WEB-INF web.xml: java.io.FileNotFoundException

2014-01-26 
我用Eclipse - Lomboz + JSF 1.1开发一个Web Application时,不小心把Tomcat弄坏了,重新安装了一下Tomcat,结

我用Eclipse - Lomboz + JSF 1.1开发一个Web Application时,不小心把Tomcat弄坏了,重新安装了一下Tomcat,结果,再在Eclipse中启动,就出现了下面这个错误。但是把整个项目拷贝到Tomcat/Webapps下面,就不会出错。这是咋回事啊,大哥们… 谢谢你们了!

错误报告如下:
严重: Unexpected error parsing WEB-INF web.xml: java.io.FileNotFoundException
java.io.FileNotFoundException
at org.apache.naming.resources.DirContextURLConnection.getInputStream(DirContextURLConnection.java:297)
at com.sun.faces.config.WebXmlParser.getFacesServletMappings(WebXmlParser.java:115)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:180)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3729)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4187)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
at org.apache.catalina.core.StandardService.start(StandardService.java:450)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
2006-12-19 11:15:46 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
javax.faces.FacesException: Unexpected error parsing /WEB-INF/web.xml: java.io.FileNotFoundException
at com.sun.faces.config.WebXmlParser.getFacesServletMappings(WebXmlParser.java:123)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:180)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3729)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4187)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
at org.apache.catalina.core.StandardService.start(StandardService.java:450)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
Caused by: java.io.FileNotFoundException
at org.apache.naming.resources.DirContextURLConnection.getInputStream(DirContextURLConnection.java:297)
at com.sun.faces.config.WebXmlParser.getFacesServletMappings(WebXmlParser.java:115)
... 16 more

------解决方法--------------------------------------------------------
Web.xml文件如下:
<?xml version= "1.0 " encoding= "UTF-8 "?>

<web-app 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 "
version= "2.4 ">

<description>
  JSF Demo         

热点排行