我在配置代理以连接到 Weblogic 10.3.5 上的
我无法使用 WebService
时遇到问题。System.setProperty()
因为它必须是每个连接的方法。
我必须使用的代理必须具有“UserAgent
” header 。
我尝试了两种选择:
ClientProxyFeature
但它不起作用,因为它生成请求 没有“UserAgent header”的代理。ProxySelector
:这种方法在 JUnit 测试中效果很好,但是当我运行时 在 Weblogic 上我收到以下错误
error: java.net.SocketException: Unknown proxy type : HTTP at...
有什么办法可以解决这个问题吗? 非常感谢提前
亚当
最佳答案
我们可以使用 ProxySelector 来做到这一点。我们唯一更改的是服务器启动参数:-DUseSunHttpHandler=true。现在它可以工作并发送 User-Agent header 。
关于java - 代理的Weblogic设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22887615/