You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Sam Terburg <ST...@MagicMinds.com> on 2000/12/11 11:49:35 UTC
context-param: illegal char
with this code in web.xml:
<context-param>
<param-name>database_dsn</param-name>
<param-value>jdbc:mysql://localhost/test?user=test&password=test</param-value>
</context-param>
i get this error:
Starting tomcat. Check logs/tomcat.log for error messages
ERROR reading /home/jsp/forum/WEB-INF/web.xml
At Next character must be ";" terminating reference to entity "password".
ERROR reading /home/jsp/forum/WEB-INF/web.xml
java.lang.NullPointerException
at org.apache.tomcat.util.xml.XmlMapper.readXml(XmlMapper.java, Compiled Code)
at org.apache.tomcat.context.WebXmlReader.processFile(WebXmlReader.java, Compiled Code)
at org.apache.tomcat.context.WebXmlReader.contextInit(WebXmlReader.java, Compiled Code)
at org.apache.tomcat.core.ContextManager.initContext(ContextManager.java, Compiled Code)
at org.apache.tomcat.core.ContextManager.init(ContextManager.java:201)
at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:156)
at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:163)
and
ERROR reading /home/jsp/forum/WEB-INF/web.xml
At Illegal character or entity reference syntax.
and
bash: syntax error near unexpected token `&password=test</param-value>'
apparently & is an illegal character.
but how do i solve this problem?
i've thought of url_encoding this, but that's an ugly sollution.
anybody got a better idea?
Greets,
Sam.
Re: context-param: illegal char
Posted by Sam Terburg <ST...@MagicMinds.com>.
Thanx, it workes.
Sam.
----- Original Message -----
From: "Jon Skeet" <jo...@peramon.com>
To: <to...@jakarta.apache.org>
Sent: Monday, December 11, 2000 11:50 AM
Subject: Re: context-param: illegal char
> > apparently & is an illegal character.
> > but how do i solve this problem?
> > i've thought of url_encoding this, but that's an ugly sollution.
> > anybody got a better idea?
>
> No, you need to *xml* encode it - use & instead of &.
>
> Jon
>
Re: context-param: illegal char
Posted by Jon Skeet <jo...@peramon.com>.
> apparently & is an illegal character.
> but how do i solve this problem?
> i've thought of url_encoding this, but that's an ugly sollution.
> anybody got a better idea?
No, you need to *xml* encode it - use & instead of &.
Jon
RE: context-param: illegal char
Posted by "G.Nagarajan" <gn...@dkf.de>.
>>
<param-value>jdbc:mysql://localhost/test?user=test&password=test</param-valu
e>
I think the & character is causing the problem, try replacing it
with &
Regards
Nagaraj.
-----Original Message-----
From: Sam Terburg [mailto:STerburg@MagicMinds.com]
Sent: Monday, December 11, 2000 11:50 AM
To: tomcat-user@jakarta.apache.org
Subject: context-param: illegal char
with this code in web.xml:
<context-param>
<param-name>database_dsn</param-name>
<param-value>jdbc:mysql://localhost/test?user=test&password=test</param-valu
e>
</context-param>
i get this error:
Starting tomcat. Check logs/tomcat.log for error messages
ERROR reading /home/jsp/forum/WEB-INF/web.xml
At Next character must be ";" terminating reference to entity "password".
ERROR reading /home/jsp/forum/WEB-INF/web.xml
java.lang.NullPointerException
at org.apache.tomcat.util.xml.XmlMapper.readXml(XmlMapper.java,
Compiled Code)
at
org.apache.tomcat.context.WebXmlReader.processFile(WebXmlReader.java,
Compiled Code)
at
org.apache.tomcat.context.WebXmlReader.contextInit(WebXmlReader.java,
Compiled Code)
at
org.apache.tomcat.core.ContextManager.initContext(ContextManager.java,
Compiled Code)
at
org.apache.tomcat.core.ContextManager.init(ContextManager.java:201)
at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:156)
at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:163)
and
ERROR reading /home/jsp/forum/WEB-INF/web.xml
At Illegal character or entity reference syntax.
and
bash: syntax error near unexpected token `&password=test</param-value>'
apparently & is an illegal character.
but how do i solve this problem?
i've thought of url_encoding this, but that's an ugly sollution.
anybody got a better idea?
Greets,
Sam.