When using apache library for HttpClient
and HttpPost
with GWT generates 500 Internal Server Error
.
I am using packages as:
org.apache.http.client.HttpClient
org.apache.http.client.methods.HttpPost
Calling the below code from RPC Impl class (server side) this error is generated.
client.execute(post);
It gives an error in browser console.log
as below:
http://localhost:<port>/<AppName>/package.name.Main//MyServiceImpl 500 (Internal Server Error)
Suggest what exactly the problem is, and how will I be able find the solution on the same.
Added: I am using tomcat 8.0 as server and Netbeans IDE 8.0.1 for development and GWT-2.3.0.
In Browser Inspect Element -> Network Tab, I am getting below information for POST Request:
Remote Address:127.0.0.1:8084
Request URL:http://localhost:<port>/<AppName>/package.name.Main//MyServiceImpl
Request Method:POST
Status Code:500 Internal Server Error
Request Headersview source
Accept:*/*
Accept-Encoding:gzip,deflate
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Content-Length:683
Content-Type:text/x-gwt-rpc; charset=UTF-8
Cookie:JSESSIONID=0FEAB78577E68748D4FBFC6E26FD4DCC
Inside Neatbeans, server logs I am getting below error. My method which is having a call to HttpClient post is giving the error:
threw an unexpected exception: java.lang.NoSuchFieldError: DEF_CONTENT_CHARSET