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)
  • Jetty
  • JETTY-1136

WebInfConfiguration fails with URLs with whitespace

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Duplicate
  • Affects Version/s: 7.0.0
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    Windows XP SP3, Maven 2.0.10, JDK6
  • Patch Submitted:
    Yes

Description

I recently set the jetty-maven-plugin to 7.0.0.v20091005 and started with jetty:run. A exception was thrown, server started but was not able to serve the war file. See attached logfile.

I tracked down the bug to jetty-webapp in line 81. The conversion to URI fails because my path contains spaces which are not permitted unquoted in URIs. I have patched the source file and attached it.

The patch file is a diff against: http://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/tags/jetty-7.0.0.v20091005/jetty-webapp/

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

Attachments

  1. Text File
    invalid-uri.patch
    31/Oct/09 12:47 PM
    0.7 kB
    Michael Osipov
  2. Text File
    jetty-run-after-patch.log
    31/Oct/09 12:47 PM
    3 kB
    Michael Osipov
  3. Text File
    jetty-run-fails.log
    31/Oct/09 12:47 PM
    6 kB
    Michael Osipov

Issue Links

duplicates

Bug - A problem which impairs or prevents the functions of the product. JETTY-1063 Jetty Maven Plugin 7.0.0.1beta2 has problems with spaces in class path resource references

  • Major - Major loss of function.
  • Resolved - A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Michael Osipov added a comment - 31/Oct/09 12:50 PM

I don't know which is the right tracker, so I filed at Eclipse's Bugzilla too: https://bugs.eclipse.org/bugs/show_bug.cgi?id=293854

Show
Michael Osipov added a comment - 31/Oct/09 12:50 PM I don't know which is the right tracker, so I filed at Eclipse's Bugzilla too: https://bugs.eclipse.org/bugs/show_bug.cgi?id=293854
Hide
Permalink
Jan Bartel added a comment - 01/Nov/09 11:03 PM

Hi Michael,

This is actually a known problem with maven - it doesn't correctly escape the urls it puts onto the classpath. If you follow the link to JETTY-1063 you'll see a link to the bug report raised on maven.

Jetty itself correctly escapes all urls it puts on the classpath, it is only when we run inside maven that this problem occurs. So, I don't want to change the core of jetty to basically decode and then re-encode every url (and some classpaths can have literally hundreds of jars on them). I'd be happy to use this patch if it could be applied to a class that only exists in the maven integration, but unfortunately there isn't an appropriate one - whilst MavenWebInfConfiguration extends WebInfConfiguration, it does not override that section of code and I don't want to cut and paste such core sections if I can avoid it.

For now, I've marked JETTY-1063 as won't fix, as I'd rather see maven fix its own problem than introduce special code into jetty to deal with it. If it looks like maven isn't going to fix it any time soon, then we may have to revisit this decision.

We may eventually avoid this problem in any case, as there is a growing demand for us to change the way we interface to maven. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=293866 for example. If we don't use maven's classloader then we can potentially avoid the problem with its faulty url encoding altogether.

For now, can you use the workaround of moving to a path that does not contain spaces?

Thanks for being thorough enough to provide a patch, even if it looks like we can't use it in this instance.

Jan

Show
Jan Bartel added a comment - 01/Nov/09 11:03 PM Hi Michael, This is actually a known problem with maven - it doesn't correctly escape the urls it puts onto the classpath. If you follow the link to JETTY-1063 you'll see a link to the bug report raised on maven. Jetty itself correctly escapes all urls it puts on the classpath, it is only when we run inside maven that this problem occurs. So, I don't want to change the core of jetty to basically decode and then re-encode every url (and some classpaths can have literally hundreds of jars on them). I'd be happy to use this patch if it could be applied to a class that only exists in the maven integration, but unfortunately there isn't an appropriate one - whilst MavenWebInfConfiguration extends WebInfConfiguration, it does not override that section of code and I don't want to cut and paste such core sections if I can avoid it. For now, I've marked JETTY-1063 as won't fix, as I'd rather see maven fix its own problem than introduce special code into jetty to deal with it. If it looks like maven isn't going to fix it any time soon, then we may have to revisit this decision. We may eventually avoid this problem in any case, as there is a growing demand for us to change the way we interface to maven. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=293866 for example. If we don't use maven's classloader then we can potentially avoid the problem with its faulty url encoding altogether. For now, can you use the workaround of moving to a path that does not contain spaces? Thanks for being thorough enough to provide a patch, even if it looks like we can't use it in this instance. Jan
Hide
Permalink
Michael Osipov added a comment - 02/Nov/09 6:41 AM

Hi Jan,

thank you on elaborating on the issue to that extent. This is, of course, a pity that the fix may take a while. I agree that Jetty should remain as-is. And inheritance should be used in the plugin to avoid double-code-maintenance.

I my case, I can move the local repo but others maybe can't. I want to use Jetty 7 as testing and rapid deployment, seems like I have to stick to 6.x.

Thanks for your time, I will continue the discussion in MNG.

Mike

Show
Michael Osipov added a comment - 02/Nov/09 6:41 AM Hi Jan, thank you on elaborating on the issue to that extent. This is, of course, a pity that the fix may take a while. I agree that Jetty should remain as-is. And inheritance should be used in the plugin to avoid double-code-maintenance. I my case, I can move the local repo but others maybe can't. I want to use Jetty 7 as testing and rapid deployment, seems like I have to stick to 6.x. Thanks for your time, I will continue the discussion in MNG. Mike

People

  • Assignee:
    Unassigned
    Reporter:
    Michael Osipov
Vote (0)
Watch (0)

Dates

  • Created:
    31/Oct/09 12:47 PM
    Updated:
    02/Nov/09 6:41 AM
    Resolved:
    01/Nov/09 11:04 PM
  • 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.