-
Bug
-
Resolution: Fixed
-
Major
-
None
-
Platform: All, OS: All
2009-09-22 16:54:51.519:/:WARN: Error while serving
http://localhost:8080/job/hgtest/config.xml
...
Caused by: java.io.IOException: Failed to detect encoding of
/space/src/hudson/trunk/plugins/mercurial/./work/jobs/hgtest/config.xml
at hudson.XmlFile.sniffEncoding(XmlFile.java:264)
at hudson.XmlFile.readRaw(XmlFile.java:192)
at hudson.XmlFile.writeRawTo(XmlFile.java:209)
at hudson.model.Job.doConfigDotXml(Job.java:969)
...
The file starts:
<?xml version='1.0' encoding='UTF-8'?>
<project>
so I'm not sure what's wrong. Hudson 1.323.
Anyway why is Hudson trying to find the file's encoding, reading it in a Reader,
then writing it to a Writer from the servlet output which is set to UTF-8?
Wouldn't it be simpler to just set content type to application/xml with no
specified encoding and copy the file as a bytestream from disk? Then
XmlFile.sniffEncoding, .readRaw, .writeRawTo, and .asString could all be deleted.
XmlFile.read and .marshal also look suspicious. Why are they assuming UTF-8
encoding and making a Reader? XStream accepts an InputStream, which would be
easier and I presume safer.
- is duplicated by
-
JENKINS-5488 Can't create or modify jobs with jobConfigHistory plugin testing with "mvn hpi:run"
- Closed