Directory ApacheDS
  1. Directory ApacheDS
  2. DIRSERVER-364

specification of server.xml arg. file when starting DS fails if server.xml is specified with absolute path

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      I have to specify a relative path to the server.xml if I want to start the server. It would be nice to be able to specify an absolute path without hitting a FileNotFoundEx.. It seems to be dropping the leading File.separator ...

      java.io.FileNotFoundException: home/nickf/src/apache/directory/apacheds/trunk/main/server.xml (No such file or directory)

      For example:

      [nickf@little-creatures trunk]$ pwd
      /home/nickf/src/apache/directory/apacheds/trunk
      [nickf@little-creatures trunk]$ java -jar main/target/apacheds-main-0.9.1-SNAPSHOT.jar /home/nickf/src/apache/directory/apacheds/trunk/main/server.xml
      server: loading settings from /home/nickf/src/apache/directory/apacheds/trunk/main/server.xml
      [INFO] XmlBeanDefinitionReader - -Loading XML bean definitions from file [/home/nickf/src/apache/directory/apacheds/trunk/home/nickf/src/apache/directory/apacheds/trunk/main/server.xml]
      Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from file [/home/nickf/src/apache/directory/apacheds/trunk/home/nickf/src/apache/directory/apacheds/trunk/main/server.xml]; nested exception is java.io.FileNotFoundException: home/nickf/src/apache/directory/apacheds/trunk/main/server.xml (No such file or directory)
      java.io.FileNotFoundException: home/nickf/src/apache/directory/apacheds/trunk/main/server.xml (No such file or directory)
      at java.io.FileInputStream.open(Native Method)

      Whereas, from the same directory, the relative path works!

      [nickf@little-creatures trunk]$ java -jar main/target/apacheds-main-0.9.1-SNAPSHOT.jar main/server.xml server: loading settings from main/server.xml
      [INFO] XmlBeanDefinitionReader - -Loading XML bean definitions from file [/home/nickf/src/apache/directory/apacheds/trunk/main/server.xml]

        Activity

        Hide
        Nick Faiz added a comment -

        This issue can be closed. It looks like a prob. with FileSystemXmlApplicationContext . An easy workaround, on UNIX, is to use 2 file separators when specifying the absolute path to the context file, e.g. //tmp/server.xml

        Show
        Nick Faiz added a comment - This issue can be closed. It looks like a prob. with FileSystemXmlApplicationContext . An easy workaround, on UNIX, is to use 2 file separators when specifying the absolute path to the context file, e.g. //tmp/server.xml
        Hide
        Alex Karasulu added a comment -

        Use a URL for the file instead and all should work fine.

        Show
        Alex Karasulu added a comment - Use a URL for the file instead and all should work fine.
        Hide
        Emmanuel Lecharny added a comment -

        Closing all issues created in 2005 and before which are marked resolved

        Show
        Emmanuel Lecharny added a comment - Closing all issues created in 2005 and before which are marked resolved

          People

          • Assignee:
            Alex Karasulu
            Reporter:
            Nick Faiz
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development