These are chat archives for spring-cloud/spring-cloud

17th
Feb 2016
Stevo Slavić
@sslavic
Feb 17 2016 10:28
hi there
is there already a library in spring-cloud or elsewhere, through which one can get CF app env vars?
like instance index etc
Stevo Slavić
@sslavic
Feb 17 2016 10:33
trying to get instance index, to use it as metric prefix in dropwizard metrics reporter to graphite
Dave Syer
@dsyer
Feb 17 2016 10:43
${vcap.application.index} (from memory)
It's added by Spring Boot so you will see it in the /env endpoint
Stevo Slavić
@sslavic
Feb 17 2016 10:44
ah, great, thanks
Stevo Slavić
@sslavic
Feb 17 2016 10:52
instance_index
Dreampie
@Dreampie
Feb 17 2016 10:53
@FeignClient(url = "http://localhost:8080")
public interface RestClient {

    @RequestMapping(value = "/", method = GET)
    List<Posicao> get(@RequestParam(value = "ids") Long[] ids);
}
I got MethodArgumentTypeMismatchException error, help
Dreampie
@Dreampie
Feb 17 2016 11:02
restClient.get(new Long[]{1L,2L});
@dsyer
Marcos Barbero
@marcosbarbero
Feb 17 2016 11:45
The service method has the same argument as the FeignClient?
Dreampie
@Dreampie
Feb 17 2016 12:18
yes, exactly the same
List<Posicao> get(@RequestParam(value = "ids") Long[] ids)
Dave Syer
@dsyer
Feb 17 2016 12:33
What does the exception message say?
It will list the arguments and the target type
Dreampie
@Dreampie
Feb 17 2016 12:40
only this MethodArgumentTypeMismatchException
Dave Syer
@dsyer
Feb 17 2016 12:43
That's not the message, that's just the type
You logs may contain the message as well
Dreampie
@Dreampie
Feb 17 2016 12:43
Wait a minute
Dreampie
@Dreampie
Feb 17 2016 13:05
Failed to bind request element: org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type [java.lang.String] to required type [java.lang.Long[]]; nested exception is java.lang.NumberFormatException: For input string: "[Ljava.lang.Long;@6c050270"
Dave Syer
@dsyer
Feb 17 2016 13:09
So the input string is in the wrong form
That's on the server?
Dreampie
@Dreampie
Feb 17 2016 13:13
yes
Dave Syer
@dsyer
Feb 17 2016 13:31
So your client is sending garbage. Can you open a new issue in spring-cloud-netflix, and give a full description of what you did on the client. Link to a sample projecty would be helpful.
Dreampie
@Dreampie
Feb 17 2016 13:42
spring-cloud/spring-cloud-netflix#829