Java 应用程序错误:resteasy servlet未完成其事务

Java 应用程序错误:resteasy servlet未完成其事务,java,jpa,jboss,resteasy,Java,Jpa,Jboss,Resteasy,以上是我在服务器控制台中遇到的错误。我正在向某个客户机发出请求,如果该客户机null我将返回响应。我想这是因为我正在重新调整响应,而没有执行完整的代码 下面的块正在产生此错误 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 complet

以上是我在服务器控制台中遇到的错误。我正在向某个客户机发出请求,如果该客户机
null
我将返回响应。我想这是因为我正在重新调整响应,而没有执行完整的代码

下面的块正在产生此错误

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

我应该做些什么来避免这种情况?

您是否构建了自己的响应

如果没有,这应该是可行的:

   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;
    }
您可以尝试以下方法:

return Response.status(theHTTPCOde).entity(yourBody/Message).build()
return Response.status(Response.Status.NOT_FOUND).entity("User not found : invalid client").build()