Record a question about Hessian that I met a long time ago
in the process of implementing web service with Hessian, the HTTP post method is used to transfer data when creating objects. However, in the case of nginx, an exception (com.caucho.hessian.client.hessianconnectionexception: 411: java.io.ioexception: server returned HTTP response code: 411 for URL: http://xxxx/xxx/xxxService ) 。
first of all, let’s look at the HTTP 411 error explanation: the length required server cannot process the request unless the client sends a content length header( HTTP 1.1 new) this is because Hessian sends data in chunked encoding by default when communicating with the server, and the reverse proxy can only process the request by obtaining the content length header, but this parameter is not added to Hessian’s request<
we use spring + Hessian for service:
when Hessian’s own factory generates objects:
in com.caucho.hessian.client.HessianProxyFactory, ChunkedPost defaulted true
private boolean _isChunkedPost = true;
The parameters for exchanging data with the server are sent in chunks, but for the time being nginx does not support
spring’s proxyfactorybean object has a setchunkedpost method, so we can set chunkedpost to false when configuring beans, so as to realize communication through nginx
<bean id="xxx" class="org.springframework.remoting.caucho.HessianProxyFactoryBean">
<property name="serviceUrl" value=""/>
<property name="serviceInterface" value=""/>
<property name="chunkedPost" value="false"/>
</bean>
Similar Posts:
- Visit the back-end application through nginx and report an error err_ CONTENT_ LENGTH_ MISMATCH
- Back end: 414 request URI too large solution
- Nginx an upstream response is buffered to a temporary file,nginx502 Error
- Client IP address forgery, CDN, reverse proxy, access to those things
- [Solved] Nginx proxy Timeout: upstream timed out (110: Connection timed out)
- HTTP status code 499 [How to Solve]
- Request object error ASP 0104:80004005 operation not allowed
- What does HTTP status code 304 mean
- Websocket failed: Error during WebSocket handshake: Unexpected response code: 400 [Solved]