jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven Surefire
  • SUREFIRE-46

Proper escape of classpath entries esp. in windows

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Duplicate
  • Affects Version/s: 2.0 (2.2 plugin)
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    Windows
  • Complexity:
    Intermediate

Description

When a classpath entry has a directory with spaces, surefire booter class doesn't properly create the URL. i.e. it doesn't escape the url's added.

I have attached a patch that would fix this problem.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. XML File
    pom.xml
    08/Jun/06 2:04 PM
    0.9 kB
    Balaji Ravi
  2. XML File
    pom.xml
    08/Jun/06 2:03 PM
    0.9 kB
    Balaji Ravi
  3. Text File
    surefire-booter.patch
    06/Jun/06 10:30 AM
    0.4 kB
    Balaji Ravi
  4. Java Source File
    SurefirebugTest.java
    08/Jun/06 2:04 PM
    0.8 kB
    Balaji Ravi

Issue Links

is related to

Bug - A problem which impairs or prevents the functions of the product. SUREFIRE-123 SurefireBooter can initialize classloader with badly formed URLs

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.
is superceded by

Bug - A problem which impairs or prevents the functions of the product. SUREFIRE-123 SurefireBooter can initialize classloader with badly formed URLs

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.
relates to

Bug - A problem which impairs or prevents the functions of the product. PLX-220 URLs in container realm are not escaped.

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Bug - A problem which impairs or prevents the functions of the product. SUREFIRE-123 SurefireBooter can initialize classloader with badly formed URLs

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Carlos Sanchez added a comment - 07/Jun/06 1:54 PM

What's your problem? It works for me

mvn -X test

Forking command line:
java -classpath "C:\Documents and Settings\csanchez\.m2\repository\org\apache\maven\surefire\surefire-api\2.0\surefire-api-2.0.jar;C:\Documents and Settings\csanchez\.m2\repository\org\codehaus\plexus\plexus-utils\1.1\plexus-utils-1.1.jar;C:\Documents and Settings\csanchez\.m2\repository\org\apache\maven\surefire\surefire-booter\2.0\surefire-booter-2.0.jar" org.apache.maven.surefire.booter.SurefireBooter c:\DOCUME~1\csanchez\LOCALS~1\Temp\surefire7726tmp c:\DOCUME~1\csanchez\LOCALS~1\Temp\surefire7727tmp

Show
Carlos Sanchez added a comment - 07/Jun/06 1:54 PM What's your problem? It works for me mvn -X test Forking command line: java -classpath "C:\Documents and Settings\csanchez\.m2\repository\org\apache\maven\surefire\surefire-api\2.0\surefire-api-2.0.jar;C:\Documents and Settings\csanchez\.m2\repository\org\codehaus\plexus\plexus-utils\1.1\plexus-utils-1.1.jar;C:\Documents and Settings\csanchez\.m2\repository\org\apache\maven\surefire\surefire-booter\2.0\surefire-booter-2.0.jar" org.apache.maven.surefire.booter.SurefireBooter c:\DOCUME~1\csanchez\LOCALS~1\Temp\surefire7726tmp c:\DOCUME~1\csanchez\LOCALS~1\Temp\surefire7727tmp
Hide
Permalink
Balaji Ravi added a comment - 07/Jun/06 2:21 PM

The problem is when the RMI class loader is actually using the url's obtained from the surefire classloader. The surefire booter creates the url using the file.toURL() call and it doesn't escape the url's which contains spaces...

Show
Balaji Ravi added a comment - 07/Jun/06 2:21 PM The problem is when the RMI class loader is actually using the url's obtained from the surefire classloader. The surefire booter creates the url using the file.toURL() call and it doesn't escape the url's which contains spaces...
Hide
Permalink
Daniel Kulp added a comment - 07/Jun/06 2:37 PM

This is a critical issue for the Apache Yoko project. There is an associated bug logged there:

http://issues.apache.org/jira/browse/YOKO-48

Show
Daniel Kulp added a comment - 07/Jun/06 2:37 PM This is a critical issue for the Apache Yoko project. There is an associated bug logged there: http://issues.apache.org/jira/browse/YOKO-48
Hide
Permalink
Balaji Ravi added a comment - 08/Jun/06 2:02 PM

I have attached a test case for this bug. The problem is that the URL's being put in to the URLClassLoader have spaces in them & when the RMIClassLoader or something else uses a StringTokenizer to get the URL's, it splits them because of the spaces in to 2 urls...

Ideally, when putting the URL's in the classloader, we should properly escape it. It is a bug in File.toURL method & sun has recognized that & because of some compatibility issues, they have provided a workaround to use File.toURI().toURL();

Hope this helps...

Show
Balaji Ravi added a comment - 08/Jun/06 2:02 PM I have attached a test case for this bug. The problem is that the URL's being put in to the URLClassLoader have spaces in them & when the RMIClassLoader or something else uses a StringTokenizer to get the URL's, it splits them because of the spaces in to 2 urls... Ideally, when putting the URL's in the classloader, we should properly escape it. It is a bug in File.toURL method & sun has recognized that & because of some compatibility issues, they have provided a workaround to use File.toURI().toURL(); Hope this helps...
Hide
Permalink
Balaji Ravi added a comment - 08/Jun/06 2:04 PM

Forgot to attach the testcase

Show
Balaji Ravi added a comment - 08/Jun/06 2:04 PM Forgot to attach the testcase
Hide
Permalink
Olivier Lamy added a comment - 08/Jun/06 3:04 PM

Hi,
There is a lot of bugs in http://bugs.sun.com/bugdatabase concerning this.
You have some workarounds :

  • no more using windows
  • adding an element <localRepository/> in your settings

–
Olivier

Show
Olivier Lamy added a comment - 08/Jun/06 3:04 PM Hi, There is a lot of bugs in http://bugs.sun.com/bugdatabase concerning this. You have some workarounds :
  • no more using windows
  • adding an element <localRepository/> in your settings
– Olivier
Hide
Permalink
Balaji Ravi added a comment - 09/Jun/06 6:04 AM

Hi olivier,

I understand there are other workarounds from the users perspective & that is what i am doing currently, but why shouldn't it be fixed in the future release of surefire... Also, it is not just the repository having spaces but any project shouldn't have spaces in their directory names. My main point is if we can fix it in the source, then it would require no tweaking in the user side...

  • Balaji
Show
Balaji Ravi added a comment - 09/Jun/06 6:04 AM Hi olivier, I understand there are other workarounds from the users perspective & that is what i am doing currently, but why shouldn't it be fixed in the future release of surefire... Also, it is not just the repository having spaces but any project shouldn't have spaces in their directory names. My main point is if we can fix it in the source, then it would require no tweaking in the user side...
  • Balaji
Hide
Permalink
Brett Porter added a comment - 31/Jul/06 3:18 AM

the patch would not work on JDK 1.3. MSUREFIRE-148 contained a better patch.

Show
Brett Porter added a comment - 31/Jul/06 3:18 AM the patch would not work on JDK 1.3. MSUREFIRE-148 contained a better patch.

People

  • Assignee:
    Brett Porter
    Reporter:
    Balaji Ravi
Vote (7)
Watch (2)

Dates

  • Created:
    06/Jun/06 10:30 AM
    Updated:
    31/Jul/06 3:19 AM
    Resolved:
    31/Jul/06 3:19 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.