Can anyone help me with how to handle timeout for a Rest call in spring?

I tried these :
1. Setting JVM parameter –As the rest services dependent on JDK HTTP client in some of the Rest implementations
-Dsun.net.client.defaultConnectTimeout=1000 (Time to establish connection in millisec)  Connection time out
-Dsun.net.client.defaultReadTimeout=1000 (Time to read content in millisec)  Read time out

This is not working.

2. http://stackoverflow.com/questions/9...h-resttemplate

But, ran into jar issues as mentioned in:
http://forum.springsource.org/showth...-rest-template

Can anyone please help here?

Thanks,
Stit.