2

What's the difference between creating a new Client instance using ClientFactory and ClientBuilder in JAX-RS?

cassiomolin
  • 124,154
  • 35
  • 280
  • 359
RedPe4rl
  • 185
  • 1
  • 2
  • 10

1 Answers1

2

The ClientFactory class does not exist in the Client API, introduced in JAX-RS 2.0. Have a look at the javax.ws.rs.client package.

The ClientFactory class was present in the release candidates and milestones of the JAX-RS 2.0 specification, but was replaced with the ClientBuilder class. For more details, you can check the old versions of the javax.ws.rs-api artifact.

To create Client instances, use ClientBuilder:

Client client = ClientBuilder.newClient();
cassiomolin
  • 124,154
  • 35
  • 280
  • 359