Error 400 Bad Request
<p>I have some problem with making a good request.</p>

<pre><code>@Path("/activitiesGenerator")
public class ActivityResource {

ActivityStub acstub = new ActivityStub();

@GET
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public Collection&lt;Activity&gt; getAllActivities(){

    return acstub.Find_All_Activities();
}


@GET
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
@Path("{activityId}") // Will act as parameter that will take value from the browser!
public Response getActivity(@PathParam("activityId") String activityId){

    if(activityId.equals(null) || activityId.length() &lt; 4){

        return Response.status(Status.BAD_REQUEST).build();
    }

    Activity activity  = acstub.FindActivity(activityId);

    if(activity.equals(null)){

        return Response.status(Status.NOT_FOUND).build();
    }

    return Response.ok().entity(activity).build();
}
</code></pre>

<p>From here I pass the value! </p>

<pre><code>@Test
public void main() {

    ActivityClient client = new ActivityClient();

    Activity activity = client.get("3204987");

    System.out.println(activity);

    assertNotNull(activity);
}
</code></pre>

<p>Here I make the check of response.. </p>

<pre><code>public Activity get(String id){

    WebTarget target = client.target("http://localhost:8080/Activities/rest/");
    Response response = target.path("activitiesGenerator/"+id).request(MediaType.APPLICATION_JSON).get(Response.class);

    System.out.println(response.getStatus());

    if(response.getStatus() != 200){

        throw new RuntimeException(response.getStatus()+ ": there was an error on the server");
    }

    return response.readEntity(Activity.class);

}
</code></pre>

<p>I got an exception from get method. The response is 400 Bad request. 
  What did I make wrong?</p>

<p>Here is mine web.xml file! </p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://xmlns.jcp.org/xml/ns/javaee"
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
    id="WebApp_ID" version="3.1"&gt;

    &lt;display-name&gt;Activities&lt;/display-name&gt;
    &lt;servlet&gt;
        &lt;servlet-name&gt;ActiviteExample&lt;/servlet-name&gt;
        &lt;servlet-class&gt;org.glassfish.jersey.servlet.ServletContainer&lt;/servlet-class&gt;
        &lt;init-param&gt;
            &lt;param-name&gt;jersey.config.server.provider.packages&lt;/param-name&gt;
            &lt;param-value&gt;activity.model&lt;/param-value&gt;
        &lt;/init-param&gt;
    &lt;/servlet&gt;
    &lt;servlet-mapping&gt;
        &lt;servlet-name&gt;ActiviteExample&lt;/servlet-name&gt;
        &lt;url-pattern&gt;/rest/*&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
&lt;/web-app&gt;

 Could not get any response
 This seems to be like an error connecting to      http://HTTP://localhost:8080/Activities/rest/activities-generator/3204987.
 Why this might have happened:
 The server couldn't send a response:
 Ensure that the backend is working properly
 SSL connections are being blocked:
 Fix this by importing SSL certificates in Chrome
 Cookies not being sent:
</code></pre>

<p>Here is what I got from mine postman. I will appreciate if anybody can explain me more specific about this possible solutions...</p>