1 Reply Latest reply on Sep 21, 2006 8:49 AM by zaph0d

    External entities in web.xml referencing xml files are resol

    zaph0d

      I've been trying to use external entities to split my web.xml file to several parts.

      It woul've looked something like this:
      web.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE web-app
       PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
       "http://java.sun.com/dtd/web-app_2_3.dtd"
       [
       <!ENTITY myweblet SYSTEM "weblet.xml">
       ]
      >
      
      <web-app version="2.4"
       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" >
      ...
      &myweblet;
      ...
      </web-app>
      


      weblet.xml
      <servlet>
       <servlet-name>excel</servlet-name>
       <servlet-class>com.my.class.excel</servlet-class>
      </servlet>
      


      both web.xml and weblet.xml are in WEB-INF (of course).

      I've managed to deploy the application, but at the first time I try to access it (any servlet, whether it's the external or "regular" one) I get this exception:

      2006-09-20 16:41:56,159 [ScannerThread] (Log4JLogger.java:119) ERROR - The /WEB-INF/web.xml was not found.
      java.io.FileNotFoundException: C:\JBOSS\EJBContainer\bin\weblet.xml
       at org.jboss.net.protocol.file.FileURLConnection.connect(FileURLConnection.java:94)
       at org.jboss.net.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:103)
       at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
       at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
       at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
      ...(snip)
      

      full exception at http://pastebin.ca/178615

      It looks like jboss resolver is trying the jboss.home.dir instead of the application WEB-INF dir. I've tried all kind of combinations but every legal one causes this exception.

      Is there a solution for this? Am I doing something terribly wrong?
      Please help.