简体   繁体   English

如何在Weblogic Server 9.2上设置代理

[英]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服务器上设置代理?

  1. Set system properties http.proxyHost and http.proxyPort . 设置系统属性http.proxyHosthttp.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

  2. 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链接:

Configure Web Logic Proxi 配置Web Logic Proxi

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在WEBLOGIC 9.2服务器中使用JNDI访问Hibernate的SessionFactory? - How to access SessionFactory of Hibernate using JNDI in WEBLOGIC 9.2 server? WebLogic 9.2服务器中的JMS消息存储在哪里? - Where are JMS messages stored in WebLogic 9.2 server? 如何创建EJB Timer服务并将其部署到以eclipse运行的weblogic 9.2服务器? - How do I create an EJB Timer service and deploy it to a weblogic 9.2 server running in eclipse? 如果我在Weblogic 10.x上进行开发并部署到Weblogic9.2.x,会有多大的风险? - How risky if I develop on Weblogic 10.x and deploy to Weblogic9.2.x? 由于新服务器不支持SOAPMessage内容类型,Weblogic 9.2 Web服务客户端SOAP错误 - Weblogic 9.2 webservice client SOAP Fault due to SOAPMessage content-type not supported in new server 如何在WebServiceTemplate上设置代理服务器详细信息 - how to set proxy server details on WebServiceTemplate 在Weblogic 9.2中调用Webservice时发生NullPointerException - NullPointerException when calling webservice in Weblogic 9.2 在Weblogic 9.2上运行Spring应用程序的ClassCastException - ClassCastException running Spring app on Weblogic 9.2 Weblogic 9.2中找不到类异常 - Class not found Exception from Weblogic 9.2 Weblogic 9.2 是否支持 Sun Jdk 1.6? - Does Weblogic 9.2 support Sun Jdk 1.6?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM