代理的 Weblogic 设置 [英] Weblogic setting for proxy

查看:113
本文介绍了代理的 Weblogic 设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Weblogic 10.3.5上连接到WebService的代理配置有问题.我无法使用System.setProperty()因为它必须是每个连接方法.我必须使用的代理必须具有UserAgent"标头.

我尝试了两种选择:

  1. ClientProxyFeature 但它不起作用,因为它生成请求代理没有UserAgent 标头".
  2. ProxySelector:这种方法在 JUnit 测试中效果很好,但是当我运行时它在 Weblogic 上我收到以下错误

<块引用>

错误:java.net.SocketException:未知代理类型:HTTP at...

有什么办法可以解决这个问题吗?提前致谢

亚当

解决方案

我们可以使用 ProxySelector 做到这一点.我们唯一改变的是服务器启动参数:-DUseSunHttpHandler=true.现在它可以工作并发送 User-Agent 标头.

I have a problem with configuration of proxy to connect to WebService on Weblogic 10.3.5. I cannot use System.setProperty() because it has to be per connection aproach. Proxy which I have to use has to have "UserAgent" header.

I have tried two options:

  1. ClientProxyFeature but it doesn't work because it generate request to proxy without "UserAgent header".
  2. ProxySelector: this approach work great on JUnit test but when I run it on Weblogic I receive following error

error: java.net.SocketException: Unknown proxy type : HTTP at...

Is there any way to work this around? Many Thanks in advance

Adam

解决方案

We are able to do this with ProxySelector. The only thing which we have changed was server start parameter: -DUseSunHttpHandler=true. Now it works and send User-Agent header.

这篇关于代理的 Weblogic 设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆