japex
  1. japex
  2. JAPEX-28

ConfigFileMerger can't handle spaces in config file path

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: current
    • Fix Version/s: milestone 1
    • Component/s: engine
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      28

      Description

      Stack trace for configuration file at /some/path/with/spaces here/japex-config.xml

      [java] Reading configuration file '/some/path/with/spaces' ...
      [java] Exception in thread "main" java.lang.RuntimeException:
      java.lang.RuntimeException: java.io.FileNotFoundException:
      /some/path/with/spaces (No such file or directory)
      [java] at com.sun.japex.ConfigFileMerger.<init>(ConfigFileMerger.java:79)
      [java] at com.sun.japex.Engine.start(Engine.java:117)
      [java] at com.sun.japex.Japex.run(Japex.java:155)
      [java] at com.sun.japex.Japex.main(Japex.java:127)
      [java] Caused by: java.lang.RuntimeException:
      java.io.FileNotFoundException: /some/path/with/spaces (No such file or directory)
      [java] at
      com.sun.japex.ConditionalProcessor.process(ConditionalProcessor.java:106)
      [java] at com.sun.japex.ConfigFileLoader.loadFile(ConfigFileLoader.java:85)
      [java] at com.sun.japex.ConfigFileMerger.<init>(ConfigFileMerger.java:69)
      [java] ... 3 more
      [java] Caused by: java.io.FileNotFoundException: /some/path/with/spaces (No
      such file or directory)
      [java] at java.io.FileInputStream.open(Native Method)
      [java] at java.io.FileInputStream.<init>(FileInputStream.java:106)
      [java] at java.io.FileInputStream.<init>(FileInputStream.java:66)
      [java] at java.io.FileReader.<init>(FileReader.java:41)
      [java] at
      com.sun.japex.ConditionalProcessor.process(ConditionalProcessor.java:96)
      [java] ... 5 more

        Activity

        Hide
        Santiago Pericas-Geertsen added a comment -

        I'm assuming your passing such a config file from the command line. If so, only the first part of the file
        name is getting to Japex, based on what I see in the stack trace. Thus, you'd need to use double quotes
        on the command line around the file name to make sure that it is interpreted correctly, right?

        Show
        Santiago Pericas-Geertsen added a comment - I'm assuming your passing such a config file from the command line. If so, only the first part of the file name is getting to Japex, based on what I see in the stack trace. Thus, you'd need to use double quotes on the command line around the file name to make sure that it is interpreted correctly, right?
        Hide
        jbaruch added a comment -

        You're right, I run it from command line (ant runs it from command line to be
        precise). The problem is I provide relative path and the portion of the path I
        provide doesn't include any spaces, so doublequoting it won't help.

        <target name="run">
        <java dir="." fork="true" classname="com.sun.japex.Japex">
        <classpath refid="class.path"/>
        <arg line="-last -line -merge src/conf/japex-config.xml/"/>
        </java>
        </target>

        Show
        jbaruch added a comment - You're right, I run it from command line (ant runs it from command line to be precise). The problem is I provide relative path and the portion of the path I provide doesn't include any spaces, so doublequoting it won't help. <target name="run"> <java dir="." fork="true" classname="com.sun.japex.Japex"> <classpath refid="class.path"/> <arg line="-last -line -merge src/conf/japex-config.xml/"/> </java> </target>
        Hide
        Santiago Pericas-Geertsen added a comment -

        Is it possible for you to provide a running example that I can use to reproduce the problem? That would
        be very helpful.

        Show
        Santiago Pericas-Geertsen added a comment - Is it possible for you to provide a running example that I can use to reproduce the problem? That would be very helpful.

          People

          • Assignee:
            Santiago Pericas-Geertsen
            Reporter:
            jbaruch
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: