q1345111 2014-09-23 07:13
浏览 2272

hessian的RemoteConnectFailureException

server端的web.xml

<servlet>
    <servlet-name>remote</servlet-name>
    <!-- 使用Spring的代理Servlet -->
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
            classpath:spring-context.xml,
            classpath:spring-hibernate.xml,
            classpath:remote-servlet.xml
        </param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
    <servlet-name>remote</servlet-name>
    <url-pattern>/remote/*</url-pattern>
</servlet-mapping>

remote-servlet.xml

<bean name="/curd" class="org.springframework.remoting.caucho.HessianServiceExporter">
    <!-- service引用具体的实现-->
    <property name="service" ref="dbLogicImpl" />
    <property name="serviceInterface" value="com.csair.prcmapp.interfaces.DbLogic" />
</bean>

remote-client.xml

<bean id="dbLogic" class="org.springframework.remoting.caucho.HessianProxyFactoryBean">
    <!-- 请求代理Servlet路径 -->
    <property name="serviceUrl">
        <value>${remote.hessian.url}/curd</value>
    </property>
    <!-- 接口定义 -->
    <property name="serviceInterface">
        <value>com.csair.prcmapp.interfaces.DbLogic</value>
    </property>
    <property name="proxyFactory" ref="hessianProxyFactory" />
</bean>

在使用hessian中遇到初次启动服务端和客户端的时候连接交互没有问题,服务器半小时左右不动不访问之后,再进行访问的时候首次连接时间很长,设置超时之后就报Caused by: org.springframework.remoting.RemoteConnectFailureException: Cannot connect to Hessian remote service at [http://127.0.0.1:8080/remote/curd]; nested exception is com.caucho.hessian.client.HessianConnectionException: 500: java.net.SocketTimeoutException: Read timed out.

  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥15 求差集那个函数有问题,有无佬可以解决
    • ¥15 MATLAB动图问题
    • ¥15 【提问】基于Invest的水源涵养
    • ¥20 微信网友居然可以通过vx号找到我绑的手机号
    • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
    • ¥15 解riccati方程组
    • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
    • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
    • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
    • ¥50 树莓派安卓APK系统签名