spring中使用HTTP调用器,出错!!
java.net.SocketException: Software caused connection abort: recv failed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read(BufferedInputStream.java:235)
at weblogic.net.http.MessageHeader.isHTTP(MessageHeader.java:220)
at weblogic.net.http.MessageHeader.parseHeader(MessageHeader.java:143)
at weblogic.net.http.HttpClient.parseHTTP(HttpClient.java:404)
at weblogic.net.http.HttpURLConnection.getInputStream(HttpURLConnection.java:337)
at weblogic.net.http.SOAPHttpURLConnection.getInputStream(SOAPHttpURLConnection.java:31)
at org.springframework.remoting.httpinvoker.SimpleHttpInvokerRequestExecutor.readResponseBody(SimpleHttpInvokerRequestExecutor.java:144)
at org.springframework.remoting.httpinvoker.SimpleHttpInvokerRequestExecutor.doExecuteRequest(SimpleHttpInvokerRequestExecutor.java:65)
at org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor.executeRequest(AbstractHttpInvokerRequestExecutor.java:68)
at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.executeRequest(HttpInvokerClientInterceptor.java:146)
at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:120)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
at $Proxy1.CostFeeIntegrationForOuter(Unknown Source)
at com.westerasoft.kdcerp.sys.cost.CostInterface.useCost(CostInterface.java:19)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
我得服务段配置
<bean id="testAccount" parent="baseTxService">
<property name="target">
<bean class="com..service.impl.testAccountImpl">
</bean>
</property>
</bean>
<bean name="/test" class="org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter">
<property name="service"><ref bean="testAccount"/></property>
<property name="serviceInterface">
<value>com.service.testAccount</value>
</property>
</bean>
客户端连接:
<bean id="testAccountImpl" class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">
<property name="serviceUrl">
<value>http://localhost:7001/mywebcontext/test</value>
</property>
<property name="serviceInterface">
<value>com.service.testAccount</value>
</property>
</bean>
调用代码:
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("/test.xml");
Object obj = ctx.getBean("testAccountImpl");
(testAccount)obj.Mytest(); //testAccount中定义的方法。
这时候就抛出开始的异常了,各位大侠,帮忙看看,感激不尽!!!
相关推荐
Spring远程调用使用http方式
Spring远程调用使用http方式,将server和client直接部署后,进入http://localhost/HttpClientSpringRMIClient/即可
AI自动化测试框架Browser Use深度实战:从原理到企业级应用
本文深入探讨了Playwright与大语言模型结合的技术架构及其在企业级测试场景中的应用。首先,解析了BrowserUse核心架构和关键技术组件,包括Playwright的多浏览器支持和LangChain的链式处理机制。接着,通过复杂表单提交测试和跨系统数据验证测试的实战案例,展示了该技术的实际应用效果。此外,文章还详细介绍了大模型执行效能的评测方法、二次开发实践、提示词工程最佳实践以及企业级部署方案。最后,展望了未来多模态测试增强和智能测试生成的发展方向,强调了AI+自动化测试技术在质量保障体系中的核心作
spring boot使用WebClient调用HTTP服务代码示例
主要介绍了spring boot使用WebClient调用HTTP服务代码示例,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
Spring Boot中Controller间的调用
假定两个Controller都在同一个工程中。 如果有比较合理的分层设计,这样的需求应该是非常罕见的。因为大部分情况下,调用应该都是限于对业务逻辑层或者数据库层,并不会涉及Controller之间的调用。 本文是讨论Controller A必须调用Controller B的情况。 Controller A可以返回redirect和forward指令来进行跳转到Controller A,但这不属于本文讨论的场景。 显然不应该通过直接创建Controller B的实例,再调用方法来完成。因为Controller B的实例中,Spring Boot为其进行配置和对象注入,这些准备工作不是简单通过实例化Controller B可以完成。
spring boot中使用http请求的示例代码
本篇文章主要介绍了spring boot中 使用http请求的示例代码,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧


