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 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
    • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
    • ¥15 如何处理复杂数据表格的除法运算
    • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
    • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
    • ¥200 uniapp长期运行卡死问题解决
    • ¥15 latex怎么处理论文引理引用参考文献
    • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
    • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
    • ¥15 乘性高斯噪声在深度学习网络中的应用