Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-1754

References to external entities not working with WebXmlParser

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2.0
    • 2.0.3
    • None
    • None
    • Windows, Eclipse 3.3 with WTP using the Tomcat 6.0 Server.

    Description

      Myfaces fails to parse a valid web.xml file. the problem seems to be the fact that i am using an xml include in
      my web.xml. this works fine with a "standard" web application, not using myfaces. seems to be a problem with the path to the
      included xml file.

      the web.xml looks like :

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE project [
      <!ENTITY snippet SYSTEM "remoting_snippet.xml">
      ]>
      <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
      ....
      &snippet;
      ....
      </web-app>

      The remoting_snippet.xml contains the following content:

      <servlet>
      <servlet-name>remoting</servlet-name>
      <servlet-class>
      org.springframework.web.servlet.DispatcherServlet
      </servlet-class>
      <load-on-startup>1</load-on-startup>
      </servlet>
      <servlet-mapping>
      <servlet-name>remoting</servlet-name>
      <url-pattern>/remoting/*</url-pattern>
      </servlet-mapping>

      the exception i get is the following one.

      20071027-161103.153 FATAL [WebXmlParser] [main] [] Unable to parse web.xml
      java.io.FileNotFoundException: \WEB-INF\remoting_snippet.xml (Das System kann den angegebenen Pfad nicht finden)
      at java.io.FileInputStream.open(Native Method)
      at java.io.FileInputStream.<init>(FileInputStream.java:106)
      at java.io.FileInputStream.<init>(FileInputStream.java:66)
      at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)
      at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)
      at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:653)
      at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:1316)
      at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:1253)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEntityReference(XMLDocumentFragmentScannerImpl.java:1891)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3017)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:645)
      at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:508)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
      at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
      at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225)
      at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
      at org.apache.myfaces.shared_impl.webapp.webxml.WebXmlParser.parse(WebXmlParser.java:96)
      at org.apache.myfaces.shared_impl.webapp.webxml.WebXml.init(WebXml.java:200)
      at org.apache.myfaces.shared_impl.webapp.webxml.WebXml.getWebXml(WebXml.java:187)
      at org.apache.myfaces.webapp.DefaultFacesInitializer.initFaces(DefaultFacesInitializer.java:70)
      at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:57)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
      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:516)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
      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:288)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
      20071027-161103.213 ERROR [DefaultFacesInitializer] [main] [] Error initializing MyFaces: java.io.FileNotFoundException: \WEB-INF\remoting_snippet.xml (Das System kann den angegebenen Pfad nicht finden)
      javax.faces.FacesException: java.io.FileNotFoundException: \WEB-INF\remoting_snippet.xml (Das System kann den angegebenen Pfad nicht finden)
      at org.apache.myfaces.shared_impl.webapp.webxml.WebXmlParser.parse(WebXmlParser.java:112)
      at org.apache.myfaces.shared_impl.webapp.webxml.WebXml.init(WebXml.java:200)
      at org.apache.myfaces.shared_impl.webapp.webxml.WebXml.getWebXml(WebXml.java:187)
      at org.apache.myfaces.webapp.DefaultFacesInitializer.initFaces(DefaultFacesInitializer.java:70)
      at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:57)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
      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:516)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
      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:288)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

      regards,
      andy

      Attachments

        Issue Links

          Activity

            People

              lu4242 Leonardo Uribe
              kickmetondy Andreas Wuest
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: