JBoss Community

RESTEasy HttpProtocol Exception JBOSS AS 7.

created by John Wasmat in JBoss AS 7 Development - View the full discussion

Hello,

 

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("http://127.0.0.1:4447/queue/jms.queue.test");

       JSONObject json = new JSONObject();

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

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

       input.setContentEncoding("UTF-8");

       input.setContentType("application/json");

       post.setEntity(input);

       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 deployements folder of the JBOSS AS 7 directory. I also have the hornetq-rest.cml 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.

 

Thanks.

Reply to this message by going to Community

Start a new discussion in JBoss AS 7 Development at Community