java.lang.IllegalArgumentException: Map has no value for 'repository'

Spring JIRA | Dave LeBlanc | 2 years ago
  1. 0

    On an object that has a one-to-many association (eg: a set of things) if we get the set without a custom content type, it returns the expected results. If however we request it in the compact type (application/x-spring-data-compact+json) - which I assume should just return a list of links, the call will throw an exception: "Map has no value for 'repository'". It's trying to build a URL with parameters: /{repository}/{id}/{property}, but all it gives for parameters is "property" -> "items" (looks like it's missing the repo and id properties). To recreate, use this URL with the restbucks example: http://localhost:8080/orders/1/items The stack trace is: 2014-11-07 18:14:46,185 ERROR o.s.d.rest.webmvc.AbstractRepositoryRestController: 179 - Map has no value for 'repository' java.lang.IllegalArgumentException: Map has no value for 'repository' at org.springframework.web.util.UriComponents$MapTemplateVariables.getValue(UriComponents.java:277) ~[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.web.util.UriComponents.expandUriComponent(UriComponents.java:221) ~[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.web.util.HierarchicalUriComponents$FullPathComponent.expand(HierarchicalUriComponents.java:642) ~[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.web.util.HierarchicalUriComponents.expandInternal(HierarchicalUriComponents.java:311) ~[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.web.util.HierarchicalUriComponents.expandInternal(HierarchicalUriComponents.java:46) ~[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.web.util.UriComponents.expand(UriComponents.java:152) ~[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.web.util.UriComponentsBuilder.buildAndExpand(UriComponentsBuilder.java:288) ~[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.hateoas.mvc.ControllerLinkBuilderFactory.linkTo(ControllerLinkBuilderFactory.java:145) ~[spring-hateoas-0.16.0.RELEASE.jar:na] at org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo(ControllerLinkBuilder.java:135) ~[spring-hateoas-0.16.0.RELEASE.jar:na] at org.springframework.data.rest.webmvc.RepositoryPropertyReferenceController.followPropertyReferenceCompact(RepositoryPropertyReferenceController.java:264) ~[spring-data-rest-webmvc-2.2.0.RC1.jar:na]

    Spring JIRA | 2 years ago | Dave LeBlanc
    java.lang.IllegalArgumentException: Map has no value for 'repository'
  2. 0

    On an object that has a one-to-many association (eg: a set of things) if we get the set without a custom content type, it returns the expected results. If however we request it in the compact type (application/x-spring-data-compact+json) - which I assume should just return a list of links, the call will throw an exception: "Map has no value for 'repository'". It's trying to build a URL with parameters: /{repository}/{id}/{property}, but all it gives for parameters is "property" -> "items" (looks like it's missing the repo and id properties). To recreate, use this URL with the restbucks example: http://localhost:8080/orders/1/items The stack trace is: 2014-11-07 18:14:46,185 ERROR o.s.d.rest.webmvc.AbstractRepositoryRestController: 179 - Map has no value for 'repository' java.lang.IllegalArgumentException: Map has no value for 'repository' at org.springframework.web.util.UriComponents$MapTemplateVariables.getValue(UriComponents.java:277) ~[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.web.util.UriComponents.expandUriComponent(UriComponents.java:221) ~[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.web.util.HierarchicalUriComponents$FullPathComponent.expand(HierarchicalUriComponents.java:642) ~[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.web.util.HierarchicalUriComponents.expandInternal(HierarchicalUriComponents.java:311) ~[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.web.util.HierarchicalUriComponents.expandInternal(HierarchicalUriComponents.java:46) ~[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.web.util.UriComponents.expand(UriComponents.java:152) ~[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.web.util.UriComponentsBuilder.buildAndExpand(UriComponentsBuilder.java:288) ~[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.hateoas.mvc.ControllerLinkBuilderFactory.linkTo(ControllerLinkBuilderFactory.java:145) ~[spring-hateoas-0.16.0.RELEASE.jar:na] at org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo(ControllerLinkBuilder.java:135) ~[spring-hateoas-0.16.0.RELEASE.jar:na] at org.springframework.data.rest.webmvc.RepositoryPropertyReferenceController.followPropertyReferenceCompact(RepositoryPropertyReferenceController.java:264) ~[spring-data-rest-webmvc-2.2.0.RC1.jar:na]

    Spring JIRA | 2 years ago | Dave LeBlanc
    java.lang.IllegalArgumentException: Map has no value for 'repository'
  3. 0

    ControllerLinkBuilderFactory should resolve placeholders

    GitHub | 2 years ago | m7t3n
    java.lang.IllegalArgumentException: Map has no value for 'myPath'
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Request param value with curly braces throws IllegalArgumentException

    GitHub | 2 years ago | dreambrother
    java.lang.IllegalArgumentException: Map has no value for '"foo"'
  6. 0

    spring-hateoas, How to set place holder value when building hypermedia link using onMethod

    Stack Overflow | 1 year ago | Khai No
    java.lang.IllegalArgumentException: Map has no value for 'teacherId'

    1 unregistered visitors
    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

      Map has no value for 'repository'

      at org.springframework.web.util.UriComponents$MapTemplateVariables.getValue()
    2. Spring
      UriComponentsBuilder.buildAndExpand
      1. org.springframework.web.util.UriComponents$MapTemplateVariables.getValue(UriComponents.java:277)[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE]
      2. org.springframework.web.util.UriComponents.expandUriComponent(UriComponents.java:221)[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE]
      3. org.springframework.web.util.HierarchicalUriComponents$FullPathComponent.expand(HierarchicalUriComponents.java:642)[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE]
      4. org.springframework.web.util.HierarchicalUriComponents.expandInternal(HierarchicalUriComponents.java:311)[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE]
      5. org.springframework.web.util.HierarchicalUriComponents.expandInternal(HierarchicalUriComponents.java:46)[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE]
      6. org.springframework.web.util.UriComponents.expand(UriComponents.java:152)[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE]
      7. org.springframework.web.util.UriComponentsBuilder.buildAndExpand(UriComponentsBuilder.java:288)[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE]
      7 frames
    3. Spring Hateoas
      ControllerLinkBuilder.linkTo
      1. org.springframework.hateoas.mvc.ControllerLinkBuilderFactory.linkTo(ControllerLinkBuilderFactory.java:145)[spring-hateoas-0.16.0.RELEASE.jar:na]
      2. org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo(ControllerLinkBuilder.java:135)[spring-hateoas-0.16.0.RELEASE.jar:na]
      2 frames
    4. Spring Data REST - WebMVC
      RepositoryPropertyReferenceController.followPropertyReferenceCompact
      1. org.springframework.data.rest.webmvc.RepositoryPropertyReferenceController.followPropertyReferenceCompact(RepositoryPropertyReferenceController.java:264)[spring-data-rest-webmvc-2.2.0.RC1.jar:na]
      1 frame