【问题标题】:readTimeout exception while http service invoker is used使用 http 服务调用程序时出现 readTimeout 异常
【发布时间】:2021-12-12 23:21:46
【问题描述】:

我是 Spring Boot 新手。

我收到此异常:无法在 [服务 URL] 访问 HTTP INVOKER 远程服务;嵌套异常是 Java.net.SocketTimeOutException: Read Time out。

我需要一个解决方案。我进入 XML 文件以在调用该服务 URL 时增加 readTimeout,但它说没有这样的属性 为该属性定义了一个 bean

我尝试增加服务器和客户端超时,但没有成功。

【问题讨论】:

标签: java spring spring-boot serversocket httpinvoker


【解决方案1】:

增加 httpInvokerRequestExecuter 的读取超时时间或者您可以将其设置为 0

<bean id="httpInvokerReqExecutor" class="org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecuto‌​r" > 
     <property name="readTimeout" value="0" /> 
</bean> 

试试这个。

【讨论】:

  • 感谢您的帮助。但它不起作用。在我定义了我在问题的评论中提到的 bean 之后,我将这一行添加到 .XML 文件中
  • 请检查 bean id 和 ref 是否相同。
  • Bean I'd - 是客户端将使用的服务 URL,ref 是 httpReqExecutor
  • 我要创建的 bean 旁边的所有类都是由扩展 HttpinvokerProxyfactorybean 的用户创建的
  • 是的,我明白了。我正在讲述这个id="httpInvokerReqExecutor"ref="httpReqExecutor"
猜你喜欢
  • 2014-01-21
  • 2010-12-11
  • 1970-01-01
  • 2017-09-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多