Quartz Scheduler (Historical - Do Not File New Issues Here - See GitHub)
  1. Quartz Scheduler (Historical - Do Not File New Issues Here - See GitHub)
  2. QTZ-199

JBoss QuartzService doesn't expand JBoss properties correctly on Windows platforms

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: 2 Major 2 Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.2
    • Fix Version/s: 2.1
    • Component/s: Java EE Features
    • Labels:
      None
    • Terracotta Target:
      Quartz 2.1.0
    • Fixed In Revision:
      1588,1589

      Description

      Problem:
      --------
      JBoss supports several properties that make it possible to indicate paths inside the server. This provides a very convenient way of indicating where certain files are to be found, e.g. for Quartz configuration one could use:

      org.quartz.plugin.jobInitializer.fileNames = $

      {jboss.server.home.dir}

      /conf/quartz-jobs.xml

      Because these JBoss properties are expanded before they are used in QuartzService.setProperties, getting the bytes from the ByteArrayInputStream (lines 161-162) results in the backslashes in the property's path (on Windows!) to be interpreted as special characters. The configuration above then produces e.g. 'C:jboss-5.1.0.GAserverquartz/conf/quartz-jobs.xml' instead of the intended 'C:/jboss-5.1.0.GA/server/quartz/conf/quartz-jobs.xml'.

      Workaround:
      -----------
      Using the full explicit path works fine (but that makes your configuration less portable).

      Fix:


      Putting a String replace in front of the code that actually reads in the bytes from the properties results in the correct paths. A possible fix would look like this (insert at line 161):

      properties = properties.replace(File.separator, "/");

      This accomplishes/changes nothing on platforms other than Windows, yet fixes the problem on Windows.

        Activity

        Hide
        James House added a comment -

        thanks!

        Show
        James House added a comment - thanks!

          People

          • Assignee:
            James House
            Reporter:
            Maurice de Chateau
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: