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

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • 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]
    via by Dave LeBlanc,
  • 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]
    via by Dave LeBlanc,
    • 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]

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,