tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 15762] New: - Special character '&' in Data Source URL causes Tomcat to crash on restart
Date Thu, 02 Jan 2003 13:13:55 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15762>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15762

Special character '&' in Data Source URL causes Tomcat to crash on restart

           Summary: Special character '&' in Data Source URL causes Tomcat
                    to crash on restart
           Product: Tomcat 4
           Version: 4.1.18
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Webapps:Administration
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: rcasa@bluewin.ch


I configure a Data Source with the Administration webapp, the "Data Source URL" 
field contains the special character &, for example:

jdbc:sybase:Tds:host.domain:4100/db?APPLICATIONNAME=Tomcat&HOSTNAME=myserver

I save and commit changes, all is well.

When I try to restart Tomcat, it will not start, there is an exception while 
parsing server.xml:

Catalina.start: org.xml.sax.SAXParseException: Next character must be ";" 
terminating reference to entity "HOSTNAME".
....

The problem is that the data source's url resource parameter's value is stored 
literally in server.xml (the & character is not escaped to &amp;) which makes 
it invalid XML.

server.xml:

<ResourceParams name="myDataSource">
  ...
  <parameter>
    <name>url</name>
    <value>jdbc:sybase:Tds:host.domain:4100/db?
APPLICATIONNAME=Tomcat&HOSTNAME=myserver</value>
  </parameter>
  ...
</ResourceParams>

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message