java.lang.IllegalArgumentException: Illegal uri template: foo/bar:id

JBoss Issue Tracker | Leonard Brünings | 2 years ago
  1. 0

    When calling UriBuilder with a relative path that contains one or more colons, it fails with an IllegalArgumentException. {code:java} javax.ws.rs.core.UriBuilder.fromUri("foo/bar:id") {code} {color:red}{noformat} java.lang.IllegalArgumentException: Illegal uri template: foo/bar:id at org.jboss.resteasy.specimpl.ResteasyUriBuilder.parseHierarchicalUri(ResteasyUriBuilder.java:177) at org.jboss.resteasy.specimpl.ResteasyUriBuilder.uriTemplate(ResteasyUriBuilder.java:135) at org.jboss.resteasy.specimpl.ResteasyUriBuilder.uri(ResteasyUriBuilder.java:188) at javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:119) {noformat}{color} {code:java} if (!scheme && !"".equals(group) && !group.startsWith("/") && group.indexOf(':') > -1) throw new IllegalArgumentException("Illegal uri template: " + uriTemplate); {code} This line in org.jboss.resteasy.specimpl.ResteasyUriBuilder#parseHierarchicalUri checks explicitly if a colon is contained in the path and throws this exception. According to http://tools.ietf.org/html/rfc3986#appendix-A the colon is allowed in the path at this position. For path-noscheme only the first segment MUST NOT contain a colon, every following segment can contain pchar* including colon. {noformat} path = path-abempty ; begins with "/" or is empty / path-absolute ; begins with "/" but not "//" / path-noscheme ; begins with a non-colon segment / path-rootless ; begins with a segment / path-empty ; zero characters path-abempty = *( "/" segment ) path-absolute = "/" [ segment-nz *( "/" segment ) ] path-noscheme = segment-nz-nc *( "/" segment ) path-rootless = segment-nz *( "/" segment ) path-empty = 0<pchar> segment = *pchar segment-nz = 1*pchar segment-nz-nc = 1*( unreserved / pct-encoded / sub-delims / "@" ) ; non-zero-length segment without any colon ":" pchar = unreserved / pct-encoded / sub-delims / ":" / "@" {noformat} This bug causes org.jboss.resteasy.mock.MockHttpRequest#initWithUri(java.lang.String) to fail for relative URIs that contain colons.

    JBoss Issue Tracker | 2 years ago | Leonard Brünings
    java.lang.IllegalArgumentException: Illegal uri template: foo/bar:id
  2. 0

    When calling UriBuilder with a relative path that contains one or more colons, it fails with an IllegalArgumentException. {code:java} javax.ws.rs.core.UriBuilder.fromUri("foo/bar:id") {code} {color:red}{noformat} java.lang.IllegalArgumentException: Illegal uri template: foo/bar:id at org.jboss.resteasy.specimpl.ResteasyUriBuilder.parseHierarchicalUri(ResteasyUriBuilder.java:177) at org.jboss.resteasy.specimpl.ResteasyUriBuilder.uriTemplate(ResteasyUriBuilder.java:135) at org.jboss.resteasy.specimpl.ResteasyUriBuilder.uri(ResteasyUriBuilder.java:188) at javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:119) {noformat}{color} {code:java} if (!scheme && !"".equals(group) && !group.startsWith("/") && group.indexOf(':') > -1) throw new IllegalArgumentException("Illegal uri template: " + uriTemplate); {code} This line in org.jboss.resteasy.specimpl.ResteasyUriBuilder#parseHierarchicalUri checks explicitly if a colon is contained in the path and throws this exception. According to http://tools.ietf.org/html/rfc3986#appendix-A the colon is allowed in the path at this position. For path-noscheme only the first segment MUST NOT contain a colon, every following segment can contain pchar* including colon. {noformat} path = path-abempty ; begins with "/" or is empty / path-absolute ; begins with "/" but not "//" / path-noscheme ; begins with a non-colon segment / path-rootless ; begins with a segment / path-empty ; zero characters path-abempty = *( "/" segment ) path-absolute = "/" [ segment-nz *( "/" segment ) ] path-noscheme = segment-nz-nc *( "/" segment ) path-rootless = segment-nz *( "/" segment ) path-empty = 0<pchar> segment = *pchar segment-nz = 1*pchar segment-nz-nc = 1*( unreserved / pct-encoded / sub-delims / "@" ) ; non-zero-length segment without any colon ":" pchar = unreserved / pct-encoded / sub-delims / ":" / "@" {noformat} This bug causes org.jboss.resteasy.mock.MockHttpRequest#initWithUri(java.lang.String) to fail for relative URIs that contain colons.

    JBoss Issue Tracker | 2 years ago | Leonard Brünings
    java.lang.IllegalArgumentException: Illegal uri template: foo/bar:id
  3. 0

    Hadoop 2.6.0 Release Notes

    apache.org | 3 months ago
    java.lang.IllegalArgumentException: Illegal value of maximumCapacity -0.01 used in call to setMaxCapacity for queue foo
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    [jira] [Updated] (YARN-343) Capacity Scheduler maximum-capacity value -1 is invalid - Grokbase

    grokbase.com | 1 year ago
    java.lang.IllegalArgumentException: Illegal value of maximumCapacity -0.01 used in call to setMaxCapacity for queue foo
  6. 0

    Hadoop 2.6.0 Release Notes

    apache.org | 3 months ago
    java.lang.IllegalArgumentException: Illegal value of maximumCapacity -0.01 used in call to setMaxCapacity for queue foo

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      Illegal uri template: foo/bar:id

      at org.jboss.resteasy.specimpl.ResteasyUriBuilder.parseHierarchicalUri()
    2. RESTEasy JAX-RS Implementation
      ResteasyUriBuilder.uri
      1. org.jboss.resteasy.specimpl.ResteasyUriBuilder.parseHierarchicalUri(ResteasyUriBuilder.java:177)
      2. org.jboss.resteasy.specimpl.ResteasyUriBuilder.uriTemplate(ResteasyUriBuilder.java:135)
      3. org.jboss.resteasy.specimpl.ResteasyUriBuilder.uri(ResteasyUriBuilder.java:188)
      3 frames
    3. JavaEE 7
      UriBuilder.fromUri
      1. javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:119)
      1 frame