Uploaded image for project: 'Commons Daemon'
  1. Commons Daemon
  2. DAEMON-182

Procrun documentation incorrectly states that the StartPath is *not* used when in jvm StartMode

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 1.0.3
    • 1.0.4
    • Procrun
    • None

    Description

      This is just a problem with the documentation on the website on the procrun page. The description for the StartPath option states that this option is not applicable for jvm StartMode. This is incorrect. In serviceStart in prunsrv.c the Win32 call SetCurrentDirectory is made with the StartPath option before starting up the JVM. Thus, the working directory for the process is set before the jvm (and the classloaders) try to resolve any file names.

      This is important, because without StartPath set, then the working directory defaults to the Windows directory (e.g. C:\Windows). Thus, if any relative paths are used anywhere (classpath, etc.) then nothing will resolve. In my case the service control manager received a 3 return code from procrun indicating that the main class could not be found (which is true-- my classpath was all built with relative paths). Setting the StartPath property corrected my problem.

      Attachments

        Activity

          People

            Unassigned Unassigned
            steve.ash Steve Ash
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: