You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@etch.apache.org by "Brian Smith (JIRA)" <ji...@apache.org> on 2009/04/26 01:37:30 UTC

[jira] Created: (ETCH-69) Compiler throws URISyntaxException if there are spaces in the classpath

Compiler throws URISyntaxException if there are spaces in the classpath
-----------------------------------------------------------------------

                 Key: ETCH-69
                 URL: https://issues.apache.org/jira/browse/ETCH-69
             Project: Etch
          Issue Type: Bug
          Components: compiler
    Affects Versions: 1.0.2
         Environment: Windows XP, java 1.6, maven 2.0.9, ant 1.7.0
            Reporter: Brian Smith
            Priority: Minor


While trying to write a maven POM that executes the etch task via the antrun plugin, I discovered EtchCompiler throwing an exception if the path to the etch jars contains spaces. This resulted from my M2 repository being located in c:\Documents and Settings\brian\.m2\repository. The output is:

-+-+-
$ mvn package
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Spawn API Client and Server Interfaces
[INFO]    task-segment: [package]
[INFO] ------------------------------------------------------------------------
[INFO] [antrun:run {execution: default}]
[INFO] Executing tasks

init:

generate:
java.net.URISyntaxException: Illegal character in path at index 18: file:/C:/Documents and Settings/brian/.m2/repository/org/apa
che/maven/plugins/maven-antrun-plugin/1.1/maven-antrun-plugin-1.1.jar
        at java.net.URI$Parser.fail(URI.java:2809)
        at java.net.URI$Parser.checkChars(URI.java:2982)
        at java.net.URI$Parser.parseHierarchical(URI.java:3066)
        at java.net.URI$Parser.parse(URI.java:3014)
        at java.net.URI.<init>(URI.java:578)
        at java.net.URL.toURI(URL.java:918)
        at etch.compiler.EtchCompiler.setupClassLoader(EtchCompiler.java:222)
        at etch.tools.ant.EtchCompileTask.execute(EtchCompileTask.java:245)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at org.apache.tools.ant.Target.performTasks(Target.java:369)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
        at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(AbstractAntMojo.java:108)
        at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:83)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error executing ant tasks
-+-+-

The documentation for URL.toURI() says that it cannot produce a URI if the URL is not RFC 2396 compliant. Using a multi-arg constructor for URI fixes the problem. In EtchCompiler.java, replace line 222 with:
                    String scheme = "file";
                    int pathBegin = scheme.length() + 1;
                    String path = s.substring(pathBegin);
                    // multi-arg constructor properly escapes paths
                    File f = new File(new URI(scheme, null, path, null));



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ETCH-69) Compiler throws URISyntaxException if there are spaces in the classpath

Posted by "Brian Smith (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ETCH-69?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12702846#action_12702846 ] 

Brian Smith commented on ETCH-69:
---------------------------------

I have already set up an internal maven repository with my patched version, so I have no immediate need from you guys. I just wanted to report the issue and offer the fix. Thanks!

> Compiler throws URISyntaxException if there are spaces in the classpath
> -----------------------------------------------------------------------
>
>                 Key: ETCH-69
>                 URL: https://issues.apache.org/jira/browse/ETCH-69
>             Project: Etch
>          Issue Type: Bug
>          Components: compiler
>    Affects Versions: 1.0.2
>         Environment: Windows XP, java 1.6, maven 2.0.9, ant 1.7.0
>            Reporter: Brian Smith
>            Priority: Minor
>
> While trying to write a maven POM that executes the etch task via the antrun plugin, I discovered EtchCompiler throwing an exception if the path to the etch jars contains spaces. This resulted from my M2 repository being located in c:\Documents and Settings\brian\.m2\repository. The output is:
> -+-+-
> $ mvn package
> [INFO] Scanning for projects...
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Spawn API Client and Server Interfaces
> [INFO]    task-segment: [package]
> [INFO] ------------------------------------------------------------------------
> [INFO] [antrun:run {execution: default}]
> [INFO] Executing tasks
> init:
> generate:
> java.net.URISyntaxException: Illegal character in path at index 18: file:/C:/Documents and Settings/brian/.m2/repository/org/apa
> che/maven/plugins/maven-antrun-plugin/1.1/maven-antrun-plugin-1.1.jar
>         at java.net.URI$Parser.fail(URI.java:2809)
>         at java.net.URI$Parser.checkChars(URI.java:2982)
>         at java.net.URI$Parser.parseHierarchical(URI.java:3066)
>         at java.net.URI$Parser.parse(URI.java:3014)
>         at java.net.URI.<init>(URI.java:578)
>         at java.net.URL.toURI(URL.java:918)
>         at etch.compiler.EtchCompiler.setupClassLoader(EtchCompiler.java:222)
>         at etch.tools.ant.EtchCompileTask.execute(EtchCompileTask.java:245)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.tools.ant.Target.performTasks(Target.java:369)
>         at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
>         at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37)
>         at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
>         at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(AbstractAntMojo.java:108)
>         at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:83)
>         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>         at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> [INFO] ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] Error executing ant tasks
> -+-+-
> The documentation for URL.toURI() says that it cannot produce a URI if the URL is not RFC 2396 compliant. Using a multi-arg constructor for URI fixes the problem. In EtchCompiler.java, replace line 222 with:
>                     String scheme = "file";
>                     int pathBegin = scheme.length() + 1;
>                     String path = s.substring(pathBegin);
>                     // multi-arg constructor properly escapes paths
>                     File f = new File(new URI(scheme, null, path, null));

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ETCH-69) Compiler throws URISyntaxException if there are spaces in the classpath

Posted by "Richard Bolkey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ETCH-69?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12702840#action_12702840 ] 

Richard Bolkey commented on ETCH-69:
------------------------------------

I had run into this issue as well.  Forget exactly what I discovered, but I seem to recall that URLClassLoader being passed into Etch from Maven not being all that friendly (or something like that ... it's a little fuzzy).  I do remember the work around I used though.  

In your settings.xml file, set your local repository path to "c:\docume~1\<username>\.m2\repository



> Compiler throws URISyntaxException if there are spaces in the classpath
> -----------------------------------------------------------------------
>
>                 Key: ETCH-69
>                 URL: https://issues.apache.org/jira/browse/ETCH-69
>             Project: Etch
>          Issue Type: Bug
>          Components: compiler
>    Affects Versions: 1.0.2
>         Environment: Windows XP, java 1.6, maven 2.0.9, ant 1.7.0
>            Reporter: Brian Smith
>            Priority: Minor
>
> While trying to write a maven POM that executes the etch task via the antrun plugin, I discovered EtchCompiler throwing an exception if the path to the etch jars contains spaces. This resulted from my M2 repository being located in c:\Documents and Settings\brian\.m2\repository. The output is:
> -+-+-
> $ mvn package
> [INFO] Scanning for projects...
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Spawn API Client and Server Interfaces
> [INFO]    task-segment: [package]
> [INFO] ------------------------------------------------------------------------
> [INFO] [antrun:run {execution: default}]
> [INFO] Executing tasks
> init:
> generate:
> java.net.URISyntaxException: Illegal character in path at index 18: file:/C:/Documents and Settings/brian/.m2/repository/org/apa
> che/maven/plugins/maven-antrun-plugin/1.1/maven-antrun-plugin-1.1.jar
>         at java.net.URI$Parser.fail(URI.java:2809)
>         at java.net.URI$Parser.checkChars(URI.java:2982)
>         at java.net.URI$Parser.parseHierarchical(URI.java:3066)
>         at java.net.URI$Parser.parse(URI.java:3014)
>         at java.net.URI.<init>(URI.java:578)
>         at java.net.URL.toURI(URL.java:918)
>         at etch.compiler.EtchCompiler.setupClassLoader(EtchCompiler.java:222)
>         at etch.tools.ant.EtchCompileTask.execute(EtchCompileTask.java:245)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.tools.ant.Target.performTasks(Target.java:369)
>         at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
>         at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37)
>         at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
>         at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(AbstractAntMojo.java:108)
>         at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:83)
>         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>         at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> [INFO] ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] Error executing ant tasks
> -+-+-
> The documentation for URL.toURI() says that it cannot produce a URI if the URL is not RFC 2396 compliant. Using a multi-arg constructor for URI fixes the problem. In EtchCompiler.java, replace line 222 with:
>                     String scheme = "file";
>                     int pathBegin = scheme.length() + 1;
>                     String path = s.substring(pathBegin);
>                     // multi-arg constructor properly escapes paths
>                     File f = new File(new URI(scheme, null, path, null));

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ETCH-69) Compiler throws URISyntaxException if there are spaces in the classpath

Posted by "scott comer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ETCH-69?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12702844#action_12702844 ] 

scott comer commented on ETCH-69:
---------------------------------

ok, brian, thanks. i've implemented the fix and it doesn't break anything. eventually we could barf out a 1.0.2.1 release with the fix. do you need a special build now to move forward? what do you need right now from us?

i'm not setup with maven to test the fix but you have so i think we're good there.

> Compiler throws URISyntaxException if there are spaces in the classpath
> -----------------------------------------------------------------------
>
>                 Key: ETCH-69
>                 URL: https://issues.apache.org/jira/browse/ETCH-69
>             Project: Etch
>          Issue Type: Bug
>          Components: compiler
>    Affects Versions: 1.0.2
>         Environment: Windows XP, java 1.6, maven 2.0.9, ant 1.7.0
>            Reporter: Brian Smith
>            Priority: Minor
>
> While trying to write a maven POM that executes the etch task via the antrun plugin, I discovered EtchCompiler throwing an exception if the path to the etch jars contains spaces. This resulted from my M2 repository being located in c:\Documents and Settings\brian\.m2\repository. The output is:
> -+-+-
> $ mvn package
> [INFO] Scanning for projects...
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Spawn API Client and Server Interfaces
> [INFO]    task-segment: [package]
> [INFO] ------------------------------------------------------------------------
> [INFO] [antrun:run {execution: default}]
> [INFO] Executing tasks
> init:
> generate:
> java.net.URISyntaxException: Illegal character in path at index 18: file:/C:/Documents and Settings/brian/.m2/repository/org/apa
> che/maven/plugins/maven-antrun-plugin/1.1/maven-antrun-plugin-1.1.jar
>         at java.net.URI$Parser.fail(URI.java:2809)
>         at java.net.URI$Parser.checkChars(URI.java:2982)
>         at java.net.URI$Parser.parseHierarchical(URI.java:3066)
>         at java.net.URI$Parser.parse(URI.java:3014)
>         at java.net.URI.<init>(URI.java:578)
>         at java.net.URL.toURI(URL.java:918)
>         at etch.compiler.EtchCompiler.setupClassLoader(EtchCompiler.java:222)
>         at etch.tools.ant.EtchCompileTask.execute(EtchCompileTask.java:245)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.tools.ant.Target.performTasks(Target.java:369)
>         at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
>         at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37)
>         at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
>         at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(AbstractAntMojo.java:108)
>         at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:83)
>         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>         at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> [INFO] ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] Error executing ant tasks
> -+-+-
> The documentation for URL.toURI() says that it cannot produce a URI if the URL is not RFC 2396 compliant. Using a multi-arg constructor for URI fixes the problem. In EtchCompiler.java, replace line 222 with:
>                     String scheme = "file";
>                     int pathBegin = scheme.length() + 1;
>                     String path = s.substring(pathBegin);
>                     // multi-arg constructor properly escapes paths
>                     File f = new File(new URI(scheme, null, path, null));

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ETCH-69) Compiler throws URISyntaxException if there are spaces in the classpath

Posted by "scott comer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ETCH-69?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12702886#action_12702886 ] 

scott comer commented on ETCH-69:
---------------------------------

scott built installers uploaded to:

http://idisk.mac.com/wert1y-Public/etch-1021

md5sum says:

6b1df86724f8d6ea31a9ffa2463aa092 *apache-etch-1.0.2-incubating-setup.exe
cc763bc9eb109f5e1843fdd474ef364d *apache-etch-1.0.2-incubating.tar.gz
8f0bf8cb6ddd3f0faed80b4710b4ed23 *apache-etch-1.0.2-incubating.zip

please be sure to check them before you use them.

> Compiler throws URISyntaxException if there are spaces in the classpath
> -----------------------------------------------------------------------
>
>                 Key: ETCH-69
>                 URL: https://issues.apache.org/jira/browse/ETCH-69
>             Project: Etch
>          Issue Type: Bug
>          Components: compiler
>    Affects Versions: 1.0.2
>         Environment: Windows XP, java 1.6, maven 2.0.9, ant 1.7.0
>            Reporter: Brian Smith
>            Priority: Minor
>
> While trying to write a maven POM that executes the etch task via the antrun plugin, I discovered EtchCompiler throwing an exception if the path to the etch jars contains spaces. This resulted from my M2 repository being located in c:\Documents and Settings\brian\.m2\repository. The output is:
> -+-+-
> $ mvn package
> [INFO] Scanning for projects...
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Spawn API Client and Server Interfaces
> [INFO]    task-segment: [package]
> [INFO] ------------------------------------------------------------------------
> [INFO] [antrun:run {execution: default}]
> [INFO] Executing tasks
> init:
> generate:
> java.net.URISyntaxException: Illegal character in path at index 18: file:/C:/Documents and Settings/brian/.m2/repository/org/apa
> che/maven/plugins/maven-antrun-plugin/1.1/maven-antrun-plugin-1.1.jar
>         at java.net.URI$Parser.fail(URI.java:2809)
>         at java.net.URI$Parser.checkChars(URI.java:2982)
>         at java.net.URI$Parser.parseHierarchical(URI.java:3066)
>         at java.net.URI$Parser.parse(URI.java:3014)
>         at java.net.URI.<init>(URI.java:578)
>         at java.net.URL.toURI(URL.java:918)
>         at etch.compiler.EtchCompiler.setupClassLoader(EtchCompiler.java:222)
>         at etch.tools.ant.EtchCompileTask.execute(EtchCompileTask.java:245)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.tools.ant.Target.performTasks(Target.java:369)
>         at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
>         at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37)
>         at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
>         at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(AbstractAntMojo.java:108)
>         at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:83)
>         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>         at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> [INFO] ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] Error executing ant tasks
> -+-+-
> The documentation for URL.toURI() says that it cannot produce a URI if the URL is not RFC 2396 compliant. Using a multi-arg constructor for URI fixes the problem. In EtchCompiler.java, replace line 222 with:
>                     String scheme = "file";
>                     int pathBegin = scheme.length() + 1;
>                     String path = s.substring(pathBegin);
>                     // multi-arg constructor properly escapes paths
>                     File f = new File(new URI(scheme, null, path, null));

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (ETCH-69) Compiler throws URISyntaxException if there are spaces in the classpath

Posted by "scott comer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ETCH-69?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

scott comer resolved ETCH-69.
-----------------------------

    Resolution: Fixed
      Assignee: scott comer

per patch from brian smith.

> Compiler throws URISyntaxException if there are spaces in the classpath
> -----------------------------------------------------------------------
>
>                 Key: ETCH-69
>                 URL: https://issues.apache.org/jira/browse/ETCH-69
>             Project: Etch
>          Issue Type: Bug
>          Components: compiler
>    Affects Versions: 1.0.2
>         Environment: Windows XP, java 1.6, maven 2.0.9, ant 1.7.0
>            Reporter: Brian Smith
>            Assignee: scott comer
>            Priority: Minor
>             Fix For: 1.1
>
>
> While trying to write a maven POM that executes the etch task via the antrun plugin, I discovered EtchCompiler throwing an exception if the path to the etch jars contains spaces. This resulted from my M2 repository being located in c:\Documents and Settings\brian\.m2\repository. The output is:
> -+-+-
> $ mvn package
> [INFO] Scanning for projects...
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Spawn API Client and Server Interfaces
> [INFO]    task-segment: [package]
> [INFO] ------------------------------------------------------------------------
> [INFO] [antrun:run {execution: default}]
> [INFO] Executing tasks
> init:
> generate:
> java.net.URISyntaxException: Illegal character in path at index 18: file:/C:/Documents and Settings/brian/.m2/repository/org/apa
> che/maven/plugins/maven-antrun-plugin/1.1/maven-antrun-plugin-1.1.jar
>         at java.net.URI$Parser.fail(URI.java:2809)
>         at java.net.URI$Parser.checkChars(URI.java:2982)
>         at java.net.URI$Parser.parseHierarchical(URI.java:3066)
>         at java.net.URI$Parser.parse(URI.java:3014)
>         at java.net.URI.<init>(URI.java:578)
>         at java.net.URL.toURI(URL.java:918)
>         at etch.compiler.EtchCompiler.setupClassLoader(EtchCompiler.java:222)
>         at etch.tools.ant.EtchCompileTask.execute(EtchCompileTask.java:245)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.tools.ant.Target.performTasks(Target.java:369)
>         at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
>         at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37)
>         at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
>         at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(AbstractAntMojo.java:108)
>         at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:83)
>         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>         at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> [INFO] ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] Error executing ant tasks
> -+-+-
> The documentation for URL.toURI() says that it cannot produce a URI if the URL is not RFC 2396 compliant. Using a multi-arg constructor for URI fixes the problem. In EtchCompiler.java, replace line 222 with:
>                     String scheme = "file";
>                     int pathBegin = scheme.length() + 1;
>                     String path = s.substring(pathBegin);
>                     // multi-arg constructor properly escapes paths
>                     File f = new File(new URI(scheme, null, path, null));

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ETCH-69) Compiler throws URISyntaxException if there are spaces in the classpath

Posted by "scott comer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ETCH-69?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12702885#action_12702885 ] 

scott comer commented on ETCH-69:
---------------------------------

ok, thanks very much!

> Compiler throws URISyntaxException if there are spaces in the classpath
> -----------------------------------------------------------------------
>
>                 Key: ETCH-69
>                 URL: https://issues.apache.org/jira/browse/ETCH-69
>             Project: Etch
>          Issue Type: Bug
>          Components: compiler
>    Affects Versions: 1.0.2
>         Environment: Windows XP, java 1.6, maven 2.0.9, ant 1.7.0
>            Reporter: Brian Smith
>            Priority: Minor
>
> While trying to write a maven POM that executes the etch task via the antrun plugin, I discovered EtchCompiler throwing an exception if the path to the etch jars contains spaces. This resulted from my M2 repository being located in c:\Documents and Settings\brian\.m2\repository. The output is:
> -+-+-
> $ mvn package
> [INFO] Scanning for projects...
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Spawn API Client and Server Interfaces
> [INFO]    task-segment: [package]
> [INFO] ------------------------------------------------------------------------
> [INFO] [antrun:run {execution: default}]
> [INFO] Executing tasks
> init:
> generate:
> java.net.URISyntaxException: Illegal character in path at index 18: file:/C:/Documents and Settings/brian/.m2/repository/org/apa
> che/maven/plugins/maven-antrun-plugin/1.1/maven-antrun-plugin-1.1.jar
>         at java.net.URI$Parser.fail(URI.java:2809)
>         at java.net.URI$Parser.checkChars(URI.java:2982)
>         at java.net.URI$Parser.parseHierarchical(URI.java:3066)
>         at java.net.URI$Parser.parse(URI.java:3014)
>         at java.net.URI.<init>(URI.java:578)
>         at java.net.URL.toURI(URL.java:918)
>         at etch.compiler.EtchCompiler.setupClassLoader(EtchCompiler.java:222)
>         at etch.tools.ant.EtchCompileTask.execute(EtchCompileTask.java:245)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.tools.ant.Target.performTasks(Target.java:369)
>         at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
>         at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37)
>         at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
>         at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(AbstractAntMojo.java:108)
>         at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:83)
>         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>         at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> [INFO] ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] Error executing ant tasks
> -+-+-
> The documentation for URL.toURI() says that it cannot produce a URI if the URL is not RFC 2396 compliant. Using a multi-arg constructor for URI fixes the problem. In EtchCompiler.java, replace line 222 with:
>                     String scheme = "file";
>                     int pathBegin = scheme.length() + 1;
>                     String path = s.substring(pathBegin);
>                     // multi-arg constructor properly escapes paths
>                     File f = new File(new URI(scheme, null, path, null));

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ETCH-69) Compiler throws URISyntaxException if there are spaces in the classpath

Posted by "scott comer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ETCH-69?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12702837#action_12702837 ] 

scott comer commented on ETCH-69:
---------------------------------

hi, brian. thanks. did you checkout the compiler and try this? any interest in doing that? if not, i can make a patch release for you to try.

> Compiler throws URISyntaxException if there are spaces in the classpath
> -----------------------------------------------------------------------
>
>                 Key: ETCH-69
>                 URL: https://issues.apache.org/jira/browse/ETCH-69
>             Project: Etch
>          Issue Type: Bug
>          Components: compiler
>    Affects Versions: 1.0.2
>         Environment: Windows XP, java 1.6, maven 2.0.9, ant 1.7.0
>            Reporter: Brian Smith
>            Priority: Minor
>
> While trying to write a maven POM that executes the etch task via the antrun plugin, I discovered EtchCompiler throwing an exception if the path to the etch jars contains spaces. This resulted from my M2 repository being located in c:\Documents and Settings\brian\.m2\repository. The output is:
> -+-+-
> $ mvn package
> [INFO] Scanning for projects...
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Spawn API Client and Server Interfaces
> [INFO]    task-segment: [package]
> [INFO] ------------------------------------------------------------------------
> [INFO] [antrun:run {execution: default}]
> [INFO] Executing tasks
> init:
> generate:
> java.net.URISyntaxException: Illegal character in path at index 18: file:/C:/Documents and Settings/brian/.m2/repository/org/apa
> che/maven/plugins/maven-antrun-plugin/1.1/maven-antrun-plugin-1.1.jar
>         at java.net.URI$Parser.fail(URI.java:2809)
>         at java.net.URI$Parser.checkChars(URI.java:2982)
>         at java.net.URI$Parser.parseHierarchical(URI.java:3066)
>         at java.net.URI$Parser.parse(URI.java:3014)
>         at java.net.URI.<init>(URI.java:578)
>         at java.net.URL.toURI(URL.java:918)
>         at etch.compiler.EtchCompiler.setupClassLoader(EtchCompiler.java:222)
>         at etch.tools.ant.EtchCompileTask.execute(EtchCompileTask.java:245)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.tools.ant.Target.performTasks(Target.java:369)
>         at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
>         at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37)
>         at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
>         at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(AbstractAntMojo.java:108)
>         at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:83)
>         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>         at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> [INFO] ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] Error executing ant tasks
> -+-+-
> The documentation for URL.toURI() says that it cannot produce a URI if the URL is not RFC 2396 compliant. Using a multi-arg constructor for URI fixes the problem. In EtchCompiler.java, replace line 222 with:
>                     String scheme = "file";
>                     int pathBegin = scheme.length() + 1;
>                     String path = s.substring(pathBegin);
>                     // multi-arg constructor properly escapes paths
>                     File f = new File(new URI(scheme, null, path, null));

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ETCH-69) Compiler throws URISyntaxException if there are spaces in the classpath

Posted by "scott comer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ETCH-69?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

scott comer updated ETCH-69:
----------------------------

    Fix Version/s: 1.1

> Compiler throws URISyntaxException if there are spaces in the classpath
> -----------------------------------------------------------------------
>
>                 Key: ETCH-69
>                 URL: https://issues.apache.org/jira/browse/ETCH-69
>             Project: Etch
>          Issue Type: Bug
>          Components: compiler
>    Affects Versions: 1.0.2
>         Environment: Windows XP, java 1.6, maven 2.0.9, ant 1.7.0
>            Reporter: Brian Smith
>            Priority: Minor
>             Fix For: 1.1
>
>
> While trying to write a maven POM that executes the etch task via the antrun plugin, I discovered EtchCompiler throwing an exception if the path to the etch jars contains spaces. This resulted from my M2 repository being located in c:\Documents and Settings\brian\.m2\repository. The output is:
> -+-+-
> $ mvn package
> [INFO] Scanning for projects...
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Spawn API Client and Server Interfaces
> [INFO]    task-segment: [package]
> [INFO] ------------------------------------------------------------------------
> [INFO] [antrun:run {execution: default}]
> [INFO] Executing tasks
> init:
> generate:
> java.net.URISyntaxException: Illegal character in path at index 18: file:/C:/Documents and Settings/brian/.m2/repository/org/apa
> che/maven/plugins/maven-antrun-plugin/1.1/maven-antrun-plugin-1.1.jar
>         at java.net.URI$Parser.fail(URI.java:2809)
>         at java.net.URI$Parser.checkChars(URI.java:2982)
>         at java.net.URI$Parser.parseHierarchical(URI.java:3066)
>         at java.net.URI$Parser.parse(URI.java:3014)
>         at java.net.URI.<init>(URI.java:578)
>         at java.net.URL.toURI(URL.java:918)
>         at etch.compiler.EtchCompiler.setupClassLoader(EtchCompiler.java:222)
>         at etch.tools.ant.EtchCompileTask.execute(EtchCompileTask.java:245)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.tools.ant.Target.performTasks(Target.java:369)
>         at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
>         at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37)
>         at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
>         at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(AbstractAntMojo.java:108)
>         at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:83)
>         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>         at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> [INFO] ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] Error executing ant tasks
> -+-+-
> The documentation for URL.toURI() says that it cannot produce a URI if the URL is not RFC 2396 compliant. Using a multi-arg constructor for URI fixes the problem. In EtchCompiler.java, replace line 222 with:
>                     String scheme = "file";
>                     int pathBegin = scheme.length() + 1;
>                     String path = s.substring(pathBegin);
>                     // multi-arg constructor properly escapes paths
>                     File f = new File(new URI(scheme, null, path, null));

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ETCH-69) Compiler throws URISyntaxException if there are spaces in the classpath

Posted by "Brian Smith (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ETCH-69?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12702842#action_12702842 ] 

Brian Smith commented on ETCH-69:
---------------------------------

That's a good workaround that would have saved me a few hours. 

The problem discussed here was due to the unreliability of URL.toURI(), not due to any weirdness from URLClassLoader.. The code that I posted fixes the "spaces in the URL" issue. 

> Compiler throws URISyntaxException if there are spaces in the classpath
> -----------------------------------------------------------------------
>
>                 Key: ETCH-69
>                 URL: https://issues.apache.org/jira/browse/ETCH-69
>             Project: Etch
>          Issue Type: Bug
>          Components: compiler
>    Affects Versions: 1.0.2
>         Environment: Windows XP, java 1.6, maven 2.0.9, ant 1.7.0
>            Reporter: Brian Smith
>            Priority: Minor
>
> While trying to write a maven POM that executes the etch task via the antrun plugin, I discovered EtchCompiler throwing an exception if the path to the etch jars contains spaces. This resulted from my M2 repository being located in c:\Documents and Settings\brian\.m2\repository. The output is:
> -+-+-
> $ mvn package
> [INFO] Scanning for projects...
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Spawn API Client and Server Interfaces
> [INFO]    task-segment: [package]
> [INFO] ------------------------------------------------------------------------
> [INFO] [antrun:run {execution: default}]
> [INFO] Executing tasks
> init:
> generate:
> java.net.URISyntaxException: Illegal character in path at index 18: file:/C:/Documents and Settings/brian/.m2/repository/org/apa
> che/maven/plugins/maven-antrun-plugin/1.1/maven-antrun-plugin-1.1.jar
>         at java.net.URI$Parser.fail(URI.java:2809)
>         at java.net.URI$Parser.checkChars(URI.java:2982)
>         at java.net.URI$Parser.parseHierarchical(URI.java:3066)
>         at java.net.URI$Parser.parse(URI.java:3014)
>         at java.net.URI.<init>(URI.java:578)
>         at java.net.URL.toURI(URL.java:918)
>         at etch.compiler.EtchCompiler.setupClassLoader(EtchCompiler.java:222)
>         at etch.tools.ant.EtchCompileTask.execute(EtchCompileTask.java:245)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.tools.ant.Target.performTasks(Target.java:369)
>         at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
>         at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37)
>         at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
>         at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(AbstractAntMojo.java:108)
>         at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:83)
>         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>         at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> [INFO] ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] Error executing ant tasks
> -+-+-
> The documentation for URL.toURI() says that it cannot produce a URI if the URL is not RFC 2396 compliant. Using a multi-arg constructor for URI fixes the problem. In EtchCompiler.java, replace line 222 with:
>                     String scheme = "file";
>                     int pathBegin = scheme.length() + 1;
>                     String path = s.substring(pathBegin);
>                     // multi-arg constructor properly escapes paths
>                     File f = new File(new URI(scheme, null, path, null));

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ETCH-69) Compiler throws URISyntaxException if there are spaces in the classpath

Posted by "Brian Smith (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ETCH-69?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12702838#action_12702838 ] 

Brian Smith commented on ETCH-69:
---------------------------------

I made the changes locally and it fixes the problem that I experienced (also need to add the necessary import of java.net.URI). I have not tested on a linux/unix.

> Compiler throws URISyntaxException if there are spaces in the classpath
> -----------------------------------------------------------------------
>
>                 Key: ETCH-69
>                 URL: https://issues.apache.org/jira/browse/ETCH-69
>             Project: Etch
>          Issue Type: Bug
>          Components: compiler
>    Affects Versions: 1.0.2
>         Environment: Windows XP, java 1.6, maven 2.0.9, ant 1.7.0
>            Reporter: Brian Smith
>            Priority: Minor
>
> While trying to write a maven POM that executes the etch task via the antrun plugin, I discovered EtchCompiler throwing an exception if the path to the etch jars contains spaces. This resulted from my M2 repository being located in c:\Documents and Settings\brian\.m2\repository. The output is:
> -+-+-
> $ mvn package
> [INFO] Scanning for projects...
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Spawn API Client and Server Interfaces
> [INFO]    task-segment: [package]
> [INFO] ------------------------------------------------------------------------
> [INFO] [antrun:run {execution: default}]
> [INFO] Executing tasks
> init:
> generate:
> java.net.URISyntaxException: Illegal character in path at index 18: file:/C:/Documents and Settings/brian/.m2/repository/org/apa
> che/maven/plugins/maven-antrun-plugin/1.1/maven-antrun-plugin-1.1.jar
>         at java.net.URI$Parser.fail(URI.java:2809)
>         at java.net.URI$Parser.checkChars(URI.java:2982)
>         at java.net.URI$Parser.parseHierarchical(URI.java:3066)
>         at java.net.URI$Parser.parse(URI.java:3014)
>         at java.net.URI.<init>(URI.java:578)
>         at java.net.URL.toURI(URL.java:918)
>         at etch.compiler.EtchCompiler.setupClassLoader(EtchCompiler.java:222)
>         at etch.tools.ant.EtchCompileTask.execute(EtchCompileTask.java:245)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.tools.ant.Target.performTasks(Target.java:369)
>         at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
>         at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37)
>         at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
>         at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(AbstractAntMojo.java:108)
>         at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:83)
>         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>         at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> [INFO] ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] Error executing ant tasks
> -+-+-
> The documentation for URL.toURI() says that it cannot produce a URI if the URL is not RFC 2396 compliant. Using a multi-arg constructor for URI fixes the problem. In EtchCompiler.java, replace line 222 with:
>                     String scheme = "file";
>                     int pathBegin = scheme.length() + 1;
>                     String path = s.substring(pathBegin);
>                     // multi-arg constructor properly escapes paths
>                     File f = new File(new URI(scheme, null, path, null));

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.