title: No injection source found for a parameter in rest-service with jaxrs
body: <p>I have the problem, that two methods of my rest service bring the error on deploy, that there is no injection source.</p>
  
  <p>My Service looks like this:</p>
  
  <pre><code>@Path("/chatservice")
  public class ChatServiceImpl implements ChatService{
  
  @POST
  @Path("/registerToServer")
  @Consumes(MediaType.APPLICATION_JSON)
  @Override
  public Response registerToServer(User user) {
  
      UserList userListObject = getAllChatableUsers(user);
  
      return Response.status(200).entity(userListObject).build();
  }
  
  @POST
  @Path("/sendMessage")
  @Consumes(MediaType.APPLICATION_JSON)
  @Override
  public Response sendMessage(Message message) {
      boolean isSuccess = putMessageIntoDatabase(message);
  
      return Response.status(200).build();
  }
  
  @POST
  @Path("/getAllMessagesForUser")
  @Consumes(MediaType.APPLICATION_JSON)
  @Override
  public Response getAllMessagesForUser(UserWithRecipient userWithRecipient) {
  
      return Response.status(200).build();
  }
  
  @POST
  @Path("/getAllMessagesForUser/{numberOfMessages}")
  @Consumes(MediaType.APPLICATION_JSON)
  @Override
  public Response getMessagesForUser(@PathParam("numberOfMessages") int numberOfMessages, UserWithRecipient userWithRecipient) {
  
      return Response.status(200).build();
  }
  </code></pre>
  
  <p>The Class whith the Problem is the following:</p>
  
  <pre><code>@XmlSeeAlso(User.class)
  @XmlRootElement
  public class UserWithRecipient {
  
  private User user;
  private User recipient;
  
  public UserWithRecipient() {
  }
  
  public User getUser() {
      return user;
  }
  
  public void setUser(User user) {
      this.user = user;
  }
  
  public User getRecipient() {
      return recipient;
  }
  
  public void setRecipient(User recipient) {
      this.recipient = recipient;
  }
  }
  </code></pre>
  
  <p>And the error I get is the following:</p>
  
  <pre><code> [[FATAL] No injection source found for a parameter of type public javax.ws.rs.core.Response de.hszg.fei.ws.service.ChatServiceImpl.getMessagesForUser(int,de.hszg.fei.ws.model.UserWithRecipient) at index 0.; source='ResourceMethod{httpMethod=POST, consumedTypes=[application/json], producedTypes=[], suspended=false, suspendTimeout=0, suspendTimeoutUnit=MILLISECONDS, invocable=Invocable{handler=ClassBasedMethodHandler{handlerClass=class de.hszg.fei.ws.service.ChatServiceImpl, handlerConstructors=[org.glassfish.jersey.server.model.HandlerConstructor@6da34189]}, definitionMethod=public javax.ws.rs.core.Response de.hszg.fei.ws.service.ChatServiceImpl.getMessagesForUser(int,de.hszg.fei.ws.model.UserWithRecipient), parameters=[Parameter [type=int, source=numberOfMessages, defaultValue=null], Parameter [type=class de.hszg.fei.ws.model.UserWithRecipient, source=null, defaultValue=null]], responseType=class javax.ws.rs.core.Response}, nameBindings=[]}']]]
  </code></pre>
  
  <p>Can you tell me what is the problem with this class. I also don't understand, why the <code>sendMessage()</code> method doesn't brings the same problem.</p>