如何设置Glassfish通过代理服务器? [英] How do I set up Glassfish to go via a proxy server?

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

问题描述

我在办公室内在本地计算机上运行Glassfish v2.1.1实例时遇到问题,我们有一个用于传出连接的代理服务器。我最初的解决方法是在家工作。

I have been having issues with running a Glassfish v2.1.1 instance on my local machine from within the office, where we have a proxy server for outgoing connections. My initial workaround has been to work from home.

我在公司外部的HTTPS服务器上调用SOAP服务。由于Glassfish不通过公司的代理服务器,我在尝试初始化我的SOAP客户端时收到以下错误:

I am calling a SOAP service on a HTTPS server outside of the company. As Glassfish is not going via the company's proxy server, I get the following error when trying to initialise my SOAP clients:

javax.xml.ws.WebServiceException: Failed to access the WSDL at: https://www.hostname.com...

Caused by: java.net.UnknownHostException: www.hostname.com

我在我的命令行上设置了代理环境变量,以及我的系统代理设置都正常工作,以便我可以访问WSDL与浏览器。我应该如何配置Glassfish?

I have proxy environment variables set on my command line, as well as my system proxy settings all working correctly so that I can get to the WSDL with the browser. How should I configure Glassfish?

推荐答案

我有很多麻烦找到一个答案,在网上很多细节。一个链接告诉我如何配置HTTP代理,但没有提到HTTPS,所以我花了一段时间来弄清楚。

I had a lot of trouble finding an answer to this, as the topic isn't covered in a lot of detail on the web. One link told me how to configure the HTTP proxy, but mentioned nothing about HTTPS, so it took me a while to figure it out.

在Glassfish服务器上打开管理控制台,然后转到:
应用程序服务器 - > JVM设置 - > JVM选项。点击添加JVM选项4次并输入以下4个选项

Open up the admin console on your Glassfish server and go to: Application Server -> JVM Settings -> JVM Options. Click "Add JVM Option" 4 times and enter the following 4 options

-Dhttp.proxyHost=proxyhostname
-Dhttp.proxyPort=8080
-Dhttps.proxyHost=proxyhostname
-Dhttps.proxyPort=8080

其中proxyhostname和端口号对于您的设置是正确的。然后您需要重新启动服务器。

Where proxyhostname and the port number are correct for your setup. Then you need to restart the server.

请注意,我找不到任何选项,从PAC文件中设置代理,或者代理需要授权。在这种情况下,您可能需要安装一个本地身份验证代理处理程序,如Authox for Mac OS X,它会将您的本地主机变为非授权代理,并屏蔽来自中央授权代理的身份验证请求。

Note that I couldn't find any options for setting up the proxy from a PAC file, nor for proxies which require auth. In this case, you may need to install a local auth proxy handler like Authoxy for Mac OS X, which turns your localhost into a non-auth proxy and masks the authentication request from the central auth proxy.

此外,此链接适用于JVM的各种代理选项:
http://download.oracle.com/javase/6/docs/technotes/guides/net/proxies.html

Also, this link was good for various proxy options to the JVM: http://download.oracle.com/javase/6/docs/technotes/guides/net/proxies.html

这篇关于如何设置Glassfish通过代理服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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