Distributed build fails with "Unparseable date" error

Bánsághi, Csaba <[email protected]>
Newsgroups gmane.comp.java.cruise-control.user
Message-ID <01B151420A3A1843BFBC5AE63BC004A1288D6F3D@CCEXCHMBX-1.central.cranfield.ac.uk>
Hi all,

I recently installed CC 2.8.4 (source version on a Vista SP2 machine, Ant version 1.8.2). Tested it with a simple project, everything worked fine. Then I tried to build the same project using the distributed contrib, running both the lookup server and one agent on the same machine. Everything seems to go fine until the agent starts the build, at which point it fails with a bunch of errors like this:

     [java] java.text.ParseException: Unparseable date: "May 24 2011 1502"
     [java]     at java.text.DateFormat.parse(DateFormat.java:337)
     [java]     at net.sourceforge.cruisecontrol.distributed.core.CCDistVersion.getVersionBuildDate(CCDistVersion.java:66)
     [java]     at net.sourceforge.cruisecontrol.distributed.BuildAgentServiceImpl.asString(BuildAgentServiceImpl.java:990)
     [java]     at net.sourceforge.cruisecontrol.distributed.BuildAgentUI.doUpdateAgentInfoUI(BuildAgentUI.java:191)
     [java]     at net.sourceforge.cruisecontrol.distributed.BuildAgentUI.access$500(BuildAgentUI.java:38)
     [java]     at net.sourceforge.cruisecontrol.distributed.BuildAgentUI$6.run(BuildAgentUI.java:182)

I opened up CCDistVersion.java and scrolled to line 66:

    /** The date format in the properties file, should match the ant format used for ${TODAY} ${TSTAMP} */
        private static final DateFormat DF_ANT_TODAY_TSTAMP = new SimpleDateFormat("MMMM d yyyy hhmm");
        private static Date buildDate;
        public static Date getVersionBuildDate() {
            if (buildDate == null) {
                try {
                    buildDate = DF_ANT_TODAY_TSTAMP.parse(PROPS_CCDIST_BUILD_VERSION.getProperty("ccdist.version.date"));  // <-- line 66
                } catch (ParseException e) {
                    LOG.error("Error parsing build date: "
                        + PROPS_CCDIST_BUILD_VERSION.getProperty("ccdist.version.date"), e);
                }
            }
            return buildDate;
        }


Shouldn't the string "May 24 2011 1502" match the format "MMMM d yyyy hhmm"? What's going on here? Note that I'm using SVN for source control, which - as far as I can see - has no options to specify the date format in config.xml.

Any help would be appreciated
Csaba

------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.