[jboss-jira] [JBoss JIRA] Created: (JBAS-4005) Error reading web.xml with external entities when taglib is used

Angela Roberts (JIRA) jira-events at jboss.com
Mon Jan 22 16:03:52 EST 2007


Error reading web.xml with external entities when taglib is used
----------------------------------------------------------------

                 Key: JBAS-4005
                 URL: http://jira.jboss.com/jira/browse/JBAS-4005
             Project: JBoss Application Server
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: Web (Tomcat) service
    Affects Versions: JBossAS-4.0.5.GA
         Environment: MacOsX, JBossAS-4.0.5
            Reporter: Angela Roberts
         Assigned To: Remy Maucherat



See the sample application attached.

It contains a web.xml that uses an external entity:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app [   <!ENTITY inc SYSTEM "web-include.xml">]>
<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">

	&inc; 
</web-app>

When the first JSP of this application is called, if this JSP declares a taglib, JBoss can't find the included xml file.

This is the stack trace:

18:36:57,289 ERROR [MyEntityResolver] Invalid PUBLIC ID: null
18:36:57,351 ERROR [MyEntityResolver] Invalid PUBLIC ID: null
18:36:57,358 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
java.io.FileNotFoundException: /Applications/jboss-4.0.5.GA/bin/web-include.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)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEntityReference(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at org.apache.jasper.xmlparser.ParserUtils.parseXMLDocument(ParserUtils.java:95)
        at org.apache.jasper.xmlparser.ParserUtils.parseXMLDocument(ParserUtils.java:132)
        at org.jboss.web.tomcat.tc5.jasper.TagLibCache.processWebDotXml(TagLibCache.java:162)
        at org.jboss.web.tomcat.tc5.jasper.TagLibCache.init(TagLibCache.java:99)
        at org.jboss.web.tomcat.tc5.jasper.TagLibCache.getLocation(TagLibCache.java:83)
        at org.apache.jasper.JspCompilationContext.getTldLocation(JspCompilationContext.java:526)
        at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:422)
        at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:492)
        at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1556)
        at org.apache.jasper.compiler.Parser.parse(Parser.java:126)
        at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
        at org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
        at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:155)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
        at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
        at java.lang.Thread.run(Thread.java:613)


The same application works ok on Tomcat 5.5.

I believe this is related to Bug http://issues.apache.org/bugzilla/show_bug.cgi?id=34034 . This bug is already fixed on Tomcat, but the way class org.jboss.web.tomcat.tc5.jasper.TagLibCache deals with entities may be the problem.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list