2013-08-01 13 views
3
2013-08-01 11:30:18,176 ERROR [org.jboss.web.tomcat.service.jca.CachedConnectionValve] (http-127.0.0.1-8080-1) Application error: resteasy-servlet did not complete its transaction 

。我正在向某個客戶發出請求,如果客戶是null我正在返回響應。我認爲這是因爲我在不執行完整代碼的情況下重新調整響應。應用程序錯誤:以上是我在服務器控制檯我得到一個錯誤RestEasy的小服務程序並未完成其交易

以下塊使這個錯誤

Users client = PersistanceService.findModel(Users.class, request.getClientId()); 
    //checking if its a valid client 
    if (client == null) { 
     LOGGER.warn("User not found : invalid client"); 
     return response; 
    } 

我應該怎麼做才能避免這種情況?

回答

0

你有建立你的迴應嗎?

如果不是這應該工作:

return Response.status(theHTTPCOde).entity(yourBody/Message).build() 

你可以嘗試這樣的事:

return Response.status(Response.Status.NOT_FOUND).entity("User not found : invalid client").build() 
相關問題