[英]How to set proxy on weblogic server 9.2
I am using httpurlconnection to post on Facebook,but I am getting following exception 我正在使用httpurlconnection在Facebook上发帖,但出现以下异常
java.net.UnknownHostException: graph.facebook.com
might be due to proxy setting,same code running fine while running in a java stand alone application while putting following 可能是由于代理服务器设置,相同的代码在Java独立应用程序中运行时运行良好,
codeProxy proxy = new Proxy(Proxy.Type.HTTP,new InetSocketAddress("proxy.domain.com", 8080))
Can any one tell how to set proxy on weblogic server? 谁能告诉我如何在Weblogic服务器上设置代理?
Set system properties http.proxyHost
and http.proxyPort
. 设置系统属性
http.proxyHost
和http.proxyPort
。 You can do this with System.setProperty()
, or from the command line with the -D
syntax. 您可以使用
System.setProperty()
或从命令行使用-D
语法来执行此操作。 and kindly refer to http://docs.oracle.com/javase/7/docs/api/java/net/doc-files/net-properties.html#Proxies 并请参阅http://docs.oracle.com/javase/7/docs/api/java/net/doc-files/net-properties.html#Proxies
you also need to declare -DUseSunHttpHandler=true
in the weblogic. 您还需要在
-DUseSunHttpHandler=true
中声明-DUseSunHttpHandler=true
。 it will force use sun/oracle sun.net.www.protocol.http.HttpURLConnection
implemention for java.net.HttpURLConnection
instead of weblogic.net.http.SOAPHttpURLConnection
它将强制对
java.net.HttpURLConnection
使用sun / oracle sun.net.www.protocol.http.HttpURLConnection
实现,而不是weblogic.net.http.SOAPHttpURLConnection
try to use connection.usingProxy() to verify the proxy works or not after openConnection(); 尝试在openConnection()之后使用connection.usingProxy()验证代理是否有效;
To configure WebLogic proxy file is modified setDomainEnv.cmd (Windows) that is located in the bin folder of the domain. 要配置WebLogic代理文件,需要修改该域的bin文件夹中的setDomainEnv.cmd(Windows)。
For example for the integrated server is here 例如集成服务器在这里
C: \ Users \ [YOUT USER NAME] \ AppData \ Roaming \ JDeveloper \ system11.1.1.4.37.59.23 \ DefaultDomain \ bin
The following property must be placed on file with the details of your proxy 以下属性必须与代理详细信息一起放在文件中
@REM Estableciendo proxi
set JAVA_OPTIONS=%JAVA_OPTIONS% -Dhttp.proxySet=true -Dhttp.proxyHost=192.168.101.11 -Dhttp.proxyPort=8080 -Dhttp.nonProxyHosts=localhost
See the nex link: 请参阅nex链接:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.