RemoteInstanceRequestClientImpl client = null;
ServerSocket server = new ServerSocket(port, 0);
try
{
client = new RemoteInstanceRequestClientImpl(new RemoteConnectionConfiguration());
client.getWebResource(new URI("http://localhost:" + port), MediaType.WILDCARD_TYPE, Object.class);
}
catch ( Exception e )
{
Throwable cause = e.getCause();