1 2 Previous Next 15 Replies Latest reply on Dec 7, 2012 11:23 AM by nickarls

    RESTEasy HttpProtocol Exception JBOSS AS 7.




      I`m trying to develop a Java ReastEasy client to send messages to a hornetq queue. I followed the steps listed in the jboss documentation but I couldnt find any help to this issue Following is my client code


      HttpClient client = new DefaultHttpClient();

             HttpPost post = new HttpPost("");

             JSONObject json = new JSONObject();

             json.append("test", "test");

             StringEntity input = new StringEntity(json.toString());




             post.addHeader("accept", "application/json");

             HttpResponse response = client.execute(post);


      I`m receving the following errors.


      a) On the cleint side


      Exception in thread "main" org.apache.http.ProtocolException: The server failed to respond with a valid HTTP response


      b) On the server side


      22:51:05,530 ERROR [org.jboss.remoting.remote.connection]  JBREM000200: Remote connection failed: java.io.IOException: Receiv

      ed an invalid message length of 1347375956




      I have a web.xml file that I have created based on the rest documentation and placed it in the deployments folder of the JBOSS AS 7 directory. I also have the hornetq-rest.xml file in the same folder. Both get deployed correctly. I`m not sure if this is a code issue or I`m missing any configuration on the server side. Any help would be appreciated.



        1 2 Previous Next