我们有一个运行在WebSphere应用服务器(以下简称“客户端”)上的Java应用程序,它通过一个负载均衡器对分布在两个数据中心的另一个应用程序进行web服务调用。
负载平衡器的工作方式如下:
例如:
> curl -i -s -k https://stealthwsort-1810.*.*/StealthWS/StealthServices
HTTP/1.0 302 Found
Location: https://stealthwsort-1810-vip.*.*:5443/StealthWS/StealthServices
Content-Type: text/html
Expires: Mon, 1 Jan 2001 00:00:00 GMT
Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Server: BigIP
Connection: Keep-Alive
Content-Length: 0由于某些原因,我们的客户端应用程序不理解来自负载均衡器的HTTP 302响应,并在日志中抛出WSWS3514E和WSWS3499W错误:
[3/23/16 9:12:36:066 GMT] 00000029 HttpOutboundC E WSWS3514E: No HTTP response body is available from the connection for: https://stealthwsort-1810.apaas-np.*.*/StealthWS/StealthServices
[3/23/16 9:12:36:068 GMT] 00000029 SystemOut O esEligibilityWs(ERROR)=Unable to process the Stealth Status request at site : https://stealthwsort-1810.apaas-np.*.*/StealthWS/StealthServices : Error : WSWS3499W: Redirected new location: https://stealthwsort-1810.apaas-np.*.*/StealthWS/StealthServices
at bundles.workflow.classes.TaskWrapper.execute(TaskWrapper.java:581)
at bundles.workflow.classes.ProcessController.processTask(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1661)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1602)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:113)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:80)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:908)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:939)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:507)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:181)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:374)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:878)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1592)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:191)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:453)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:306)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:84)
at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1819)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture$1.run(AsyncChannelFuture.java:205)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1660)IBM网站建议:
有关如何接受自动重定向到新位置的详细信息,您可能需要查看产品文档。
但在这件事上我找不到任何具体的手册。
请给我指出正确的方向。如有需要,我会提供更多详情。
谢谢你,叶夫根
发布于 2016-03-23 15:39:43
要开始,您需要为JVM配置一些附加的HTTP传输属性:
- Set the `com.ibm.ws.webservices.HttpRedirectEnabled` Java system property to true.
- Programmatically set the `com.ibm.wsspi.webservices.Constants.HTTP_REDIRECT_ENABLED` property to a java.lang.Boolean object in the Stub or Call object before invoking the service. For example, use any of the following `java.lang.Boolean` values to set the property to true:
- Boolean.TRUE
- new Boolean(true)
- new Boolean("true")
根据要求,可以在以下链接上找到产品文档:configaddhttppropertiesadmin
https://stackoverflow.com/questions/36181986
复制相似问题