Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URISyntaxException #397

Closed
maurezen opened this issue Feb 3, 2015 · 18 comments
Closed

URISyntaxException #397

maurezen opened this issue Feb 3, 2015 · 18 comments
Assignees
Labels

Comments

@maurezen
Copy link
Contributor

maurezen commented Feb 3, 2015

In DefaultMavenEnvironment#classLoader there is a following code:

    urls.add(
        URI.create(String.format("file:///%s", path)).toURL()
    );

It gets executed for each entry in this,classpath(). If any entry contains space, this results in URISyntaxException.
A simple example of how this happens here jcabi/jcabi-xml#49 - Windows, maven repo in Documents and Settings folder, maven artifacts in classpath.
Relevant part of the log:

Caused by: java.lang.IllegalArgumentException: Illegal character in path at index 19: file://C:/Documents and Settings/JustUser/.m2/reposito ry/com/jcabi/jcabi-aspects/0.20.1/jcabi-aspects-0.20.1.jar at java.net.URI.create(URI.java:859) at com.qulice.maven.DefaultMavenEnvironment.classloader(DefaultMavenEnvironment.java:152) at com.qulice.checkstyle.CheckstyleValidator.validate(CheckstyleValidator.java:81) at com.qulice.maven.CheckMojo.run(CheckMojo.java:83) at com.qulice.maven.CheckMojo.doExecute(CheckMojo.java:59) at com.qulice.maven.AbstractQuliceMojo.execute(AbstractQuliceMojo.java:175) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132) ... 20 more Caused by: java.net.URISyntaxException: Illegal character in path at index 19: file://C:/Documents and Settings/JustUser/.m2/repository/com/ jcabi/jcabi-aspects/0.20.1/jcabi-aspects-0.20.1.jar at java.net.URI$Parser.fail(URI.java:2829) at java.net.URI$Parser.checkChars(URI.java:3002) at java.net.URI$Parser.parseHierarchical(URI.java:3086) at java.net.URI$Parser.parse(URI.java:3034) at java.net.URI.(URI.java:595) at java.net.URI.create(URI.java:857) ... 26 more

Suggested way of fixing it is using File#toURI instead of new URI(String).

@davvd
Copy link

davvd commented Feb 6, 2015

this task will get someone's attention soon

@davvd davvd added DEV labels Feb 6, 2015
@davvd
Copy link

davvd commented Feb 6, 2015

@maurezen many thanks for the bug report, I added 15 mins to your acc, transaction 51289193

@davvd
Copy link

davvd commented Mar 31, 2015

@krzyk it's yours, budget is 30 mins, please go ahead

@krzyk
Copy link
Collaborator

krzyk commented Apr 2, 2015

@maurezen strange, this looks like #243

@krzyk
Copy link
Collaborator

krzyk commented Apr 3, 2015

@maurezen the lines reported in the original issue don't match with current qulice release, it looks like jcabi-xml is using qulice < 0.8.2 qulice < 0.12.
Please upgrade the target project to the newest qulice (at least 0.12) and it will work fine.

@krzyk
Copy link
Collaborator

krzyk commented Apr 7, 2015

@maurezen ping

@krzyk
Copy link
Collaborator

krzyk commented Apr 7, 2015

@alex-palevsky please give me more time here

@krzyk
Copy link
Collaborator

krzyk commented Apr 9, 2015

@maurezen if the explanations is enough please close this issue

@maurezen
Copy link
Contributor Author

@krzyk at the moment jcabi-xml uses jcabi v 1.17, which uses parent 0.32.1, which uses qulice 0.12. At qulice's master branch the code is exactly as I've described, though the URI.create() call moved to the line number 159.

@krzyk
Copy link
Collaborator

krzyk commented Apr 11, 2015

@maurezen strange, because there is explicit case for spaces in the URL, so this must be some other case. Do you have the full stack trace and the URL for which it fails?

@krzyk
Copy link
Collaborator

krzyk commented Apr 24, 2015

@maurezen ping

@krzyk
Copy link
Collaborator

krzyk commented May 5, 2015

@maurezen and ping again

@krzyk
Copy link
Collaborator

krzyk commented May 27, 2015

@maurezen ping

@krzyk
Copy link
Collaborator

krzyk commented Jun 2, 2015

@maurezen help me out here, please

@krzyk
Copy link
Collaborator

krzyk commented Jun 19, 2015

@maurezen any news?

@maurezen
Copy link
Contributor Author

@krzyk uh. sorry, was distracted. I will take a look at this.

@maurezen
Copy link
Contributor Author

@krzyk failed to reproduce it. thanks for your effort!

@davvd
Copy link

davvd commented Jul 1, 2015

@krzyk Thanks a lot, I just topped your account for 38 mins, transaction ID 60333857, total time was 2165 hours and 56 mins... there is a bonus for fast delivery (age=2924)... +38 added to your rating, at the moment it is: +4522

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants