DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34034>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34034

           Summary: Jasper didn't respect external entities
           Product: Tomcat 5
           Version: Nightly Build
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Jasper
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: [EMAIL PROTECTED]


While converting my apps from Tomcat 3.3.x to Tomcat 5.5.x, I discovered a
serious bug in Jasper.

My web.xml is :

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd"; [ 
    
<!ENTITY base      SYSTEM "base.xml">

]>

<web-app>

...
&base.xml;

</web-app>


Tomcat 5.0.30 and 5.5.8 have no problem in loading web.xml at startup, they
resolve since the base.xml external entity file is local to the WAR.

But jasper when it tried to compile it's first JSP fail with message :


Etat HTTP 500 -

type Rapport d'exception

message

description Le serveur a rencontré une erreur interne () qui l'a
empêché de satisfaire la requête.

exception

org.apache.jasper.JasperException: Erreur d'évaluation XML sur le
fichier /WEB-INF/web.xml
      
org.apache.jasper.xmlparser.ParserUtils.parseXMLDocument(ParserUtils.java:113)
       org.apache.jasper.compiler.JspConfig.processWebDotXml(JspConfig.java:70)
       org.apache.jasper.compiler.JspConfig.init(JspConfig.java:188)
       org.apache.jasper.compiler.JspConfig.findJspProperty(JspConfig.java:240)
       org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:103)
       org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
       org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
       org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
      
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
      
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:296)
       org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
       org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

cause mère

java.io.FileNotFoundException: C:\eclipse3\base.xml (Le fichier
spécifié est introuvable)
       java.io.FileInputStream.open(Native Method)
       java.io.FileInputStream.<init>(FileInputStream.java:106)
       java.io.FileInputStream.<init>(FileInputStream.java:66)
      
sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:69)
      
sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:156)
       org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown 
Source)
       org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
       org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
      
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEntityReference(Unknown
Source)
      
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
       
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
       org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
       org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
       org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
       org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
       org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
       javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
       
org.apache.jasper.xmlparser.ParserUtils.parseXMLDocument(ParserUtils.java:98)
       org.apache.jasper.compiler.JspConfig.processWebDotXml(JspConfig.java:70)
       org.apache.jasper.compiler.JspConfig.init(JspConfig.java:188)
       org.apache.jasper.compiler.JspConfig.findJspProperty(JspConfig.java:240)
       org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:103)
       org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
       org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
       org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
      
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
      
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:296)
       org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
       org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

note La trace complète de la cause mère de cette erreur est disponible
dans les fichiers journaux de Apache Tomcat/5.5.8.

It seems that Jasper didn't use the WEBAPP path but start from my environnement
path, in my case eclipse3, c:\eclipse3, which is bad.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to