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: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


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:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to