[jboss-dev-forums] [JBoss AS 7 Development] - RESTEasy HttpProtocol Exception JBOSS AS 7.

John Wasmat do-not-reply at jboss.com
Sun Nov 25 22:53:19 EST 2012


John Wasmat [https://community.jboss.org/people/johnwasmat] created the discussion

"RESTEasy HttpProtocol Exception JBOSS AS 7."

To view the discussion, visit: https://community.jboss.org/message/778248#778248

--------------------------------------------------------------
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 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
[https://community.jboss.org/message/778248#778248]

Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2225]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20121125/007b7a89/attachment.html 


More information about the jboss-dev-forums mailing list